chong
Entry VI  ·  Brood War  ·  filed under games · AI · history
№ 06 · Entry VI

The game that taught me to think, revisited as a problem.

I played Brood War competitively once. Twenty years later the question is different: with public algorithms, a dead tooling ecosystem, and one desktop, how far can imitation plus a self-play league get on one map, one matchup? The project began not with code but with an audit of whether it’s feasible at all.

openbwc++ / pybind11behaviour cloningstage 2 of 6
§ I — Before any code

The feasibility audit

The first artifact in the repo is a research report, not a module: a sourced audit of the AlphaStar-for-Brood-War literature — claims extracted, a sample adversarially fact-checked, compute costs tiered from hobbyist to industrial. Its conclusions set the scope: the algorithms are public and reproducible; the walls are a compute cliff (TStarBot-X used 144 V100s for 57 days at 1/30th of AlphaStar’s budget) and a replay corpus twenty times smaller than DeepMind’s.

So the project follows the report’s own first recommendation: benchmark the unglamorous thing first. Behaviour cloning and offline RL on one map, macro-actions before raw actions, and a staged plan where each stage can falsify the next.

§ II — Figure I

Stage 0: is the engine fast enough?

Aggregate OpenBW frames per second by parallel instance count, 12-core desktop.

FIG. I — 40,000 frames a second
Fig. I — roughly 3,400 games an hour before GPU inference enters the loop. Verdict from the bench notes: the engine is not the bottleneck.

TorchCraft and STARDATA tooling were archived by Meta in 2022, so the bridge is rebuilt from scratch: a single-translation-unit pybind11 layer exposing a fogged-observation replay reader and a two-player melee environment over OpenBW. The pipeline validated 6,770 of 6,943 professional PvP replays for the corpus.

◆  § III  ◆
§ III — The vocabulary

Recovering intent from replays

Replays record commands, not decisions. Stage 2 is a hand-designed vocabulary of ~24 macro-actions — train, build, expand, attack, retreat, harass, merge archons — acting every 6 frames, a deliberately human-plausible decision rate. An inverse labeler walks each pro replay’s command stream and recovers which macro-action explains it: 92.7% of commands accounted for on a 200-replay sample, with the residue itemized (selection bookkeeping, worker micro, unconsumed).

Stage 3’s smoke test: a deliberately tiny 1.76M-parameter model — per-entity MLP with masked pooling, a small spatial CNN, scalar trunk — driven to 98% training accuracy over 3,164 cached windows on one CPU thread. Not a policy; a proof that the observation and label pipeline carries learnable signal before any GPU-hours are spent on it.

§ IV — The rough edges

Open questions

MaterialsC++, pybind11, PyTorch, OpenBW
VintageMMXXVI — stage 2 of 6
Scale40k fps · 6,770 replays · 92.7% labeled
Sourcegithub/xnmp/bwai