This repo is an AI which utilizes NEAT (Neuroevolution of Augmenting Topologies) algorithm to train and play the popular game DoodleJump.
In this repo, we built the Doodler Game from the ground up using Pygame. In addition, we also documented the process of training the AI with 3 different versions of inputs for the doodler AI.
- Download dependencies:
pip install pygame neat-python
- Run the corresponding python file to see the training yourself. There are 3 options in this repo:
random_doodler.py
: This version contains 50 randomly-controlled doodler. It serves as a good control envrionment to see if the NEAT algorithm improves its ability to play Doodle Jump.neat_doodler_5_inputs.py
: This version trains the doodler with 5 inputs: doodler's velocity in y direction, x-distances and y-distances between the doodler and the closest platform above and the distances between it and the closest platform below. This is the option 2 descripted in the paper that goes alone with this repo.neat_doodler_17_inputs.py
: This version trains the doodler with 17 inputs: x-distances and y-distances between the doodler and the closest platform from 8 different directions (up, down, left, right, and 4 diagonal directions) and whether the doodler is moving up or down (the y-velocity of the doodler). This corresponds to option 3 in the paper.
- Watch as the neural network learns to beat DoodleJump
If you are too lazy to run the code above, here's some pretrained video for our demo purposes:
DoodleJump-NEAT-AI And A Comparative Analysis on the Importance of Inputs and Reward System
Efficient Evolution of Neural Network Topologies
- Make sure that the doodler always has a platform that is reachable
- make the gravity and bounce scale correctly so that the game gets more difficult
- make sure that the doodler's sideswitching doesn't affect the collision detection
- make the doodler be able to switch sides of the screen from the edge
- create a losing screen
- animate legs to jump
- make it so that when the doodler changes the way it's facing it looks nicer
- change is_view_of function to work preoperly
- change line calcuations to be at the center of the platforms and doodlers
- go through NEAT branch and make sure it matches master branch
- make sure that doodlers aren't able to accelerate like crazy