over|yonder Get in touch ↗
Menu

The Loong Game

An open source series running alongside the UNSW Battlecode competition, with weird bot ideas, beginner tips, unswbc tools and WASM performance deep dives.

Code and post sources on GitHub  ↗
  1. Introducing The Loong Game

    Who I am, what the series is for, the 2026 tournament in brief, and what the official toolkit does and doesn't give you.

  2. The wishlist

    Trying to improve a bot with only the stock toolkit, where that falls short, and the eight tools built in this series to fill the gaps.

  3. The choice

    Python, C and Nim under the judge's CPU-point meter, plus Odin for tools, Zig for the host, and Rake for SIMD kernels or a whole program.

  4. The evaluation harness

    A harness that plays every pairing on every map from both sides with shared seeds, runs games side by side, and keeps crashes apart from losses.

  5. Better, worse or undecided

    A sequential test that says how far a difference between two bots can be trusted, and the upset games that turn up faults to watch.

  6. Unseen maps

    Generating plausible new maps with another competitor's shared generator, and the blind spots revealed in the flood-fill bot.

  7. A ladder of our own

    Rating every saved version against every other with a Bradley–Terry fit of all games at once, and checking the pool for rock-paper-scissors circles.

  8. Everyone else's games

    A paced, resumable replay collector with a capped store, recent games from strong teams, pins for study, and explicit retention and deletion.

  9. Reading a replay

    Decoding the packed Cap'n Proto replay format with a reader written in Nim, rebuilding each game turn by turn, and counting how dragons die.

  10. Pearls from the seed

    Recovering compatible pearl schedules from a replay and seed, checking hidden map variants, and refusing a reconstruction that doesn't match.

  11. Through one dragon's eyes

    An Odin debug viewer that reruns a bot to show each dragon's window, decisions and graded memory, and what it shows about why chasing pearls kills.

  12. Profiling CPU points

    Profiling charged points by function and instruction class, joining compiler vectorisation remarks, and following hot code into native perf.

  13. The shape of the problem

    Organising the textbook bot around role objectives, utility-selected tasks and state machines, then reviewing the first small strategy bot.

  14. Three lines

    How a numbered strategy, pinned library pieces and a shared runtime form a bot, then why textbook, foil and learned lines develop side by side.

  15. Roles

    Champions, workers and kamikazes as parent states over shared behaviours, each dragon working out its own role by sonar, and bugs found in replays.

  16. Tactics

    Coiling the champion and feeding it with smaller dragons that die beside it, the numbers left to tune, and every version on one ladder.

  17. Sonar

    How sonar rays, echoes and open messages work, what 800 public replays showed about encryption and forgery, and the idea of poker over sonar.

  18. Counting room faster

    Taking the room count from Nim through bitboards to SIMD, 66 times cheaper in CPU points, and keeping it vectorised with a Rake kernel.

  19. The machine inside the judge

    A faster Zig host with metered bot fibres, inspection-only observers, served teams, lockstep checks and explicit native CPU/CUDA simulation.

  20. An engine on the GPU

    A shared fixed-array engine for CPU and CUDA, the historical GPU training loop and its checks, and released SDK 1.2.7 complete-match references.

  21. Games in the cloud

    Running big batches of games on AWS Spot workers, the standing resources declared in OpenTofu, and how every run ends on its own.

  22. Game data in columns

    One binary format for all our game data: memory-mapped columns read without parsing, and a converter that writes them from any packed replay file.

  23. Playing the ladder

    How we played the ranked ladder: choosing opponents, estimating a bot before release, when to swap bots, knockout tournaments and opponent styles.

  24. Modelling other teams

    What research on modelling other agents offers a public ladder, and what we did: a census of techniques, imitation, sonar decoding and determinism.

  25. Planning to play

    The planning line: its world model, sonar, roles, utility selection, twenty behaviours, state machines and tactical search.

  26. Learning to play

    The learned line: a large teacher trained by self-play, a league of past selves, and distillation into an integer student that fits the judge.

  27. A tour of our bot

    The pre-Queen bot: its memory, sonar, roles and bounded planning, plus the unfinished experiment that put a learned student in charge of movement.

  28. Slay the Queen

    The competition changes to Slay the Queen after the Sprint, so earlier planning and learning designs are being revisited under the new rules.

  29. The final specification

    The final expert design for Loong: belief, a quantised policy and value network, options, online search, teacher training, league play and review.