Pokemon Red reinforcement learning tooling built around a RAM-verified Gymnasium environment, configurable progress rewards, PPO training, and a real-time web dashboard.
PokemonRL is an educational and research-oriented framework for training agents to play Pokemon Red with reinforcement learning.
It is meant for:
Main ideas:
The latest public runs are here:
If you are new to RL, this project is a good place to start. You can:
config/reward_presets.json and watch behavior changes.This section aims for minimal guesswork.
This repository does not include:
pokemon_red.gb).state)You must supply both for local training and playback.
Recommended local layout:
PokemonRL/
roms/
pokemon_red.gb
saves/
after_starter.state
Use Python 3.10 or newer.
python -m venv venv
venv\Scripts\activate
pip install --upgrade pip
pip install -e .
Set your ROM and save state paths:
set POKEMONRL_ROM_PATH=roms\pokemon_red.gb
set POKEMONRL_STATE_PATH=saves\after_starter.state
python -m unittest discover -s tests -p "test_*.py" -v
python tools\verify_ram.py
python tools\train_ppo_multimodal.py --reward-profile config\brock_badge1_profile.json --timesteps 1000000 --num-envs 4
python tools\map_server.py
Then open:
PokemonRL/env/: emulator environment, RAM readers, and Gym wrappersPokemonRL/rewards/: logic for computing rewardstools/: scripts for training, watching, and the web dashboardconfig/: JSON profiles for reward tuning and event flagsdocs/: detailed guides on reward design and verificationFor experienced users and researchers:
| Feature | Description |
|---|---|
| Multimodal observations | Combines screen pixels with structured RAM data. |
| Custom reward profiles | Create objectives via JSON without touching code. |
| Path overrides | Control where models, logs, and runs are saved with env vars. |
Contributions are welcome. If you fix a bug, add documentation, or suggest a new reward term, open a PR or issue.
See CONTRIBUTING.md.
This project is licensed under the MIT License.