Gym-µRTS: Toward Affordable Full Game Real-time Strategy Games Research with Deep Reinforcement Learning

Shengyi Huang, Santiago Ontañón, Chris Bamford, Lukasz GrelaCoG 2021

Introduction

Real-Time Strategy (RTS) games represent a "grand challenge" for artificial intelligence due to their vast state-action spaces, long-term dependencies, and the requirement for simultaneous multi-unit control. While systems like DeepMind’s AlphaStar have achieved professional-level performance in StarCraft II, they require massive computational resources—thousands of CPUs and specialized accelerators—placing such research out of reach for most academic institutions. This paper introduces Gym-μRTS, a lightweight environment designed to democratize RTS research by enabling the training of state-of-the-art agents on consumer-grade hardware.

Methods and Architectures

The researchers utilize Proximal Policy Optimization (PPO) as a baseline but implement several critical augmentations to handle the complexity of RTS gameplay. A primary challenge in RTS is controlling multiple units effectively. The authors compare two distinct architectural approaches for action prediction:

  1. Unit Action Simulation (UAS): The policy is invoked iteratively for each unit on the map.
  2. Gridnet: A convolutional architecture that predicts action components for every cell in the map simultaneously in a single forward pass.
Architectural diagrams for Gridnet (a) and UAS (b) policy heads.

Invalid Action Masking and Composition

To manage the combinatorial explosion of the action space, the authors decompose actions into smaller, independent heads (e.g., Action Type, Move Parameter, Target). However, the most significant technical contribution is the use of invalid action masking. By providing the agent with a mask that zeros out illegal moves—such as moving into obstacles or attacking non-existent targets—before sampling, the search space is drastically reduced. This technique proves essential; ablation studies indicate that without it, agents often fail to learn even fundamental behaviors like resource harvesting.

Experimental Results

The agents were evaluated against a pool of 11 competitive scripted bots, including the 2020 μRTS champion, CoacAI. The experiments demonstrate that the combination of PPO, invalid action masking, and training against diverse opponents allows the agent to achieve a 91% cumulative win rate.

Performance comparison of various PPO configurations across UAS and Gridnet architectures, showing win rates, parameter counts, and runtimes.

As shown in the results, the Gridnet architecture demonstrated superior reward attribution, learning complex synergies between units—such as efficient multi-worker harvesting—that were previously unseen in DRL-based RTS bots. Crucially, the entire training process for a state-of-the-art agent took approximately 60 hours on a single machine (1 GPU, 3 vCPUs), compared to the thousands of hours typically cited in high-end RTS research.

Conclusion

Gym-μRTS demonstrates that high-level RTS performance is achievable without massive compute clusters. By proving that a state-of-the-art agent can be trained efficiently on a single consumer GPU, the authors shift the research frontier from computational brute force to algorithmic innovation. Future work will focus on addressing challenges in partial observability and generalization across diverse, asymmetric maps.

Summary updated

BibTeX
@misc{huang2021gym,
  author = {Shengyi Huang and Santiago Ontañón and Chris Bamford and Lukasz Grela},
  title = {{Gym-µRTS: Toward Affordable Full Game Real-time Strategy Games Research with Deep Reinforcement Learning}},
  year = {2021},
  eprint = {2105.13807},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2105.13807},
}
Figure