Neuro-Symbolic Vision + RAM Reinforcement Learning Agent
Autonomous completion of Pokรฉmon Yellow using long-term memory (LSTM) and direct memory access.
- Project Overview
- Key Features
- Technology Stack
- Installation & Setup
- Usage
- Monitoring & Metrics
- Agent Architecture
- Project Structure
- Credits
- Disclaimer
IndigoRL is an autonomous Artificial Intelligence agent designed to complete Pokรฉmon Yellow using Deep Reinforcement Learning.
Unlike generic agents that randomly press buttons, IndigoRL implements a Neuro-Symbolic Architecture combining:
- ๐ผ๏ธ Computer Vision: CNN processing over resized game frames.
- ๐ง Symbolic State: Direct RAM memory inspection (event flags, battle state, map data).
- ๐ Long-Term Memory: Recurrent Neural Networks (LSTM via Recurrent PPO).
This allows the agent to reason about story progression, battles, and exploration in an extremely sparse, long-horizon RPG environment.
- Uses
RecurrentPPO(PPO + LSTM). - Enables maze navigation, backtracking, and objective persistence.
- Solves the "memoryless" limitation of standard RL agents.
- Story Progress
- Reads event flags directly from game RAM.
- Rewards badges, key items, and narrative milestones.
- Battle Awareness
- Reads enemy HP, player HP, and battle states.
- Learns combat strategies instead of brute-force button mashing.
- Exploration
- Rewards discovering new Map IDs.
- Penalizes stagnation and looping behavior.
- State Loading
- Skips Oakโs intro using a clean save-state.
- ~20% reduction in compute per episode.
- Headless Training
- SDL disabled during training for maximum FPS.
- Parallel Training
- Supports multiple emulator instances.
| Component | Technology |
|---|---|
| Language | Python 3.10+ |
| RL Algorithm | Stable-Baselines3 Contrib (Recurrent PPO) |
| Emulator | PyBoy 2.0+ |
| Vision | OpenCV, NumPy, Scikit-Image |
| Logging | TensorBoard |
- Python 3.10+ (Conda recommended)
- Pokรฉmon Yellow ROM (
.gb) โ legally owned
git clone https://github.com/OutFerz/indigoRL.git
cd indigoRL
conda create -n indigoRL python=3.10
conda activate indigoRL
pip install -r requirements.txtPlace your ROM at:
roms/PokemonYellow.gb
python record_state.pyPlay the intro manually and close the window once you gain control of the player.
python train_lstm.pyModels and logs are saved to:
experiments/poke_lstm_v1/
python play.py- Real-time 60 FPS playback
- Neural network input overlay
- Live RAM debugging info
Monitor training in real time using TensorBoard:
tensorboard --logdir experiments/poke_lstm_v1/logsOpen your browser at:
http://localhost:6006
Policy: Multi-Input Recurrent Policy
- Visual Encoder (CNN)
- Grayscale, downsampled game frames
- Symbolic Encoder (MLP)
- RAM vector:
- X, Y, Map ID
- Player HP, Enemy HP
- Party Levels
- In-Battle Flag
- RAM vector:
- Memory Core
- LSTM (256 units)
- Action Head
- Discrete GameBoy button actions
indigoRL/
โโโ assets/ # README images
โโโ experiments/ # Models and logs
โโโ roms/ # Game ROMs
โโโ src/
โ โโโ environment/
โ โโโ pokemon_env.py # Gym environment & RAM reader
โโโ states/ # Save states
โโโ train_lstm.py # Training entry point
โโโ play.py # Visualization script
โโโ record_state.py # Save-state utility
โโโ requirements.txt
- PyBoy Emulator
- Stable-Baselines3 Contrib
- pret/pokeyellow disassembly project
This project is for research and educational purposes only.
You must legally own a physical or digital copy of Pokรฉmon Yellow to use the ROM.
The authors do not encourage or support piracy.