ELF: An Extensive, Lightweight and Flexible Research Platform for Real-time Strategy Games

Yuandong Tian, Qucheng Gong, Wenling Shang, Yuxin Wu, Larry Zitnick

Introduction

Reinforcement learning (RL) has achieved significant milestones in games like Go and Atari. However, Real-Time Strategy (RTS) games present a more formidable challenge, characterized by long-term planning, resource management, and partial information ("fog of war") within massive action spaces. Existing platforms often force a trade-off between speed (e.g., Atari) and complexity (e.g., StarCraft II), the latter often requiring prohibitive compute resources.

ELF (Extensive, Lightweight, and Flexible) is a high-performance platform designed to bridge this gap. By combining a fast C++ game engine with a flexible Python interface, ELF enables researchers to train full-game bots on a single consumer-grade machine in just one day, achieving performance levels that previously necessitated massive compute clusters.

System Architecture

ELF utilizes a hybrid C++/Python architecture based on a producer-consumer paradigm to maximize efficiency and ease of use.

The producer-consumer architecture of ELF, separating C++ game simulation from Python-based RL logic.
  • The Producer (C++): This component handles the game simulation. By utilizing C++ threads, ELF bypasses Python’s Global Interpreter Lock (GIL), allowing for linear scaling across multi-core CPUs.
  • The Consumer (Python/PyTorch): This component manages the RL logic, allowing researchers to leverage modern deep learning frameworks for model definition and optimization.

The platform supports flexible "topologies," enabling various agent-environment relationships (e.g., many-to-one). In experimental settings, the authors employed Asynchronous Advantage Actor-Critic (A3C) with hierarchical commands, curriculum learning, and specific network architectures (Leaky ReLU and Batch Normalization) to handle complex RTS game states.

Environments and Training Strategies

The paper introduces three RTS-style environments built on the ELF engine: Mini-RTS (resource gathering and combat), Capture the Flag (strategic movement), and Tower Defense (spatial planning). Additionally, ELF can act as a high-speed host for existing environments like the Arcade Learning Environment (ALE).

Training in these environments is facilitated by "Speed as a Research Enabler." High frame rates allow for thorough parameter exploration. Key strategies include increasing history length ($T$) in A3C to help agents understand long-term investments and using a progressive curriculum where a rule-based AI assists the agent in early training stages to expose it to diverse mid-game states.

Performance and Key Results

ELF demonstrates exceptional scalability and speed. On a standard machine with 6 CPUs and 1 GPU, a full-game bot can be trained in approximately 24 hours.

Performance benchmarks showing KFPS per CPU core for Mini-RTS and Atari Pong, highlighting ELF's scalability.

Key performance metrics include:

  • Throughput: Mini-RTS runs at approximately 40K FPS per core on standard hardware.
  • Scalability: ELF exhibits near-linear speedup with additional CPU cores, outperforming standard Python-based wrappers like OpenAI Gym by roughly 3x in multi-threaded benchmarks.
  • Agent Proficiency: An A3C agent trained on ELF defeated the built-in rule-based AI in Mini-RTS over 70% of the time, exhibiting emergent strategies such as "rushing" or tactical distractions.

Conclusion

ELF provides a powerful, accessible tool for RTS research, significantly reducing the computational barrier to entry. While current environments like Mini-RTS are simplified compared to professional titles, the platform's flexibility allows for future expansion into more complex action spaces and maps. Future work will focus on forward modeling, planning under uncertainty, and developing more sophisticated hierarchical RL agents.

Summary updated

BibTeX
@inproceedings{tian2017elf,
  author = {Yuandong Tian and Qucheng Gong and Wenling Shang and Yuxin Wu and Larry Zitnick},
  title = {{ELF: An Extensive, Lightweight and Flexible Research Platform for Real-time Strategy Games}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2017},
  url = {https://openreview.net/forum?id=r1bj-tW_ZB},
}
Figure