Entropy Rangers: AI-Generated Canvas Tower Defense Ships With 188 Green Tests, Zero Dependencies, and a Quarter of the Schedule
AI coding agents become useful for complete artifacts when a human defines hard acceptance constraints and CI enforces them; that is the difference between a one-off demo and a shippable game. Replay-as-test generalizes to any deterministic simulation, giving AI-generated code a machine-checkable proof of correctness.
Entropy Rangers is a browser-based tower-defense strategy game: players place daemon processes on a grid data center, and each deployment rewrites the BFS flow field that enemies use to pathfind. Huawei Cloud's CodeArts agent generated all of the code; the human side defined architecture, acceptance criteria, and balance tuning. The artifact has zero runtime npm dependencies, weighs about 29KB gzipped, and passes 188 tests. Development took 21.5 hours against a hand-written estimate of about 10 days.
The engineering core is “replay as test.” Because the simulation is deterministic, one full playthrough is a regression test: a recorded command stream and seed replay headlessly and must produce the same final-state hash. Three standard matches are baked into CI, and a balance hash throws on any mismatch. The sim layer is forbidden from reading the clock, calling Math.random, importing the DOM, or using floating-point money arithmetic; custom ESLint rules and 10 CI gates enforce it. A 3000-step headless match runs in 20.46ms.
Open source code lives on AtomGit under Apache-2.0, with the game hosted as a pure static page. Adoption numbers are honestly thin: one star, zero forks, zero issues, and zero direct revenue. The monetization path is a three-layer funnel: the work builds trust, articles drive traffic to a WeChat account, and that feeds consulting, freelance, and training opportunities.
The deterministic replay pipeline carries more weight than the AI-generated code. Once a full match is reduced to a hash, “the game works” becomes an automated assertion, and a single floating-point line can be caught immediately.
AI repeatedly violated global constraints like Math.random and Date.now when they were not mechanically enforced. Output quality tracks how explicitly a human defines acceptance criteria, not how clever the prompt is.
The 21.5-hour figure is one sample; balance tuning still required three manual rounds. AI compressed structural coding while balance tuning stayed on the human side.
Once you link fixed step size, instruction stream, and state hashing, 'the game runs' finally has reproducible evidence. Especially using a full playthrough replay as a regression case—this approach catches changes that break determinism better than just looking at test counts.