All aspects of the simulation, the learning process and the user interface, may be altered using the Global settings. These can be found in the file Globals.java, along with a short explanation of each setting. We'll now walk through the various parameters and explain their function. Details on how to properly set them should still be looked up in Globals.java. The file also contains a number of constants, which should in principle not be changed.
Some settings influence the structure of the network and altering them at a later time will make the simulation unreliable. During training, the framework automatically stores the values of these settings along with the current weights of the network, in the directory NN. By setting this variable, one might load a file from the NN directory and so continue an earlier simulation. This makes it easy to train without the graphical interface and later visualize the results. Set to the filename to load an earlier simulation. Leave empty to start a new simulation. Even if an earlier simulation is loaded, training will still continue in a new file.
The various input algorithms require to know the maximum path length between two points in the maze. Because it is computationally heavy to calculate this in every game, it must be statically set using this variable.
Optionally, you might want certain settings to change throughout the game. You can do this by settings this variable to true and enabling a training regimen. You will be required to properly alter the contents of the function trainingRegimen, which can be found below this setting. See [Training regimens] for more information on how to set this up. Please note that enabling a training regimen can sometimes produce odd results in the various graphical plots.
When ghosts are spawned, what should be there initial ghost state? You can set this to either GHOST_RANDOM, GHOST_CHASE, GHOST_SCATTER or GHOST_AFRAID.
Although the game of Ms. Pac-Man is continuous, we need to allow the neural network to propagate the input at discrete steps. To change these intervals you can alter Ms. Pac-Man's speed by changing this setting. The value decides the distance that Ms. Pac-Man travels per network run.
When the visualisation of the game is disabled, the framework will run at full speed. However, when visualising the game we need to set the speed at which we want it to run. Change this setting to the amount of network runs which should be performed per second. Together with pacmanSpeed, it will decide how much distance Ms. Pac-Man travels per second.
The framework will automatically let the agent play all mazes in the directory maze. Set this setting to false to let the simulation end once all mazes have been played once. Set this setting to true to let the framework keep selecting a random maze.
How long should the effect of a power pill last? Set this setting to the amount of distance Ms. Pac-Man should travel before a power pill loses its effect.
Ghosts travel less quickly when Ms. Pac-Man eats a power pill and they become afraid. When a ghost is afraid its normal speed will be multiplied with the value of this setting. So setting it to 0.5 will half the speed.
When a ghost is eaten it quickly travels back towards its spawn point. During this time he cannot interact with objects or players. When a ghost is eaten its normal speed will be multiplied with the value of this setting. So setting it to 2 will double the speed.
When Ms. Pac-Man is eating pills she travels slightly slower. When this is the case Ms. Pac-Man's normal speed will be multiplied with the value of this setting. So setting it to 0.5 will half the speed.
It is possible to force all ghosts into a specific state, instead of letting them automatically cycle through them. To enable this, set alwaysEnabled to true and set alwaysState to either GHOST_RANDOM, GHOST_CHASE, GHOST_SCATTER or GHOST_AFRAID.
Out of the box, the framework incorporates three neural networks which were dubbed DODGE, ROBERT and HUNT. By setting activeNet to either NETWORK_DODGE, NETWORK_ROBERT or NETWORK_HUNT, only the corresponding neural network will be used. By setting it to NETWORK_AUTO, the framework will automatically switch between the three of them using the function SelectProperNetwork in PacMan.java. Alternatively activeNet can be set to NETWORK_ACTION, to let the framework use one neural network per action (left, right, up, down).
Documentation: Ghost behaviour
Documentation: Home
Documentation: Introduction
Documentation: Mazes
Documentation: Training regimens