SuperMarioBros-AI  by Chrispresso

AI for Super Mario Bros via genetic algorithms

created 5 years ago
375 stars

Top 76.8% on sourcepulse

GitHubView on GitHub
Project Summary

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

  • Install: pip install -r requirements.txt
  • ROM: Requires the Super Mario Bros. ROM. Import it using python -m retro.import "/path/to/unzipped/super mario bros. (world)".
  • Python: 3.6 or newer.
  • Dependencies: gym-super-mario-bros and nes-py are implicitly required via requirements.txt.
  • Setup: ROM import and dependency installation.

Highlighted Details

  • Successfully trained agents to complete levels 1-1 through 7-1, including learning advanced mechanics like flagpole glitches and walljumps.
  • Highly configurable via a settings.config file, allowing customization of neural network architecture, genetic algorithm parameters, and fitness functions.
  • Supports replaying and loading specific individuals from previous runs for analysis or experimentation.
  • Includes options to disable display for faster training and a debug flag for monitoring progress.

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.

Health Check
Last commit

4 years ago

Responsiveness

1+ week

Pull Requests (30d)
0
Issues (30d)
0
Star History
5 stars in the last 90 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), Mckay Wrigley Mckay Wrigley(Founder of Takeoff AI), and
1 more.

street-fighter-ai by linyiLYi

0.1%
6k
AI agent for Street Fighter II using deep reinforcement learning
created 2 years ago
updated 1 year ago
Feedback? Help us improve.