Download/clone the directory with the green button at the top right of this site and execute the PacmanStage.py to run the simulation.
In this simulation pacman uses his vision range in front of him to asses the situation, through the usage of a convolutional neural network. This distance of an object to pacman is translated into a depth (image resize) and the whole image is overlayed with noise, which can be set to a desired strength.
There are 4 modes:
The game starts in pause mode, which can be accesed any time by pressing "p"-key within another mode.
This should be used to train the CNN. First activation of "d"-key will start the collection of images. After this "d"-key can be used to add new epochs (train the network with another random configuration of the training data). The accuracy relative to the complete trainingdata set is shown (100% recommended for pacman not to get stuck).
Here is the actual field of pacman. Use "f" to activate this mode, but if CNN is not well trained, pacman can get stuck... You can also copy the weights and biases from a previously trained network (100% accuracy) by pressing "i"-key (input network). Or use the "o"-key to overwrite this with your current NN weights and biases.
Here pacman is fixed in place and is presented with the three objects: "wall", "ghost" and "coin". His responses can be observed stably.
move pacman up
move pacman down
move pacman left
move pacman right
increase noise in pacman's vision
decrease noise in pacman's vision
increase the frame delay -> lower game speed
decrease the frame delay -> higher game speed
(first) activate data collection mode, (next) add training iteration/epoch to update CNN, accuracy echo'd in terminal
reset the weights and biases in the CNN to random new numbers
load NN preset weights and biases (100% accuracy)
overwrite the NN preset weights and biases with your currenct NN weights and biases
activate the lab game mode
activate the field/staging game mode
set building mode (activate this before loading wall preset!)
either one of the numbers can be used to load a wall present (when in building mode!^)
either one of the numbers can be used to store a wall preset (when not in building mode, carefull for overwrites!)
pause the current game mode
add wall
remove wall
identify the object under mouse, shown in terminal