← 开源
linyiLYi

street-fighter-ai

This is an AI agent for Street Fighter II Champion Edition.

Model DevelopmentEnvironmentsPython
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
6.54k
Star
1.38k
Fork
+13
本周
3
贡献者
创建于 2023-03-27 · 更新于 2026-10-16 · 今日第 7249 名
主要开发者
linyiLYikianmengarch-fan

linyiLYi/street-fighter-ai 排名第 7,249,有 6,544 个星标。

同类别比较

linyiLYi/street-fighter-ai 排名第 7,249,此处有 8 个同类条目;facebookresearch/metaseq 排名第 7,248。

同类别比较
名称排名指标
Angel-ML/angel7,229
语言:
Java
星标数:
6,794
分叉数:
1,586
简介:
A Flexible and Powerful Parameter Server for large-scale machine learning
yangjianxin1/Firefly7,238
语言:
Python
星标数:
6,648
分叉数:
583
简介:
Firefly: 大模型训练工具,支持训练Qwen2.5、Qwen2、Yi1.5、Phi-3、Llama3、Gemma、MiniCPM、Yi、Deepseek、Orion、Xverse、Mixtral-8x7B、Zephyr、Mistral、Baichuan2、Llma2、Llama、Qwen、Baichuan、ChatGLM2、InternLM、Ziya2、Vicuna、Bloom等大模型
google-research/text-to-text-transfer-transformer7,246
语言:
Python
星标数:
6,562
分叉数:
801
简介:
Code for the paper "Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer"
facebookresearch/metaseq7,248
语言:
Python
星标数:
6,544
分叉数:
716
简介:
Repo for external large-scale work
codertimo/BERT-pytorch7,252
语言:
Python
星标数:
6,532
分叉数:
1,309
简介:
Google AI 2018 BERT pytorch implementation
open-mmlab/mmcv7,258
语言:
Python
星标数:
6,481
分叉数:
1,769
简介:
OpenMMLab Computer Vision Foundation
cleverhans-lab/cleverhans7,262
语言:
Jupyter Notebook
星标数:
6,458
分叉数:
1,390
简介:
An adversarial example library for constructing attacks, building defenses, and benchmarking both
haifengl/smile7,270
语言:
Java
星标数:
6,421
分叉数:
1,150
简介:
Statistical Machine Intelligence & Learning Engine
关键参数与规格
关键参数与规格
参数值
语言Python
类别Model Development
子类别Environments
关键词Gaming
星标数6,544
分叉数1,376
贡献者3
创建日期2023-03-27
更新日期2026-10-16
1 天星标数0
7 天星标数13
排名7,249
上次排名7,414
排名变化165
7 天星标排名3,440
上次 7 天星标排名3,434
7 天星标排名变化-6
总星标排名2,177
上次总星标排名2,174
总星标排名变化-3
国家China
README 摘录

SFighterAI 简体中文 | English | Español This project is an AI agent trained using deep reinforcement learning to beat the final boss in the game "Street Fighter II: Special Champion Edition". The AI agent makes decisions based solely on the game screen's RGB pixel values. In the provided save state, the agent achieves a 100% win rate in the first round of the final level (overfitting occurs, see the Running Tests section for discussion). File Structure The game

configuration files are stored in the folder, and the main project code is in the folder. Within , the folder contains terminal/console outputs and data curves recording the training process (viewable with Tensorboard), while the folder contains model weights from different stages. These weights can be used for running tests in to observe the performance of the AI agent's learned strategies at different training stages. Running Guide This project is based on the Python programming language and primarily utilizes standard

libraries like OpenAI Gym Retro and Stable-Baselines3. 10, and it is recommended to use Anaconda to configure the Python environment. The following setup process has been tested on Windows 11. Below are console/terminal/shell commands. Environment Setup After the console outputs the folder path, copy it to the file explorer and navigate to the corresponding path. This folder contains the game data files for "Street Fighter II: Special Champion Edition" within gym-retro, including the game ROM file

and data configuration files. Copy the , , , and files from the folder of this project into the game data folder, replacing the original files (administrator privileges may be required). The file is a save state for the game's highest difficulty level, while the three files are gym-retro configuration files storing game information memory addresses (this project only uses [agent_hp] and [enemy_hp] for reading character health values in real-time). To run the program, you will also need the

game ROM file for "Street Fighter II: Special Champion Edition", which is not provided by gym-retro and must be obtained legally through other means. Once you have legally obtained the game ROM file, copy it to the aforementioned gym-retro game data folder and rename it to . At this point, the environment setup is complete. Note 1: If you want to manually capture save states and find memory variables in the game, you can use the gym-retro integration

ui. Copy to the parent menu (two levels up, folder) of the aforementioned gym-retro game data folder. Note 2: If you want to record videos of the AI agent's gameplay, you will need to install ffmpeg. Running Tests Once the environment is set up, you can run in the folder to test and experience the AI agent's performance at different stages of training. Model weight files are stored in the folder. The default model used in is , which has

good generalization and is capable of beating the final level of Street Fighter II: Special Champion Edition. If you want

常见问题

记录了多少星标和分叉?

linyiLYi/street-fighter-ai 有 6,544 个星标和 1,376 个分叉。

仓库排名是多少?

linyiLYi/street-fighter-ai 排名第 7,249。

记录的语言和类别是什么?

linyiLYi/street-fighter-ai 有 6,544 个星标,语言为 Python,类别为 Model Development。

哪个仓库排名最接近?

linyiLYi/street-fighter-ai 与 facebookresearch/metaseq 比较,后者排名第 7,248,有 6,544 个星标。

README

SFighterAI

简体中文 | English | Español

This project is an AI agent trained using deep reinforcement learning to beat the final boss in the game "Street Fighter II: Special Champion Edition". The AI agent makes decisions based solely on the game screen's RGB pixel values. In the provided save state, the agent achieves a 100% win rate in the first round of the final level (overfitting occurs, see the Running Tests section for discussion).

File Structure

├───data
├───main
│   ├───logs
│   ├───trained_models
│   └───scripts
├───utils
│   └───scripts

The game configuration files are stored in the data/ folder, and the main project code is in the main/ folder. Within main/, the logs/ folder contains terminal/console outputs and data curves recording the training process (viewable with Tensorboard), while the trained_models/ folder contains model weights from different stages. These weights can be used for running tests in test.py to observe the performance of the AI agent's learned strategies at different training stages.

Running Guide

This project is based on the Python programming language and primarily utilizes standard libraries like OpenAI Gym Retro and Stable-Baselines3. The Python version used is 3.8.10, and it is recommended to use Anaconda to configure the Python environment. The following setup process has been tested on Windows 11. Below are console/terminal/shell commands.

Environment Setup

# Create a conda environment named StreetFighterAI with Python version 3.8.10
conda create -n StreetFighterAI python=3.8.10
conda activate StreetFighterAI

# Install Python libraries
cd [parent_directory_of_project]/street-fighter-ai/main
pip install -r requirements.txt

# Run script to locate gym-retro game folder
cd ..
python .\utils\print_game_lib_folder.py

After the console outputs the folder path, copy it to the file explorer and navigate to the corresponding path. This folder contains the game data files for "Street Fighter II: Special Champion Edition" within gym-retro, including the game ROM file and data configuration files. Copy the Champion.Level12.RyuVsBison.state, data.json, metadata.json, and scenario.json files from the data/ folder of this project into the game data folder, replacing the original files (administrator privileges may be required). The .state file is a save state for the game's highest difficulty level, while the three .json files are gym-retro configuration files storing game information memory addresses (this project only uses [agent_hp] and [enemy_hp] for reading character health values in real-time).

To run the program, you will also need the game ROM file for "Street Fighter II: Special Champion Edition", which is not provided by gym-retro and must be obtained legally through other means. You can refer to this link.

Once you have legally obtained the game ROM file, copy it to the aforementioned gym-retro game data folder and rename it to rom.md. At this point, the environment setup is complete.

Note 1: If you want to manually capture save states and find memory variables in the game, you can use the gym-retro integration ui. Copy data/Gym Retro Integration.exe to the parent menu (two levels up, retro/ folder) of the aforementioned gym-retro game data folder.

Note 2: If you want to record videos of the AI agent's gameplay, you will need to install ffmpeg.

conda install ffmpeg

Running Tests

Once the environment is set up, you can run test.py in the main/ folder to test and experience the AI agent's performance at different stages of training.

cd [parent_directory_of_project]/street-fighter-ai/main
python test.py

Model weight files are stored in the main/trained_models/ folder. The default model used in test.py is ppo_ryu_2500000_steps_updated.zip, which has good generalization and is capable of beating the final level of Street Fighter II: Special Champion Edition. If you want to see the performance of other models, you can change the model_path variable in test.py to the path of another model file. The observed performance of the models at various training stages is as follows:

  • ppo_ryu_2000000_steps_updated: Just beginning to overfit state, generalizable but not quite capable.
  • ppo_ryu_2500000_steps_updated: Approaching the final overfitted state, cannot dominate first round but partially generalizable. High chance of beating the final stage.
  • ppo_ryu_3000000_steps_updated: Near the final overfitted state, almost dominate first round but barely generalizable.
  • ppo_ryu_7000000_steps_updated: Overfitted, dominates first round but not generalizable.

Training the Model

If you want to train your own model, you can run train.py in the main/ folder.

cd [parent_directory_of_project]/street-fighter-ai/main
python train.py

Viewing Training Curves

The project includes Tensorboard graphs of the training process. You can use Tensorboard to view detailed data. It is recommended to use the integrated Tensorboard plugin in VSCode to view the data directly. The traditional viewing method is listed below:

cd [parent_directory_of_project]/street-fighter-ai/main
tensorboard --logdir=logs/

Open the default Tensorboard service address http://localhost:6006/ in your browser to view interactive graphs of the training process.

Acknowledgements

This project uses open-source libraries such as OpenAI Gym Retro, Stable-Baselines3. The contributions of all the developers to the open-source community are appreciated!

Two papers that had a significant impact on this project:

[1] DIAMBRA Arena A New Reinforcement Learning Platform for Research and Experimentation The valuable summary of the experience in setting hyperparameters for deep reinforcement learning models in fighting games in this paper was of great help to the training process of this project.

[2] Mitigating Cowardice for Reinforcement Learning The "penalty decay" mechanism proposed in this paper effectively solved the "cowardice" problem (always avoiding opponents and not daring to even try attacking moves).

排名相邻
同类项目