StarCraft Multi-Agent Challenge

../../../../_images/smac.png

The StarCraft multi-agent challenge (SMAC) is WhiRL’s environment for research of cooperative MARL algorithms. SMAC uses StarCraft II, a real-time strategy game developed by Blizzard Entertainment, as its underlying environment.

GitHub repository: https://github.com/oxwhirl/smac.git

Installation

Step 1: Install the SMAC python package

You can install the SMAC directly from the GitHub:

pip install git+https://github.com/oxwhirl/smac.git

Or you can clone the GitHub repository and install it with its dependencies:

git clone https://github.com/oxwhirl/smac.git
cd smac/
pip install -e .

Step 2: Install StarCraft II

Linux

Please use the Blizzard’s repository to download the Linux version of StarCraft II.

Windows/MacOS

You need to first install StarCraft II from BATTAL.NET or https://starcraft2.blizzard.com.

备注

You would need to set the SC2PATH environment variable with the correct location of the game. By default, the game is expected to be in ~/StarCraftII/ directory. This can be changed by setting the environment variable SC2PATH.

Step 3: SMAC Maps

Once you have installed smac and StarCraft II, you need to download the SMAC Maps, and extract it to the $SC2PATH/Maps$ directory. If you installed smac via git, simply copy the SMAC_Maps directory from smac/env/starcraft2/maps/ into $SC2PATH/Maps directory.

Citation

The BibTex format of SMAC environment is listed as follows. Please cite the SMAC paper if you use it in your research.

@article{samvelyan19smac,
  title = {{The} {StarCraft} {Multi}-{Agent} {Challenge}},
  author = {Mikayel Samvelyan and Tabish Rashid and Christian Schroeder de Witt and Gregory Farquhar and Nantas Nardelli and Tim G. J. Rudner and Chia-Man Hung and Philiph H. S. Torr and Jakob Foerster and Shimon Whiteson},
  journal = {CoRR},
  volume = {abs/1902.04043},
  year = {2019},
}

APIs

class xuance.environment.multi_agent_env.starcraft2.StarCraft2_Env(*args, **kwargs)[源代码]

基类:RawMultiAgentEnv

The implementation of StarCraft2 environments, provides a standardized interface for interacting with the environments in the context of multi-agent reinforcement learning.

参数:

config – The configurations of the environment.

agent_mask()[源代码]

Returns boolean mask variables indicating which agents are currently alive.

avail_actions()[源代码]

Returns a boolean mask indicating which actions are available for each agent.

close()[源代码]

Closes the environment.

get_env_info()[源代码]
render(mode)[源代码]

Renders the environment.

返回:

The images used to visualize the environment.

返回类型:

rgb_images (np.ndarray or list)

reset()[源代码]

Resets the environment.

state()[源代码]

Returns the global state of the environment.

step(actions)[源代码]

Takes actions as input, perform a step in the underlying StarCraft2 environment.