Skip to content

Trained with Reinforcement Learning / PPO / PyTorch / Stable Baselines

Notifications You must be signed in to change notification settings

hxdtest/Street-Fighter-AI

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Street Fighter II AI

Trained with Reinforcement Learning / PPO / PyTorch / Stable Baselines, inspired by @nicknochnack.

Techniques

  • Use health-based reward function instead of score-based so the agent can learn how to defend itself while attacking the enemy. It makes a defensive strategy to win the game. You may want to modify the function to penalize the time spent for a more offensive strategy.
  • Reduce the action space from MultiBinary(12) (4096 choices) to Discrete(14) to make the training more efficient. You may want to add combos to make the fight more interesting.
  • Make the episode one fight only instead of best-of-three. It helps value estimation.
  • Preprocess the environment with AtariWrapper (NoopReset, FrameSkip, Resize, Grayscale) to reduce input size.
  • Use multiprocessing for faster training and bypass OpenAI Gym Retro limitation on one environment per process.

Results

  • 100% win-rate against the enemy
  • Much HP remaining after the fight
  • Trained model is saved in latest_model.zip
  • Training and Testing scripts can be viewed in StreetFighter.ipynb

Replay

Game 1

About

Trained with Reinforcement Learning / PPO / PyTorch / Stable Baselines

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 100.0%