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.

Note

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.

Note

When using custom maps created with SC2 Editor, you need to modify the version in t3Terrain.xml to 114 using mpqeditor. For more details, please refer to this issue.

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)[source]

Bases: RawMultiAgentEnv

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

Parameters:

config – The configurations of the environment.

agent_mask()[source]

Returns boolean mask variables indicating which agents are currently alive.

avail_actions()[source]

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

close()[source]

Closes the environment.

get_env_info()[source]
render(mode)[source]

Renders the environment.

Returns:

The images used to visualize the environment.

Return type:

rgb_images (np.ndarray or list)

reset()[source]

Resets the environment.

state()[source]

Returns the global state of the environment.

step(actions)[source]

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