opendilab/DI-star is a Python project with 1.4k stars in the AI Tools space. An artificial intelligence platform for the StarCraft II with large-scale distributed training and grand-master agents.
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
DI-star: A large-scale game AI distributed training platform specially developed for the StarCraft II. We've already trained grand-master AI!This project contains:
Play demo and test code (try and play with our agent!)
First version of pre-trained SL and RL agent (only Zerg vs Zerg)
Training code of Supervised Learning and Reinforcement Learning (updated by 2022-01-31)
Training baseline with limited resource(one PC) and training guidance here (New! updated 2022-04-24)
Agents fought with Harstem (YouTube) (updated by 2022-04-01)
More stronger pre-trained RL agents (WIP)
Usage
Testing software on Windows | 对战软件下载
Please star us (click button in the top-right of this page) to help DI-star agents to grow up faster :)
Installation
Environment requirement:
Python: 3.6-3.8
1.Install StarCraftII
Download the retail version of StarCraftII: https://starcraft2.com
Note: There is no retail version on Linux, please follow the instruction here
Add SC2 installation path to environment variables SC2PATH (skip this if you use default installation path on MacOS or Windows, which is C:\Program Files (x86)\StarCraft II or /Applications/StarCraft II):
On MacOS or Linux, input this in terminal:
export SC2PATH=<sc2/installation/path>
On Windows:
Right-click the Computer icon and choose Properties, or in Windows Control Panel, choose System.
Choose Advanced system settings.
On the Advanced tab, click Environment Variables.
Click New to create a new environment variable, set SC2PATH as the sc2 installation location.
After creating or modifying the environment variable, click Apply and then OK to have the change take effect.
2.Install distar:
git clone https://github.com/opendilab/DI-star.git
cd DI-star
pip install -e .
3.Install pytorch:
Pytorch Version 1.7.1 and CUDA is recommended, Follow instructions from pytorch official site
Note: GPU is neccessary for decent performance in realtime agent test, you can also use pytorch without cuda, but no performance guaranteed due to inference latency on cpu.
Make sure you set SC2 at lowest picture quality before testing.
Play with pretrained agent
1. Download StarCraftII version 4.10.0
Double click the file data/replays/replay_4.10.0.SC2Replay, StarCraftII version 4.10.0 will be automatically downloaded.
Note: We trained our models with versions from 4.8.2 to 4.9.3. Patch 5.0.9 has came out in March 15, 2022, Some changes have huge impact on performance, so we fix our version at 4.10.0 in evaluation.
It is necessary to build different agents within one code base and still be able to make them play against each other.
We implement this by making actor and environment as common components and putting everything related to the agent into one directory.
The agent called default under distar/agent is an example of this. Every script under default uses relative import, which
makes them portable to anywhere as a whole part.
If you want to create a new agent with/without our default agent, follow instructions here
If you want to train a new agent with our framework, follow instructions below and here is a guidance with more details of the whole training pipeline.
Supervised Learning
StarCraftII client is required for replay decoding, follow instructions above.
python -m distar.bin.sl_train --data <path>
path could be either a directory with replays or a file includes a replay path at each line.
Optionally, separating replay decoding and model training could be more efficient, run the three scripts in different terminals:
Here is an example of training on a machine with 4 GPUs in remote mode:
# Run the following scripts in different terminals (windows).
python -m distar.bin.sl_train --type coordinator
# Assume 4 GPUs are on the same machine.
# If your GPUs are on different machines, you need to configure the init_mehod's IP for each machine.
python -m distar.bin.sl_train --type learner --remote --init_method tcp://127.0.0.1 --rank 0 --world_size 4
python -m distar.bin.sl_train --type learner --remote --init_method tcp://127.0.0.1 --rank 1 --world_size 4
python -m distar.bin.sl_train --type learner --remote --init_method tcp://127.0.0.1 --rank 2 --world_size 4
python -m distar.bin.sl_train --type learner --remote --init_method tcp://127.0.0.1 --rank 3 --world_size 4
python -m distar.bin.sl_train --type replay_actor --data <path>
Reinforcement Learning
Reinforcement learning will use supervised model as initial model, please download it first, StarCraftII client is also required.
1. Training against bots in StarCraftII:
python -m disatr.bin.rl_train
2. Training with self-play
python -m disatr.bin.rl_train --task selfplay
Four components are used for RL training, just like SL training, they can be executed through different process:
No homepage URL was recorded for opendilab/DI-star in TopGit's last sync. The README tab above frequently contains screenshots and demo links, or check the repository description on GitHub.
How active is development on opendilab/DI-star?
The most recent commit recorded on opendilab/DI-star was 1.4 years ago, based on the GitHub push timestamp. The repository has 126 forks — one of the better signals of community interest.
How many stars does opendilab/DI-star have?
opendilab/DI-star has 1.4k GitHub stars — refresh the page for the live number, or check github.com/opendilab/DI-star. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is opendilab/DI-star open source?
Yes — opendilab/DI-star ships under the Apache-2.0 license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/opendilab/DI-star.
What else is in the AI Tools space?
opendilab/DI-star is tracked by TopGit under the AI Tools category, alongside 7 GitHub-tagged topics. Trending and Topics pages list peer repositories of comparable stars and language.
What topics is opendilab/DI-star associated with?
GitHub's repository topics for opendilab/DI-star: "artificial-intelligence", "deep-learning", "deep-reinforcement-learning", "league", "reinforcment-learning", "self-play", "starcraft2". TopGit's editorial category is AI Tools.
Where do I read more about opendilab/DI-star?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/opendilab/DI-star is the definitive source.
Read full README in the tab above.
Curious whether DI-star is right for you?
Let ChatGPT, Claude, or Perplexity look into it — click below and see what AI actually says about DI-star.