-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature(rjy): add smac env #171
base: main
Are you sure you want to change the base?
Changes from all commits
1605850
9f93bf7
c0dd08e
fe45b43
c549ff9
4eac16f
6817faf
da14d96
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
## PYSC2 Env | ||
SMAC (StarCraft Multi-Agent Challenge) is an environment used for multi-agent reinforcement learning research based on the popular real-time strategy game StarCraft II. It provides a suite of tasks where agents need to cooperate to achieve specific objectives. This environment is widely used to benchmark the performance of multi-agent learning algorithms. LightZero use modified pysc2 env (for more maps and agent vs agent training). | ||
|
||
### Installation | ||
|
||
To install the modified PySC2 environment for more maps and agent vs. agent training, follow these steps: | ||
|
||
1. **Install StarCraft II:** | ||
```bash | ||
# Create a conda environment | ||
conda create -n ace python=3.8 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ace 换成 lightzero-smac ? |
||
|
||
# Activate the environment | ||
conda activate ace | ||
|
||
# Download StarCraft II | ||
wget https://blzdistsc2-a.akamaihd.net/Linux/SC2.4.10.zip | ||
|
||
# Unzip the downloaded file | ||
unzip SC2.4.10.zip | ||
|
||
# Set the SC2 path | ||
export SC2PATH="StarCraftII" | ||
``` | ||
|
||
2. **Install dependencies:** | ||
```bash | ||
# Install PySC2 and Protobuf | ||
pip install pysc2 protobuf==3.19.5 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 我的mac本地protobuf==3.20.0测试的报错少一些,你保证按照这里的方式能成功通过测试就好哈 |
||
``` | ||
|
||
### Testing the Installation | ||
|
||
To ensure the environment is correctly installed and functional, you can run the tests provided in the LightZero repository: | ||
|
||
1. **Navigate to the LightZero directory:** | ||
```bash | ||
cd LightZero/zoo/smac/envs | ||
``` | ||
|
||
2. **Run the tests using pytest:** | ||
```bash | ||
pytest test_smac_env.py | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. smac |
||
|
||
### Environment Requirements | ||
|
||
- **Operating System:** Linux (recommended) | ||
- **Python Version:** >=3.8 | ||
- **Dependencies:** | ||
- StarCraft II (version 4.10) | ||
- PySC2 | ||
- Protobuf (version 3.19.5) | ||
|
||
Make sure your system meets these requirements before proceeding with the installation. | ||
|
||
### DI-engine Baselines | ||
|
||
For more information on DI-engine baselines for SMAC, refer to the following link: [DI-engine SMAC Baselines](https://github.com/opendilab/DI-engine/blob/main/dizoo/smac/README.md) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import warnings | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 增加一下SMAC 在 SEZ/EZ independent learning 上的可运行config |
||
|
||
try: | ||
from .smac_env_ace import SMACACEEnv | ||
except ImportError: | ||
warnings.warn("not found pysc2 env, please install it") | ||
SMACEnv = None |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Notes on Two Player Maps | ||
|
||
Before starting, you need to do the following things: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Two Player Maps具体相对SMAC_Maps的区别是什么?这个文档更新一下吧 |
||
|
||
1. copy the maps in `maps/SMAC_Maps_two_player/*.SC2Map` to the directory `StarCraft II/Maps/SMAC_Maps_two_player/`. | ||
2. copy the maps in `maps/SMAC_Maps/*.SC2Map` to the directory `StarCraft II/Maps/SMAC_Maps/`. | ||
|
||
A convenient bash script is: | ||
|
||
```bash | ||
# In linux | ||
cp -r SMAC_Maps_two_player/ ~/StarCraftII/Maps/ | ||
cp -r SMAC_Maps/ ~/StarCraftII/Maps/ | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SMAC 和 pysc2 加上超链接