GitHub

Project: Train RL agents to play Pokemon Red

What is the project about?

This project focuses on training Reinforcement Learning (RL) agents to play the classic Game Boy game, Pokemon Red.

What problem does it solve?

It explores the application of RL in a complex, long-horizon environment (a full video game) and demonstrates how agents can learn to navigate, interact, and progress through the game. It also provides a framework for visualizing and tracking the agent's learning process.

What are the features of the project?

  • Interactive Play: Allows users to run a pretrained model and interact with the game alongside the AI.
  • Training Scripts: Provides scripts (V2 being the recommended one) to train new RL agents from scratch.
  • Training Broadcast: Enables streaming of training sessions to a shared global game map for visualization.
  • Progress Tracking: Supports local metric tracking via TensorBoard and integration with Weights & Biases (wandb).
  • Visualization: Includes tools for visualizing the agent's exploration of the game map.
  • V2 Improvements: The V2 training script offers faster training, lower memory usage, better exploration (reaching Cerulean City), and streams to the map by default.

What are the technologies used in the project?

  • Python 3.10+: The primary programming language.
  • PyBoy: A Game Boy emulator library written in Python.
  • Stable Baselines 3: A set of reliable implementations of reinforcement learning algorithms in PyTorch.
  • PyTorch: Deep learning framework.
  • TensorBoard: Visualization toolkit for machine learning experiments.
  • Weights & Biases (wandb): (Optional) A platform for tracking and visualizing machine learning projects.
  • FFmpeg: Required for video processing.
  • ROCm: (For AMD GPUs) An open-source platform for GPU-accelerated computing.
  • SDL Libraries

What are the benefits of the project?

  • Demonstrates RL Capabilities: Showcases the potential of RL in complex environments.
  • Open Source: Provides a codebase for researchers and enthusiasts to experiment with RL and game playing.
  • Community Engagement: Encourages collaboration through a Discord server and shared training visualizations.
  • Educational Resource: Serves as a learning tool for those interested in RL, game AI, and emulation.

What are the use cases of the project?

  • RL Research: Studying and developing RL algorithms in a challenging and engaging environment.
  • Game AI Development: Exploring techniques for creating intelligent agents in video games.
  • Educational Purposes: Teaching and learning about RL concepts and implementation.
  • Entertainment: Watching AI agents learn to play a classic game.
  • Benchmarking: Comparing different RL algorithms and approaches.
PokemonRedExperiments screenshot