Skip to main content

No project description provided

Project description

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

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

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)

Tested on Ubuntu 20.04 and Windows 11 WSL2 (Ubuntu 20.04 VM)

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

There is an effort to get this project to the Farama Foundation Project Standards. These development efforts are being coordinated in the stable-retro channel of the Farama Foundation's Discord. Click here for the invite

Feel free to reach out to the above Discord for any issues/suggestions/discussions related to stable-retro

Supported specs:

Platforms:

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

CPU with SSE3 or better

Supported Pythons: 3.7 to 3.12

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-0.9.9.tar.gz (152.9 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-0.9.9-cp312-cp312-manylinux_2_28_x86_64.whl (121.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

stable_retro-0.9.9-cp312-cp312-macosx_11_0_arm64.whl (88.1 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

stable_retro-0.9.9-cp311-cp311-manylinux_2_28_x86_64.whl (121.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

stable_retro-0.9.9-cp311-cp311-macosx_11_0_arm64.whl (88.1 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

stable_retro-0.9.9-cp310-cp310-manylinux_2_28_x86_64.whl (121.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

stable_retro-0.9.9-cp310-cp310-macosx_11_0_arm64.whl (88.1 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

stable_retro-0.9.9-cp39-cp39-manylinux_2_28_x86_64.whl (121.5 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

stable_retro-0.9.9-cp39-cp39-macosx_11_0_arm64.whl (88.1 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

stable_retro-0.9.9-cp38-cp38-manylinux_2_28_x86_64.whl (121.5 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.28+ x86-64

stable_retro-0.9.9-cp38-cp38-macosx_11_0_arm64.whl (88.1 MB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for stable_retro-0.9.9.tar.gz
Algorithm Hash digest
SHA256 a068422e9c8d98659b3239fe0243446b22ace2234da2e432a80f4d3bf393deb7
MD5 b60722b12b7ace766708345f0d76679e
BLAKE2b-256 4e483c51a5c222b92f53e59932ce8d52a97d58f4287e558bce0d731e008b1a8b

See more details on using hashes here.

File details

Details for the file stable_retro-0.9.9-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for stable_retro-0.9.9-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f7cda69730d96bedfd74867f2ecc66d89655f7c3e4f7f4ad90ef08cffb96fef1
MD5 d889f8bb0071b9276d66d598f781de4a
BLAKE2b-256 4dd022e239ade84abe501f2b566b77ba2886d4411fa8ee9297aa16569f0b91cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stable_retro-0.9.9-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4bcd1de9adb95250ae49b30ed5eb2c755dd73e8c2f11efc32889c52fa9d6c7aa
MD5 896f2a5469a5ab18f662715f048b6c87
BLAKE2b-256 26af2f3d141134f68dcdb11060a0d7ef6ea86956a9b7d31f61dff7ab52fda77b

See more details on using hashes here.

File details

Details for the file stable_retro-0.9.9-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for stable_retro-0.9.9-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 60bf98d7531546e1c8a0a154a7c80247634fe2756c61df9f8c8547487eda2882
MD5 796ac8c89d316838e5558e990e379140
BLAKE2b-256 4983bb01e3f6cee1767b8f744d2b886a70eb440241e0d6d24209fad313059351

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stable_retro-0.9.9-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 61727eeaff60ed1af1596a294ef775e79c6e32df78198e124db41440f0e4cf76
MD5 111f63e347184f4065280d6845de62ed
BLAKE2b-256 727cc356f069b6ccd660e21fb4fa7ed6935b041f0bd0129bfbbd65796f5b2afe

See more details on using hashes here.

File details

Details for the file stable_retro-0.9.9-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for stable_retro-0.9.9-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 18b50e018da4659906ecf9e08f2ef4465c1b245ea86bc60483d41317cbb89faa
MD5 39accda2d648b9ad771847b3b700748b
BLAKE2b-256 797707008f549b4b12530f4add505fb8830ba3ec44dee3cd84a56dfff40566bc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stable_retro-0.9.9-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 473a3d126710d223098cec1f75aa7a2861462b20c332ea33c6b4e74c25346df9
MD5 62839b2286f46c1cac2b5012ff7905f7
BLAKE2b-256 770a90b9290c3b945a02d5ab73bc68624c0d582c7f04951b22b3ffa0da4c07e6

See more details on using hashes here.

File details

Details for the file stable_retro-0.9.9-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for stable_retro-0.9.9-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 620ce013baa0bb146fb0136e9216df010bd00a517de753e4195b4d2e448d41f3
MD5 5cd67aa1565bd83e9ea2bff0ce6bca9a
BLAKE2b-256 88581ea054c6dbd573455af65249dee880f57b5c5be3b4c768d74cf0343eb1be

See more details on using hashes here.

File details

Details for the file stable_retro-0.9.9-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for stable_retro-0.9.9-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7a4e8f23e8f06a7ebcd559e4135bf3e3d95959b52d1fb025c417cd11d9ee7e80
MD5 51f2a58e9c43142ac5a6cf6803e7bd1a
BLAKE2b-256 a68de357c0f5e3269b476f62e5bbdfbc7c1e64496b966acca5abc59e72097e53

See more details on using hashes here.

File details

Details for the file stable_retro-0.9.9-cp38-cp38-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for stable_retro-0.9.9-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a780df939fad43972ce15dec6528e3a8861a791efe238186580c70370427dd7f
MD5 db836869409ff34a3efd9248bc1cb566
BLAKE2b-256 1c542681ff48e2ef1104130f0fe6c5a111b6cd12422a4755be5dc017ee329d08

See more details on using hashes here.

File details

Details for the file stable_retro-0.9.9-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for stable_retro-0.9.9-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1e8e321e72a9fa883eddeff7cdacc1ee133156ce51013544aa9bdbeef43b842a
MD5 c3beb596be244aacf4f40f60f40f9b20
BLAKE2b-256 5ca035b8d4d6577f3712419dedfc4fa1092dca53d74afd16b813a6b1074cd494

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