The NEAT algorithm has been used to make a game bot. The population size were sat to 100.
The game was developed by Shivam Shekhar: https://github.com/shivamshekhar/Chrome-T-Rex-Rush. Small modifications were done to make the game more compatible with the neat algorithm.
The game were created in pygame. And neat-python was used to run the neat algorithm.
neat-python==0.92
pygame==1.9.6
The neural network is a simple feed forward network with 5 inputs and 2 outputs.
Input nodes (5):
- Dinosaur y-position
- Next obstacle y-position
- Next obstacle x-position
- Obstacle after that's y-position
- Obstacle after that's x-position
Output nodes (2):
- Jump or not jump
- Duck or not duck
The genomes were rewarded with 0.1 points each tick they managed to stay alive. Given a frame rate at 60 ticks per second, the reward is equivalent to 6 points per second.
The genome with the highst score were selected.