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-1.0.0.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-1.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (123.1 MB view details)

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

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

Uploaded CPython 3.12macOS 11.0+ ARM64

stable_retro-1.0.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (123.1 MB view details)

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

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

Uploaded CPython 3.11macOS 11.0+ ARM64

stable_retro-1.0.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (123.1 MB view details)

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

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

Uploaded CPython 3.10macOS 11.0+ ARM64

stable_retro-1.0.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (123.1 MB view details)

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

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

Uploaded CPython 3.9macOS 11.0+ ARM64

stable_retro-1.0.0-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (123.1 MB view details)

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

stable_retro-1.0.0-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-1.0.0.tar.gz.

File metadata

  • Download URL: stable_retro-1.0.0.tar.gz
  • Upload date:
  • Size: 152.9 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.0.tar.gz
Algorithm Hash digest
SHA256 96b14eecbf0fd1cd56205c6b83f008a5051c62645725c2a8dc6dd90da8f21925
MD5 587baca4f208666acbc154152eab7c87
BLAKE2b-256 1bd23ddff38290d9e81dece23ceb1fe09fd07f062ac8e0b66e7da13551a20620

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stable_retro-1.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 78491631aa09a59396927323888367083fb54c878fa2b1023b2eb3eb30951b1b
MD5 3a4b0573f7051d319de585f1d18767a9
BLAKE2b-256 56a3ed819aad0a23c669ce372378e4d5d28fef3d5996de6c3c29db5f776c87d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stable_retro-1.0.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1b2209252af5f605b65a5bbedacfb58766427a9736fa43bd819c2e15d30c267a
MD5 bf405254e3b2ad8660150343dff13e35
BLAKE2b-256 f6fdfe7b3a729293fa164f57120f098f292096cf3cde2e494279662fb06e3ca0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stable_retro-1.0.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d1e99663df28e9c7de267347a978f89072fb214d25202b63f553ba820ff6848d
MD5 cf664f01e4506920fcd6df8b85e0cb08
BLAKE2b-256 005a992f181febbbaf97b5683f315eb677d5e6d452819c07fffb639d2bcc0d2f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stable_retro-1.0.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3c12aa17bcbc1d64b0b9d69530c10ceb1060c0ee3e3ae89cf841472dd9dd366e
MD5 e13a0e63c0baaf42028661b9434cb24d
BLAKE2b-256 a1f26a77bb00f17ba2130fa7f34c4bc0b6aca94234694e8197cc7b94805c1b76

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stable_retro-1.0.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 aee4880bbc8c27994e56bee10702147793aa250e69ea48470afaf976b3bb0324
MD5 136b8f258fef85f38ed1348c72de7685
BLAKE2b-256 649b6e6bc47b48b947fa79c060f7e2383a2cc32f993b0adec3ed9f0ceaaba9af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stable_retro-1.0.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 85c2c04127771faaf2491bc6d8b1a36f5bcbcb14b7d8002d393c4ae6fb946948
MD5 57302d579830048251bd3d36057c802f
BLAKE2b-256 7a3ff1bb7caaa30f92837bad46c38cf211cbb62d308fa51bffa0d1f227e20e3a

See more details on using hashes here.

File details

Details for the file stable_retro-1.0.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for stable_retro-1.0.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c3213fd6350831a7eae779aab0137c478f7e991a464b2ba3325dbe53ed52a332
MD5 c5c7e79ad8ae6ab2d46ca21a1102f368
BLAKE2b-256 e136c0bd9d9566bd852bcd40e674e37fa676d45f0bba74670d79693469b004cd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stable_retro-1.0.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 44e52fa51a1f8b4bd08a6967593a1574562a5409cf5d127e2428482d9cce22e0
MD5 0a60f793ab6b7186a03324ebd573cf1c
BLAKE2b-256 bd0557488fc7e50bd79132d6bc176f8408261b2a5ab9058a568a0bd315ea42c1

See more details on using hashes here.

File details

Details for the file stable_retro-1.0.0-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for stable_retro-1.0.0-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f8aa20d9ec1d25be9b1ae196fecbec3e1a575698c8f0d9cce7dc5ba35cb552b5
MD5 671991384e89265b741114f0bb8f62ff
BLAKE2b-256 b8e6a03cdb8c03c93ba5970c64d4de7d2f481e56900117c049f1bc93d71ad97a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stable_retro-1.0.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7c901c8e514fdd735ef947d36284ff89de87f266648311f27df17e071e1c9a59
MD5 92d8b7ad36e1939d2fb6c4c8078ec05c
BLAKE2b-256 2d84a1413d402b5cf33ca4d220734b82aa2acfc25f45d0037e517f2d4a8a4862

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