TorchCraft 2 
(aka StarCraft Gym)
The fastest, easiest way to use StarCraft as a reinforcement learning environment.
And all you have to do to get started is pip install it.
Motivation
Researchers are eager to use StarCraft-based environments for RL experiments. But the process of getting StarCraft up and running can be time-consuming, and most environments aren't easy to use out of the box.
TorchCraft 2 offers simple (one-touch!) installation, an easy-to-use Gym interface, and multiple challenges/baselines out of the box.
In addition, we've worked with Blizzard to allow to TorchCraft 2 to include first legal distribution of StarCraft: Brood War binaries. This will enable the public to use TorchCraft 2 without having to acquire their own copies of StarCraft, or having to install it.
See the project proposal for details.
Roadmap
With those ready, we're aiming to launch TorchCraft 2 internally for experiments and beta testing. From there, the plan is:
- Integration with TorchCraft (deprecating the original Lua/Python APIs)
- Pre-compiled binary distribution on PyPy
- Public release, PR, and tutorial content
The full roadmap lives on GitHub
Usage
Building TorchCraft 2 for development
This is how I recommend using TorchCraft 2 at the moment:
git clone --recursive https://github.com/fairinternal/TorchCraft2/ tc2
cd tc2
conda create --name tc2 python=3 pip
source activate tc2
conda install pip cmake pybind11 numpy
conda install -y -c conda-forge sdl2 zstd
conda install -y -c anaconda zeromq
pip install -e .
Downloading required Starcraft files
Once you have installed tc2, you have to download StarCraft data files (MPQ files). We provide you with
a tool to do that just for you - we can't provide them right away because we need you to read and accept Blizzard's EULA first.
tc2-setup
Demo
This demo (run_demo.py) creates a StarCraft gym environment and controls an agent using a simple "attack the middle" policy.
import gym
import tc2
from tc2.agents import attack_middle
env = gym.make('tc2-demo-v0')
while True:
env.reset()
actions = []
done = False
while not done:
observation, reward, done, info = env.step(actions)
actions = attack_middle(observation)
Running the TorchCraft 2 demo:
python3 run_demo.py
Metadata
Release files for tc2 0.0.1594993188
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tc2-0.0.1594993188.tar.gz | 8.4 MB | Without provenance | Details for tc2-0.0.1594993188.tar.gz |
Release files / tc2-0.0.1594993188.tar.gz
| Download URL | tc2-0.0.1594993188.tar.gz |
|---|---|
| Size | 8.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c01e95641d5d99bf1e9b41d290ff4569ad9b4226f52747fad60177503e69c9c3
|
|
BLAKE2b-256 checksum How to use checksums |
658e3718ab1e659f6e538f471c094aaaa0c14bdf02d0c76a4323b5322816f89a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.8
|
Security for tc2 0.0.1594993188
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.