Carefully Structured Compression: Efficiently Managing StarCraft II Data

Bryce Ferenczi, Rhys Newbury, Michael G. Burke, Tom DrummondarXiv 2024 · DOI

Abstract

StarCraft II (SC2) serves as a premier benchmark for artificial intelligence, yet the massive storage requirements for comprehensive game state datasets pose a significant barrier to entry. This paper introduces sc2-serializer, a framework that leverages "instance-major" data restructuring to achieve a ~90% reduction in storage footprint compared to existing state-of-the-art methods like AlphaStar-Unplugged. By grouping unit attributes across time, the framework exploits temporal redundancy, enabling the storage of nearly one million games in 1TB. Beyond storage efficiency, the method improves serialization speed and supports high-performance training pipelines, achieving 82% accuracy in game outcome prediction.

Introduction

StarCraft II's complexity, characterized by a vast state space and long-term strategic requirements, makes it a "grand challenge" for reinforcement learning. However, the transition from raw replay files (sequences of player actions) to the full game states required for neural network training results in an explosion of data volume. For instance, the AlphaStar-Unplugged dataset requires approximately 10TB of storage, a prohibitive cost for many research institutions. This work addresses the logistical hurdle of storing and processing these massive datasets without sacrificing data fidelity or simulation speed.

Methods

The sc2-serializer framework optimizes data storage not through a novel compression algorithm, but through structural reorganization that maximizes the efficacy of standard lossless compression (e.g., ZLIB).

  1. Structure-of-Arrays (SoA) Transition: Traditional game data follows an Array-of-Structures (AoS) format, where each unit's attributes (UID, coordinates, health) are stored contiguously. sc2-serializer pivots to a Structure-of-Arrays (SoA) format, grouping identical attribute types together. This improves data locality, ensuring that models requiring specific features (e.g., only unit health) do not waste bandwidth loading irrelevant data.
  2. Instance-Major Ordering: The primary innovation is the shift from time-major to instance-major ordering. In SC2, many unit properties remain static or change slowly over time. By grouping a single unit's attributes across consecutive timesteps, the data stream contains long sequences of identical values. This temporal redundancy allows standard compression algorithms to achieve significantly higher compression ratios.

The tool is implemented in C++ for performance with Python bindings for accessibility.

Datasets and Benchmarking

The researchers compiled and released a comprehensive dataset of over 900,000 games, significantly larger than previous public offerings. This includes a broad public dataset and a curated tournament-level dataset.

Comparison of dataset scale and features across different StarCraft II research methods.

Results

The structural optimizations lead to a ~90% reduction in dataset size compared to the AlphaStar-Unplugged format. As shown in Figure 4, sc2-serializer dramatically outperforms both naive approaches and previous state-of-the-art storage methods.

Storage size comparison between sc2-serializer, naive serialization, and the AlphaStar format.

In addition to storage savings, the framework is twice as fast during serialization on systems with limited memory (≤ 4GB per core). Models trained on this data demonstrated superior performance:

  • Outcome Prediction: Achieved 82% accuracy in predicting the winner 15 minutes into a match, an 11% improvement over earlier benchmarks.
  • Minimap Forecasting: A UNet-based model achieved an AUC of 0.923 for predicting unit occupancy 9 seconds into the future.

Conclusion

By reducing the hardware barrier for SC2 research, sc2-serializer democratizes access to high-level AI benchmarks. While the current implementation faces limitations in random access due to the nature of the compressed instance-major blocks, future iterations may incorporate chunked serialization to facilitate faster random sampling. The principles of exploiting temporal redundancy through structural reorganization are broadly applicable to other complex simulations and "digital twin" applications.

Summary updated

BibTeX
@misc{ferenczi2024carefully,
  author = {Bryce Ferenczi and Rhys Newbury and Michael G. Burke and Tom Drummond},
  title = {{Carefully Structured Compression: Efficiently Managing StarCraft II Data}},
  year = {2024},
  eprint = {2410.08659},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.08659},
}
Figure