Reinforcement Learning agent for Pokémon Yellow using PPO.
.
├── env/ # Environment files
├── pokemon_yellow_env.py # Gym-style environment wrapper
├── memory_map.py # RAM address constants and decoders
├── rewards.py # Reward shaping functions
├── actions.py # Action mappings and handling
├── train/ # Training components
│ ├── train_ppo.py # PPO training loop
│ └── callbacks.py # Custom training callbacks
├── showcase/ # Live showcase runner
│ └── run_live.py # Windowed playback with hot reload
├── commentary/ # LLM-based commentary
│ ├── llm_client.py # LLM API client
│ └── narrator.py # Prompt builder for commentary
├── overlay/ # OBS overlay
│ └── server.py # Web server for overlay
├── runs/ # Training outputs
│ ├── checkpoints/ # Model checkpoints
│ ├── tensorboard/ # TensorBoard logs
│ └── videos/ # Optional recordings
└── states/ # Save states
-
Install dependencies:
pip install -r requirements.txt
-
Run training:
python train/train_ppo.py
-
Run showcase:
python showcase/run_live.py
-
Run overlay server:
python overlay/server.py
- Headless PPO training with parallel environments
- Live showcase with windowed playback
- Automatic model checkpoint saving
- LLM-based commentary generation
- OBS browser source overlay
- Curriculum learning with progression stages
- Real-time telemetry and stats display
Run the training script to start training the agent:
python train/train_ppo.pyRun the showcase to see the agent in action with a windowed interface:
python showcase/run_live.pyThe system can generate natural-language commentary using local LLMs like Ollama or LM Studio.
The overlay server provides a browser source for OBS that displays real-time game stats and commentary.
tensorboard --logdir=runs/tensorboard- Python 3.7+
- Gym
- Stable-Baselines3
- Pygame
- Torch
- Requests
- Pillow
- pyboy