← all repositories
linyiLYi/street-fighter-ai

An AI That Beats Street Fighter II by Sight Alone

To see if a neural network can learn to beat Street Fighter II’s final boss by watching pixels, and to document how it overfits in the process.

6.5k stars Python AgentsDomain Apps
street-fighter-ai
Not currently ranked — collecting fresh signals.
star history

What it does

SFighterAI is a deep reinforcement learning agent that plays Street Fighter II: Special Champion Edition by processing only the game screen’s RGB pixel values. It is trained specifically to beat the final level’s boss, and the repository includes a progression of saved model weights so you can watch its skill evolve from barely capable to dominant but overfitted. The project leans on OpenAI Gym Retro and Stable-Baselines3, and it reads character health values from memory to guide reward shaping.

The interesting bit

The author openly embraces the overfitting curve as a feature, not a bug: the bundled checkpoints at 2 million, 2.5 million, 3 million, and 7 million training steps form a neat timeline of an agent trading generalization for round-one dominance. More unusually, the training directly tackles the “cowardice” problem—where RL agents learn to avoid the opponent entirely—by borrowing a penalty-decay mechanism from a 2022 research paper to force the model to engage.

Key highlights

  • Vision-only input: the agent makes every decision from raw screen pixels, not internal game state.
  • Bundled model checkpoints show a clear trajectory from generalizable play to overfitted first-round perfection.
  • A “penalty decay” reward mechanism stops the agent from learning to run away instead of fight.
  • Includes Tensorboard logs to inspect training curves directly.
  • Targets the final boss (Ryu vs. Bison) on the highest difficulty using a provided save state.

Caveats

  • The 100% win rate claim applies only to the first round of the final level in a specific save state; the README explicitly warns that overfitting is present.
  • The project is tightly scoped to a single match-up and difficulty setting, so broader generalization across the full roster is unclear.
  • You must supply your own game ROM legally; the repository does not include it.

Verdict

Fighting-game enthusiasts and RL students looking for a concrete, well-documented example of overfitting in action will get the most out of this. If you want a general-purpose Street Fighter bot that works across characters and stages, this is not it.

Frequently asked

What is linyiLYi/street-fighter-ai?
To see if a neural network can learn to beat Street Fighter II’s final boss by watching pixels, and to document how it overfits in the process.
Is street-fighter-ai open source?
Yes — linyiLYi/street-fighter-ai is open source, released under the Apache-2.0 license.
What language is street-fighter-ai written in?
linyiLYi/street-fighter-ai is primarily written in Python.
How popular is street-fighter-ai?
linyiLYi/street-fighter-ai has 6.5k stars on GitHub.
Where can I find street-fighter-ai?
linyiLYi/street-fighter-ai is on GitHub at https://github.com/linyiLYi/street-fighter-ai.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.