Playing Pokemon Red with Reinforcement Learning
Jupyter Notebook
7,917
272 commits
updated Sep 11, 2026
Stream your training session to a shared global game map using the Broadcast Wrapper
See how in Training Broadcast section
🐍 Python 3.10+ is recommended. Other versions may work but have not been tested.
You also need to install ffmpeg and have it available in the command line.
Refer to this Windows Setup Guide
Follow this guide to install pytorch with ROCm support
V2 is now recommended over the original version. You may follow all steps below but replace baselines with v2.
PokemonRed.gb if it is not already. The sha1 sum should be ea9bcae617fdf159b045185467ae58b2e4a48b9a, which you can verify by running shasum PokemonRed.gb.baselines/ directory:cd baselinespip install -r requirements.txtmacos_requirements.txt instead of requirements.txtpython run_pretrained_interactive.pyInteract with the emulator using the arrow keys and the a and s keys (A and B buttons).
You can pause the AI's input during the game by editing agent_enabled.txt
Note: the Pokemon.gb file MUST be in the main directory and your current directory MUST be the baselines/ directory in order for this to work.
Replaces the frame KNN with a coordinate based exploration reward, as well as some other tweaks.
v2 directory instead of baselinespython baseline_fast_v2.pyStream your training session to a shared global game map using the Broadcast Wrapper on your environment like this:
env = StreamWrapper(
env,
stream_metadata = { # All of this is part is optional
"user": "super-cool-user", # choose your own username
"env_id": id, # environment identifier
"color": "#0033ff", # choose your color :)
"extra": "", # any extra text you put here will be displayed
}
)
Hack on the broadcast viewing client or set up your own local stream with this repo:
https://github.com/pwhiddy/pokerl-map-viz/
The current state of each game is rendered to images in the session directory.
You can track the progress in tensorboard by moving into the session directory and running:
tensorboard --logdir .
You can then navigate to localhost:6006 in your browser to view metrics.
To enable wandb integration, change use_wandb_logging in the training script to True.
Map visualization code can be found in visualization/ directory.
Check out our follow up projects & papers!
@misc{pleines2025pokemon,
title={Pokemon Red via Reinforcement Learning},
author={Marco Pleines and Daniel Addis and David Rubinstein and Frank Zimmer and Mike Preuss and Peter Whidden},
year={2025},
eprint={2502.19920},
archivePrefix={arXiv},
primaryClass={cs.LG}
}
Check out these awesome projects!
(top 24 of 66)
1,061 followers · starred Oct 2023
935 followers · starred Nov 2023
1,833 followers · starred Oct 2023
80 followers · starred Oct 2023
Playing Pokemon Red with Reinforcement Learning
Jupyter Notebook
7,917
272 commits
updated Sep 11, 2026
Stream your training session to a shared global game map using the Broadcast Wrapper
See how in Training Broadcast section
🐍 Python 3.10+ is recommended. Other versions may work but have not been tested.
You also need to install ffmpeg and have it available in the command line.
Refer to this Windows Setup Guide
Follow this guide to install pytorch with ROCm support
V2 is now recommended over the original version. You may follow all steps below but replace baselines with v2.
PokemonRed.gb if it is not already. The sha1 sum should be ea9bcae617fdf159b045185467ae58b2e4a48b9a, which you can verify by running shasum PokemonRed.gb.baselines/ directory:cd baselinespip install -r requirements.txtmacos_requirements.txt instead of requirements.txtpython run_pretrained_interactive.pyInteract with the emulator using the arrow keys and the a and s keys (A and B buttons).
You can pause the AI's input during the game by editing agent_enabled.txt
Note: the Pokemon.gb file MUST be in the main directory and your current directory MUST be the baselines/ directory in order for this to work.
Replaces the frame KNN with a coordinate based exploration reward, as well as some other tweaks.
v2 directory instead of baselinespython baseline_fast_v2.pyStream your training session to a shared global game map using the Broadcast Wrapper on your environment like this:
env = StreamWrapper(
env,
stream_metadata = { # All of this is part is optional
"user": "super-cool-user", # choose your own username
"env_id": id, # environment identifier
"color": "#0033ff", # choose your color :)
"extra": "", # any extra text you put here will be displayed
}
)
Hack on the broadcast viewing client or set up your own local stream with this repo:
https://github.com/pwhiddy/pokerl-map-viz/
The current state of each game is rendered to images in the session directory.
You can track the progress in tensorboard by moving into the session directory and running:
tensorboard --logdir .
You can then navigate to localhost:6006 in your browser to view metrics.
To enable wandb integration, change use_wandb_logging in the training script to True.
Map visualization code can be found in visualization/ directory.
Check out our follow up projects & papers!
@misc{pleines2025pokemon,
title={Pokemon Red via Reinforcement Learning},
author={Marco Pleines and Daniel Addis and David Rubinstein and Frank Zimmer and Mike Preuss and Peter Whidden},
year={2025},
eprint={2502.19920},
archivePrefix={arXiv},
primaryClass={cs.LG}
}
Check out these awesome projects!
(top 24 of 66)
1,061 followers · starred Oct 2023
935 followers · starred Nov 2023
1,833 followers · starred Oct 2023
80 followers · starred Oct 2023