Skip to content

Adversarial reinforcement learning project with a PPO implementation for Pac-Man and a DQN implementation for the ghosts.

Notifications You must be signed in to change notification settings

Xire7/pacman-vs-ghost-rl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pac-Man vs Ghost RL

Adversarial reinforcement learning project training PPO-based Pac-Man agents against DQN-based Ghost agents using the Berkeley Pac-Man game engine.

Pacman vs Ghost Adversarial Training Thumbnail

Quick Start

pip install -r requirements.txt

Option 1: View Pre-Trained Results

cd project/
# Open project.ipynb in Jupyter, or view project.html for pre-run results
# You could train the models here, but normally we trained it from Option 2 (game_environment folder)

Option 2: Train Your Own Models

cd game_environment/

# 1. Train baseline Pac-Man (2M steps)
Step 1: python src/train_ppo.py --timesteps 2000000 --num-envs 16 --normalize --lr-decay

# 2. Train adversarial agents
python train_mixed.py --pacman models/ppo_mediumClassic_datetime/best/best_model.zip --rounds 7 --ghost-pretrain-steps 200000

# 3. Visualize trained agents (adjust ghost version based on number of rounds trained)
python visualize_agents.py --pacman-path training_output/[mixed_####_####]/models/pacman_best.zip --ghost-dir training_output/[mixed_####_####]/models --ghost-version 7 --episodes 5

Documentation

See project/README.txt for detailed file descriptions and project structure.

About

Adversarial reinforcement learning project with a PPO implementation for Pac-Man and a DQN implementation for the ghosts.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •