Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
A Python toolkit used to train reinforcement learning algorithms against arcade games
| Date | Stars |
|---|---|
| 2026-07-31 | 663 |
| 2026-08-06 | 663 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# The MAME RL Algorithm Training Toolkit
## About
This Python library will allow you to train your reinforcement learning algorithm on almost any arcade game. It is currently available on Linux systems and works as a wrapper around [MAME](http://mamedev.org/). The toolkit allows your algorithm to step through gameplay while recieving the frame data and internal memory address values for tracking the games state, along with sending actions to interact with the game.
## Requirements:
- Operating system: Vast majority of desktop and server Linux distributions
- Instruction set: amd64 (this includes intel CPUs)
- Python version: 3.6 or greater
**NOTE**: If you are using an uncommon linux distribution or a CPU with a different instruction set, see section [Compiling custom MAME](#Compiling-custom-MAME).
## Installation
You can use `pip` to install the library, just run:
```bash
pip install MAMEToolkit
```
**DISCLAIMER: We are unable to provide you with any game ROMs. It is the users own legal responsibility to acquire a game ROM for emulation. This library should only be used for non-commercial research purposes.**
There are some free ROMs available at: https://www.mamedev.org/roms/
## Sponsorship & Future Development :heart:
I have just joined the [Github Sponsors](https://github.com/sponsors/M-J-Murray) program and would appreciate any donations towards future development on this project. There are a plans to extend and improve upon this library, and with your help we can make this happen. If you would like to show your appreciation or request a new game environment/feature be added, feel free to go to https://github.com/sponsors/M-J-Murray and become a sponsor today!
The sponsor page also outlines future plans and optimisations which will help improve the library for everyone.
## Street Fighter Random Agent Demo
The toolkit has currently been applied to Street Fighter III Third Strike: Fight for the Future (Japan 990608, NO CD), but can modified for any game available on MAME. The following demonstrates how a random agent can be written for a street fighter environment.
```python
import random
from MAMEToolkit.sf_environment import Environment
roms_path = "roms/" # Replace this with the path to your ROMs
env = Environment("env1", roms_path)
env.start()
while True:
move_action = random.randint(0, 8)
attack_action = random.randint(0, 9)
frames, reward, round_done, stage_done, game_done = env.step(move_action, attack_action)
if game_done:
env.new_game()
elif stage_done:
env.next_stage()
elif round_done:
env.next_round()
```
The toolkit also supports hogwild training:
```python
from multiprocessing import Process
import random
from MAMEToolkit.sf_environment import Environment
def run_env(worker_id, roms_path):
env = Environment(f"env{worker_id}", roms_path)
env.start()
while True:
move_action = random.randint(0, 8)
attack_action = random.randint(0, 9)
frames, reward, round_done, stage_done, game_done = env.step(move_action, attack_action)
if game_done:
env.new_game()
elif stage_done:
env.next_stage()
elif round_done:
env.next_round()
workers = 8
# Environments must be created outside of the threads
roms_path = "roms/" # Replace this with the path to your ROMs
threads = [Process(target=run_env, args=(i, roms_path)) for i in range(workers)]
[thread.start() for thread in threads]
```

## Setting Up Your Own Game Environment
**Game ID's**<br>
To create an emulation of the game you must first have the ROM for the game you are emulating and know the game ID used by MAME, for example for this version of street fighter it is 'sfiii3n'.
The id of your game can be found by running:
```python
from src.MAMEToolkit.emulator import see_games
see_games()
```
This will bring up the MAME emulator. You can search through the list of games toExcerpt of 14,977 characters
Read on GitHub50
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:e36120c7363ce414, desc:reinforcement learning