Skip to main content

A maintained fork of OpenAI's gym-retro for Gymnasium.

Project description

Python pre-commit Code style: black

A fork of gym-retro ('lets you turn classic video games into Gymnasium environments for reinforcement learning') with additional games, emulators and supported platforms. Since gym-retro is in maintenance now, you can instead submit PRs with new games or features here in stable-retro.

Emulated Systems

System Linux Windows Apple
Atari 2600
NES
SNES
Nintendo 64 ✓† ✓†
Nintendo DS
Gameboy/Color ✓*
Gameboy Advance
Sega Genesis
Sega Master System
Sega CD
Sega 32X
Sega Saturn
Sega Dreamcast ✓‡
PC Engine
Arcade Machines

* On Apple Silicon (arm64), Gambatte (GB) is skipped by default in the CMake build.

† Built by default when BUILD_N64=ON and OpenGL headers are available. If headers are missing, the build skips the N64 core.

‡ Only available when hardware rendering is enabled (ENABLE_HW_RENDER=ON). Hardware rendering support is currently Linux-only in this project.

Supported Games

Currently over 1000 games are integrated including:

Category Games
Platformers Super Mario World, Sonic The Hedgehog 2, Mega Man 2, Castlevania IV
Fighters Mortal Kombat Trilogy, Street Fighter II, Fatal Fury, King of Fighters '98
Sports NHL94, NBA Jam, Baseball Stars
Puzzle Tetris, Columns
Shmups 1943, Thunder Force IV, Gradius III, R-Type
BeatEmUps Streets Of Rage, Double Dragon, TMNT 2: The Arcade Game, Golden Axe, Final Fight
Racing Super Hang On, F-Zero, OutRun
RPGs (experimental) Pokemon Red, Legend Of Zelda, Final Fantasy, Dragon Warrior

Note: If the game you want is not included but is supported by one of the systems in the list above, an integration tool is provided to help add new games.

Installation

Stable Retro supports Python 3.10 through 3.14.

pip3 install stable-retro

or if the above doesn't work for your platform:

pip3 install git+https://github.com/Farama-Foundation/stable-retro.git

If you plan to integrate new ROMs, states or emulator cores or plan to edit an existing env:

git clone https://github.com/Farama-Foundation/stable-retro.git
cd stable-retro
pip3 install -e .

For platform-specific instructions including building from source, optional core dependencies, and the Integration UI:

Example

'Nature CNN' model trained using PPO on Airstriker-Genesis env (rom already included in the repo)

sudo apt-get update
sudo apt-get install python3 python3-pip git zlib1g-dev libopenmpi-dev ffmpeg

You need to install a stable baselines 3 version that supports gymnasium

pip3 install git+https://github.com/Farama-Foundation/stable-retro.git
pip3 install stable_baselines3[extra]

Start training:

cd retro/examples
python3 ppo.py --game='Airstriker-Genesis-v0'

More advanced examples: https://github.com/MatPoliquin/stable-retro-scripts

Documentation & Tutorials

Documentation is available at https://stable-retro.farama.org/ (work in progress)

See LICENSES.md for information on the licenses of the individual cores.

Topic Description
Windows WSL2 Setup Step-by-step guide for setting up stable-retro on Windows 11 with WSL2 and Ubuntu 22.04
Game Integration Tool Playlist covering how to use the integration tool to add new games
RetroArch + ML Models Running a custom RetroArch build that supports overriding player input with trained models

ROMs and BIOS files

Each game integration has files listing memory locations for in-game variables, reward functions based on those variables, episode end conditions, savestates at the beginning of levels and a file containing hashes of ROMs that work with these files.

Please note that ROMs are not included and you must obtain them yourself. Most ROM hashes are sourced from their respective No-Intro SHA-1 sums.

Run this script in the roms folder you want to import. If the checksum matches it will import them in the related game folder in stable-retro.

python3 -m retro.import .

Some platforms like Sega Saturn and Dreamcast also need to be provided a BIOS. List of BIOS names and checksums.

The following non-commercial Sega Genesis ROM is included with Stable Retro for testing purposes:

List of other included ROMs.

Contributing & Support

See CONTRIBUTING.md

For any issues, suggestions, or discussions related to Stable-Retro, please use GitHub Issues or the Farama Foundation's Discord.

Supported specs:

Platforms:

  • Windows 10, 11 (via WSL2)
  • macOS 10.13 (High Sierra), 10.14 (Mojave)
  • Linux (manylinux1). Ubuntu 24.04 is recommended

Python:

  • Python 3.10 through 3.14

CPU with SSE3 or better

Citation

@misc{stable-retro,
  author = {Poliquin, Mathieu},
  title = {Stable Retro, a maintained fork of OpenAI's gym-retro},
  year = {2026},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/Farama-Foundation/stable-retro}},
}

Papers

List of papers mentioning stable-retro. If you want your paper to be added here please open a github issue.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stable_retro-1.0.1.tar.gz (153.0 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

stable_retro-1.0.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (123.2 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

stable_retro-1.0.1-cp314-cp314-macosx_11_0_arm64.whl (88.6 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

stable_retro-1.0.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (123.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

stable_retro-1.0.1-cp313-cp313-macosx_11_0_arm64.whl (88.6 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

stable_retro-1.0.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (123.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

stable_retro-1.0.1-cp312-cp312-macosx_11_0_arm64.whl (88.6 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

stable_retro-1.0.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (123.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

stable_retro-1.0.1-cp311-cp311-macosx_11_0_arm64.whl (88.6 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

stable_retro-1.0.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (123.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

stable_retro-1.0.1-cp310-cp310-macosx_11_0_arm64.whl (88.6 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file stable_retro-1.0.1.tar.gz.

File metadata

  • Download URL: stable_retro-1.0.1.tar.gz
  • Upload date:
  • Size: 153.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for stable_retro-1.0.1.tar.gz
Algorithm Hash digest
SHA256 68c43f2211f6314dc0727c2ad6cdefcc1c8621b7a38516c5afe15b523f3efcac
MD5 fa3daa9feaa98e91fc319bfe9e5ddbba
BLAKE2b-256 c27044a58c6fe81aec4d83d85b9ed3d774aebc6e9fb8d81ea3542ea320ecebbb

See more details on using hashes here.

File details

Details for the file stable_retro-1.0.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for stable_retro-1.0.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4451c5f8209dbdbf343d29ab028ec7d40d28b9c7459ac4e632be990bc2f1eac3
MD5 334dc6f79fe1dd7f2c449e24847137bb
BLAKE2b-256 9cd64237309bb37190669e533fd0f1f00cb46acd7862aa054243d0392e772208

See more details on using hashes here.

File details

Details for the file stable_retro-1.0.1-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for stable_retro-1.0.1-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8e6dabfff055a29a3d92142f8d417cc18811c6aa03de5af3fdbe743c30f94e0e
MD5 b6eb989f18548affa64a7aa436ed3858
BLAKE2b-256 e0947e18511874dcc02d2e79cabc17b71e7b7ac673de1d4e072973421790c6b4

See more details on using hashes here.

File details

Details for the file stable_retro-1.0.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for stable_retro-1.0.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e3c21bc31c5ad623d9700d56b9dd688f39592bc21c66f24cf59dfdf07b03b466
MD5 59f128f46a2b1212160a4c0612c52b19
BLAKE2b-256 ed6c24d714948c79602dd0b6c11bfc1a7ce336c98cb0d7d709954499471876a6

See more details on using hashes here.

File details

Details for the file stable_retro-1.0.1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for stable_retro-1.0.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8a06e8158a82dd4df35b1a5bdcbb6164bad645572b1a10a701a76e6e9700e0fa
MD5 c8224ae77181030b6207d35eb09bc79d
BLAKE2b-256 ab7a86359bef7042d8d50fdf0a2b1c6d36ae389222098bd9e75059caadac82c5

See more details on using hashes here.

File details

Details for the file stable_retro-1.0.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for stable_retro-1.0.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 53c180f930b7bafed248064b8467773b980a37bb5b6555f0717c8555143c9d6f
MD5 951909705a77a5b09f6ead5663bc756e
BLAKE2b-256 673d5016f99a3c48ed0d25e3faae63651f811ea8abc9efa3e8a6905896969416

See more details on using hashes here.

File details

Details for the file stable_retro-1.0.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for stable_retro-1.0.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 07e62a3a1a6733bbf39540fb7ffbcf3c5bcf488f59d588a39d3febc9fb4d19dc
MD5 dba7eb4eed8aae90a314e09045bfd509
BLAKE2b-256 68fa281c7370d176f98979fb7ab0739c8eb88fb1a0086237983f13d741f880af

See more details on using hashes here.

File details

Details for the file stable_retro-1.0.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for stable_retro-1.0.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4ddabe781fb9bc2d1011ccd04f2684a59d69ce270da82bb5ae6e9a17e9ef4518
MD5 f253c29721cdf77b204b3d8696eef653
BLAKE2b-256 b145982c2c0e0dc4e7297002a096ee8570381e5063f5c376ed1352ca34185735

See more details on using hashes here.

File details

Details for the file stable_retro-1.0.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for stable_retro-1.0.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bb562472bd44a61465676137b45f2e435d2e13593ed88c8b38e1e973bea809cc
MD5 ab1fea4a8022b3f8ec236e4093637edd
BLAKE2b-256 f55310bbd25c3a74b3f89f5714e982c839f0e70bc1a48bc3d83fc40848e2eda5

See more details on using hashes here.

File details

Details for the file stable_retro-1.0.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for stable_retro-1.0.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0c4fd6ae72a6c5304f770582b4a12e2192f983ad618948a03c17195fa931942c
MD5 bf825fad658900627a211a4bb055d7cf
BLAKE2b-256 4f5a998054c4976ec38919a69eb41e96256961e804e0352dd58d21c187d93f28

See more details on using hashes here.

File details

Details for the file stable_retro-1.0.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for stable_retro-1.0.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2f717550e97c6d7aa06ff14883734337f6da4daeb9cebfd643f898e7c0e006ce
MD5 5ae145994d26c0ed5f4750a73a0bea0d
BLAKE2b-256 fb8d802b91ba8ac4a62eec88887d74449a303aefdbddaa38cffb09cc43dbb439

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page