{"id":28532071,"url":"https://github.com/matpoliquin/stable-retro-scripts","last_synced_at":"2025-10-06T01:43:13.801Z","repository":{"id":121264147,"uuid":"404723910","full_name":"MatPoliquin/stable-retro-scripts","owner":"MatPoliquin","description":"Train models on retro games. AI vs AI contest. Pytorch C++ plugin for RetroArch that let you override player input with models","archived":false,"fork":false,"pushed_at":"2025-07-20T01:36:27.000Z","size":110192,"stargazers_count":34,"open_issues_count":1,"forks_count":11,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-07-20T03:46:28.295Z","etag":null,"topics":["machine-learning","pytorch","reinforcement-learning","retrogaming","videogames"],"latest_commit_sha":null,"homepage":"https://www.videogames.ai","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MatPoliquin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-09-09T13:02:28.000Z","updated_at":"2025-07-20T01:36:31.000Z","dependencies_parsed_at":"2024-07-26T10:14:49.268Z","dependency_job_id":"df536be4-6980-4765-9831-c6f9c6696457","html_url":"https://github.com/MatPoliquin/stable-retro-scripts","commit_stats":null,"previous_names":["matpoliquin/stable-retro-scripts"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MatPoliquin/stable-retro-scripts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatPoliquin%2Fstable-retro-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatPoliquin%2Fstable-retro-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatPoliquin%2Fstable-retro-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatPoliquin%2Fstable-retro-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MatPoliquin","download_url":"https://codeload.github.com/MatPoliquin/stable-retro-scripts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatPoliquin%2Fstable-retro-scripts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278547873,"owners_count":26004773,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["machine-learning","pytorch","reinforcement-learning","retrogaming","videogames"],"created_at":"2025-06-09T15:30:23.460Z","updated_at":"2025-10-06T01:43:13.797Z","avatar_url":"https://github.com/MatPoliquin.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"![pylint workflow](https://github.com/MatPoliquin/stable-retro-scripts/actions/workflows/pylint.yml/badge.svg)\n![clang workflow](https://github.com/MatPoliquin/stable-retro-scripts/actions/workflows/clang.yml/badge.svg)\n![testcpp workflow](https://github.com/MatPoliquin/stable-retro-scripts/actions/workflows/test-cpp.yml/badge.svg)\n\n# stable-retro scripts\n\n* Train models on retro games\n* Pit two models against each other on PvP retro games such as NHL94, Mortal Kombat or WWF Wrestlemania: The Arcade Game\n* Play against an improved AI opponent\n* Emulator Frontend library using Pytorch C++ to able to play with or against stable-retro models in apps like RetroArch\n\n### Supported models\n*   MLPs\n*   Nature CNN (from DeepMind)\n*   Impala CNN (from DeepMind)\n*   Combined Input models (image + scalar)\n\nExperimental:\n*   Attention MLPs\n\nNHL94 (1 on 1)           |  Wrestlemania: The Arcade game |  Virtua Fighter 1\n:-------------------------:|:-------------------------:|:-------------------------:\n![screenshot 01](./screenshots/nhl94.png)  |  ![wwf vs](./screenshots/wwf.png) | ![vf](./screenshots/virtua_fighter.png)\n\n\n## Installation\n\nTested on Ubuntu 22.04/24.04 and Windows 11 WSL2 (Ubuntu 22.04 VM)\n\nRequires:\n*   Python 3.7 and up\n*   gymnasium\n*   stable-baselines3\n*   stable-retro (fork of gym-retro)\n\n```\nsudo apt update\nsudo apt-get install python3 python3-pip git zlib1g-dev libopenmpi-dev ffmpeg cmake\n\nsudo pip3 install -U virtualenv\nvirtualenv --system-site-packages -p python3 ~/vretro\nsource ~/vretro/bin/activate\n\ngit clone https://github.com/Farama-Foundation/stable-retro.git\ncd stable-retro\npip3 install -e .\n\npip3 install \"stable_baselines3[extra]\" pygame torchsummary opencv-python timm\n```\n\nWindows WSL2 + Ubuntu 22.04 setup guide: https://www.youtube.com/watch?v=vPnJiUR21Og\n\n## Install roms\nYou need to provide your own roms\n\nIn your rom directory exec this command, it will import the roms into stable-retro\n```\npython3 -m retro.import .\n```\n\n### Train a model\nNote: Airstriker is a public domain rom and is already included in stable-retro\n```bash\npython3 train.py --env=Airstriker-Genesis --nn=CnnPolicy --num_env=8 --num_timesteps=1_000_000 --play --hyperparams=../hyperparams/default.json\n```\n\n## Game specific Examples\n\n*   For NHL94 specific page click [here](./readmes/NHL94-README.md)\n*   For Wrestlemania the arcade game specific page click [here](./readmes/WWF-README.md)\n\n## retro ai lib\n\nC++ lib using Pytorch that runs models inside emulator frontends like retro arch to override player input. Which means you can play against a smarter opponent at NHL94 for example or let the AI play with you in COOP or play for you.\n\nSee [README](./retro_ai_lib/README.md) for build and install instructions\n\nTutorial video:\n[![RetroArch and Pytorch](https://img.youtube.com/vi/hkOcxJvJVjk/0.jpg)](https://www.youtube.com/watch?v=hkOcxJvJVjk)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatpoliquin%2Fstable-retro-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatpoliquin%2Fstable-retro-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatpoliquin%2Fstable-retro-scripts/lists"}