AI for Super Mario Bros via genetic algorithms
Top 76.8% on sourcepulse
This project implements an AI agent for Super Mario Bros. using genetic algorithms and neural networks. It targets researchers and enthusiasts interested in evolutionary computation and game AI, offering a framework to train agents to play through various levels of the game.
How It Works
The project employs a genetic algorithm to evolve a population of neural network agents. Each agent's "brain" is a neural network that takes game state (a cropped portion of the screen) as input and outputs controller actions. The fitness of each agent is determined by a configurable fitness_func
that considers factors like frames survived, distance traveled, and level completion. Through mutation, crossover, and selection, fitter agents are favored in subsequent generations, gradually improving performance.
Quick Start & Requirements
pip install -r requirements.txt
python -m retro.import "/path/to/unzipped/super mario bros. (world)"
.gym-super-mario-bros
and nes-py
are implicitly required via requirements.txt
.Highlighted Details
settings.config
file, allowing customization of neural network architecture, genetic algorithm parameters, and fitness functions.Maintenance & Community
The project appears to be a personal project by Chrispresso. There are no explicit mentions of community channels, ongoing development, or notable contributors beyond the author.
Licensing & Compatibility
The README does not explicitly state a license. Given the reliance on a ROM, users must ensure they comply with the legal requirements for obtaining and using game ROMs.
Limitations & Caveats
The project requires a Super Mario Bros. ROM, which may have legal implications depending on the user's jurisdiction. The README does not specify compatibility with different Super Mario Bros. versions or other emulators. The project is presented as a personal endeavor, and the level of ongoing maintenance or support is not detailed.
4 years ago
1+ week