Skip to content
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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Conversation

nighood
Copy link
Collaborator

@nighood nighood commented Dec 20, 2023

PR Description

This PR introduces the SMAC (StarCraft Multi-Agent Challenge) environment to the LightZero repository. The included environment is fully operational and has been tested for functionality. However, please note that there are currently no matching pipelines available for this environment within the repository. Future updates will include the necessary pipelines to fully integrate SMAC with LightZero.

Key Points:

  • Environment Installation: Detailed instructions are provided for installing the modified PySC2 environment and its dependencies.
  • Testing: Instructions for running tests using pytest to ensure the environment is correctly installed and functional.
  • DI-engine Baselines: A link to the DI-engine SMAC baselines is included for additional reference.

Next Steps:

  • Pipeline Integration: The necessary pipelines to utilize the SMAC environment within LightZero will be added in upcoming updates.

Thank you for reviewing this PR. Please feel free to provide any feedback or suggestions for improvements.

@puyuan1996 puyuan1996 changed the title env(rjy): add smac env feature(rjy): add smac env Dec 22, 2023
zoo/smac/README.md Outdated Show resolved Hide resolved
path = '../exp/MMM/qmix/1/ckpt_BaseLearner_Wed_Jul_14_22_16_56_2021/iteration_9900.pth.tar'
cfg = '../config/smac_MMM_qmix_config.py'
state_dict = torch.load(path, map_location='cpu')
eval(cfg, seed=0, state_dict=state_dict)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

在安装好SMAC后,需要保证这里给出的eval是可运行的,并且可以存储replay的gif或者MP4文件

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里是之前diengine的,我先删掉,后续lz pipeline可以收敛有ckpt后再增加这个eval文件

zoo/smac/envs/smac_env_lz.py Outdated Show resolved Hide resolved
zoo/smac/envs/smac_env_lz.py Outdated Show resolved Hide resolved
@@ -0,0 +1,7 @@
import warnings
Copy link
Collaborator

@puyuan1996 puyuan1996 Dec 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

增加一下SMAC 在 SEZ/EZ independent learning 上的可运行config

@puyuan1996 puyuan1996 added environment New or improved environment config New or improved configuration labels Dec 22, 2023
@@ -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).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SMAC 和 pysc2 加上超链接

1. **Install StarCraft II:**
```bash
# Create a conda environment
conda create -n ace python=3.8
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ace 换成 lightzero-smac ?

2. **Install dependencies:**
```bash
# Install PySC2 and Protobuf
pip install pysc2 protobuf==3.19.5
Copy link
Collaborator

@puyuan1996 puyuan1996 Jun 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我的mac本地protobuf==3.20.0测试的报错少一些,你保证按照这里的方式能成功通过测试就好哈


2. **Run the tests using pytest:**
```bash
pytest test_smac_env.py
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

smac

@@ -0,0 +1,15 @@
# Notes on Two Player Maps

Before starting, you need to do the following things:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two Player Maps具体相对SMAC_Maps的区别是什么?这个文档更新一下吧

@pytest.mark.envtest
class TestSmacEnv:

def test_samc():
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

smac

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你本地测试通过了吗?

import os


class SMACMap(lib.Map):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个和DI-engine里面的一样吗?如果一样import就可以哈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config New or improved configuration environment New or improved environment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants