Skip to main content

No project description provided

Project description

pre-commit Code style: black

Stable-Retro

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

Currently added games on top of gym-retro:

  • Super Mario Bros 2 Japan (Lost Levels) - NES
  • Hang On - SMS
  • Punch Out - NES
  • WWF Wrestlemania the Arcade Game - Genesis
  • NHL 94 - Genesis
  • NHL 94 (1 on 1 rom hack) - Genesis
  • Super Hang On - Genesis
  • Tetris - GameBoy
  • Virtua Fighter - 32x
  • Virtua Fighter 2 - Genesis
  • Virtua Fighter 2 - Saturn
  • Mortal Kombat 1 - Sega CD

PvP games that support two models fighting each other:

  • Samurai Showdown - Genesis
  • WWF Wrestlemania the Arcade Game - Genesis
  • Mortal Kombat II - Genesis
  • NHL 94 - Genesis

As well as additional states on already integrated games.

Emulated Systems

  • Atari
    • Atari2600 (via Stella)
  • NEC
    • TurboGrafx-16/PC Engine (via Mednafen/Beetle PCE Fast)
  • Nintendo
    • Game Boy/Game Boy Color (via gambatte)
    • Game Boy Advance (via mGBA)
    • Nintendo Entertainment System (via FCEUmm)
    • Super Nintendo Entertainment System (via Snes9x)
  • Sega
    • GameGear (via Genesis Plus GX)
    • Genesis/Mega Drive (via Genesis Plus GX)
    • Master System (via Genesis Plus GX)
    • 32x (via Picodrive)
    • Saturn (via Beetle Saturn)
    • Sega CD (via Genesis Plus GX)

Experimental (acessible in the fbneo branch)

  • Arcade Machines:
    • Neo Geo (MVS hardware: 1990–2004)
    • Sega System 1 (1983–1987)
    • Sega System 16 (And similar. 1985–1994)
    • Sega System 18 (1989–1992)
    • Sega System 24 (1988–1994)
    • Capcom CPS1 (1988–1995)
    • Capcom CPS2 (1993–2003)
    • Capcom CPS3 (1996–1999)

Full list of supported Arcade machines here

Installation

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

Apple Silicon Installation (Tested on python3.10)

  • NOTE: The Game Boy (gambatte) emulator is not supported on Apple Silicon

Build from source

  1. pip install cmake wheel
  2. brew install pkg-config lua@5.1 libzip qt5 capnp
  3. echo 'export PATH="/opt/homebrew/opt/qt@5/bin:$PATH"' >> ~/.zshrc
  4. export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
  5. pip install -e .

Build Integration UI

  1. build package from source
  2. cmake . -DCMAKE_PREFIX_PATH=/usr/local/opt/qt -DBUILD_UI=ON -UPYLIB_DIRECTORY
  3. make -j$(sysctl hw.ncpu | cut -d: -f2)
  4. open "Gym Retro Integration.app"

Video on how to setup on Ubuntu and Windows: https://youtu.be/LRgGSQGNZeE

Docker image for M1 Macs: https://github.com/arvganesh/stable-retro-docker

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'

Citation

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

Tutorials

Game Integration tool: https://www.youtube.com/playlist?list=PLmwlWbdWpZVvWqzOxu0jVBy-CaRpYha0t

Discord channel

Join here: https://discord.gg/dXuBSg3B4D

Contributing

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

Supported specs:

Plateforms:

  • Windows 10, 11 (via WSL2)
  • macOS 10.13 (High Sierra), 10.14 (Mojave)
  • Linux (manylinux1)

CPU with SSSE3 or better

Supported Pythons: 3.7 to 3.10

Documentation

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

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

ROMs

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.

The following non-commercial ROMs are included with Stable Retro for testing purposes:

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.1.tar.gz (111.4 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.1-cp310-cp310-manylinux_2_34_x86_64.whl (94.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

stable_retro-0.9.1-cp310-cp310-manylinux_2_28_x86_64.whl (95.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

stable_retro-0.9.1-cp310-cp310-macosx_13_0_arm64.whl (85.1 MB view details)

Uploaded CPython 3.10macOS 13.0+ ARM64

stable_retro-0.9.1-cp39-cp39-manylinux_2_34_x86_64.whl (94.4 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

stable_retro-0.9.1-cp39-cp39-manylinux_2_28_x86_64.whl (95.3 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

stable_retro-0.9.1-cp38-cp38-manylinux_2_34_x86_64.whl (94.4 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.34+ x86-64

stable_retro-0.9.1-cp38-cp38-manylinux_2_28_x86_64.whl (95.2 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.28+ x86-64

stable_retro-0.9.1-cp37-cp37m-manylinux_2_34_x86_64.whl (94.4 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.34+ x86-64

File details

Details for the file stable-retro-0.9.1.tar.gz.

File metadata

  • Download URL: stable-retro-0.9.1.tar.gz
  • Upload date:
  • Size: 111.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for stable-retro-0.9.1.tar.gz
Algorithm Hash digest
SHA256 9ad283acea4cb916f5ae42ee5219995898834103d9a0e6d3ac45360099aa2de4
MD5 b0e8e0d70cd473073536e24758b746da
BLAKE2b-256 18b6cfd50226246146c67fe80be770939e892a63905fce81e76bb6d3e5b82366

See more details on using hashes here.

File details

Details for the file stable_retro-0.9.1-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for stable_retro-0.9.1-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 7d81f504c5a2490f184a90995bbdae4d33d389ac69d43607e95f1a58edb0abf0
MD5 0c29c231470ef9a335ac69de16a0ac40
BLAKE2b-256 0b0682bdcbee0a21860b9e5acb4496adc389d68087c92592cf1ce31ca79dee0a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stable_retro-0.9.1-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0795202897dea30521a68ba72cff96dd0dd20cfa60ae97d40cd2597e9ce235c1
MD5 b9965fd47679eaa61c6c71da00d11b31
BLAKE2b-256 893a1e6445de2ee42627cf8954e25498c0ce927472cacff6aa91c0d31c1a4df0

See more details on using hashes here.

File details

Details for the file stable_retro-0.9.1-cp310-cp310-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for stable_retro-0.9.1-cp310-cp310-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 aab2b9ad4ad9fe3ccf4221fcb4ad72fa3ff19f0877d120780d3c16b6c3b8ff82
MD5 f6031a72e7f6c443bdf2197af75311b2
BLAKE2b-256 dd48267a719a0cb3e669461aad69e08b91247b2e28417195717207045b541792

See more details on using hashes here.

File details

Details for the file stable_retro-0.9.1-cp39-cp39-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for stable_retro-0.9.1-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 2eec808a81bb4442ee497f07e7227de7825c141b6d7cad56a1bcddf39184b389
MD5 1bee39b0997327d61c7a77931ca560b6
BLAKE2b-256 a77c5a4de94ae9d1079e1005523101ba5dc653e3386f938801bc417e82d7a11d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stable_retro-0.9.1-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c6f7db3662697695a8f1a0f5a704b70d1127d2aaa9bb63d25df9d8e210ed746d
MD5 a773dbce821b709088ca1450871d9a63
BLAKE2b-256 e4d33bc85658ab5c33669bc3b5b0e1a82062e83e28e85494673796a3c04fdfd4

See more details on using hashes here.

File details

Details for the file stable_retro-0.9.1-cp38-cp38-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for stable_retro-0.9.1-cp38-cp38-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 326d891d135fbd1dd326362acd4be47b53cb6797f379bdd646674bad6efbc31a
MD5 8d22baf7719a63fa0e36d7c9a3e1888f
BLAKE2b-256 a92db9087908bf7474a794c06e28e20ea128688bee65ab4bc63b5429201932a0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stable_retro-0.9.1-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0a3e7e7316d2f1bcc9a4776ad0162604ccf3a0e0c6a70127e3f985df735f9a12
MD5 8f7714e8e4b7f12f6d344a572c3c43ee
BLAKE2b-256 1e99d7143a0b27f996903bffb19993d5047f728f30c17b70a8c7e419f2cbf534

See more details on using hashes here.

File details

Details for the file stable_retro-0.9.1-cp37-cp37m-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for stable_retro-0.9.1-cp37-cp37m-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 aa4d2e26170f34c3118bec71a19209684af6d0b1de15a1ec9b9fa4a13bdf3451
MD5 70efde828d46a19934e4c36dd12e4f0e
BLAKE2b-256 2280aa37ce993cf992024dd8175a2202a21451b7de37c3ee55d9d2dc52d3938b

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