This program uses the NEAT algorithm to evolve a
Neural Network to play the original Super Mario Bros.
For an in-depth explanation, watch this video
You can install the requirements by running
sudo requirements.sh
Or if on windows, run
pip install -r requirements.txt
- Make sure you have FCEUX downloaded and added to PATH
The finisher.pkl file contains the best genome on generation 2284.
In ./Files, you can find the backup for generation 2284, and the backup for generation 2492,
which is where I stopped training.
You can continue training by running
python3 main.py cont_train --gen <num_generations> --file <file>
To run the finisher.pkl file, run
python3 main.py run
or run
python3 run.py
If you want to run a different file, run
python3 main.py run --file <file_name>
For debugging values, you can change any of the values in the config file. Note that you have to train from the 1st generation for some to take effect.
To use a different config file when training, specify --config <config file>
when running main.py
.
This program uses the build in python module multiprocessing, which is used for parallel computing. You can adjust the amount of genomes
to run at once by specifying --parallel <num_of_genomes>
when running main.py
.
The default level is World 1, Level 1. This can be changed by specifying --level <level>
when running main.py
. For example,
python3 main.py train --gen 100 --level "1-1"
will use 1-1.
The finisher.pkl
file is trained to complete 1-1. It can complete it around 50% of the time. The run.py
file keeps running the
simulation until it completes the level. Ctrl + C
will stop it.
A Makefile is included for easy installation.
To install using make run
sudo make
The Wiki contains more information regarding the specifics of implementing certain parts.