Asgard Tveir and the order that survived the save
Porting Rampart Zero to Asgard Tveir exposed how much of a game lives outside the frame. That’s where I want coding agents to be able to work.
What happened to order 42?
An order that never reached the battlefield could still leave a hole in a Rampart Zero save. The order had moved no vehicle and spent nothing. The browser could reopen the game, show the right battlefield, and start numbering new orders from the wrong place. I ran into that gap while moving the game to Asgard Tveir, an engine I’m building for game development with coding agents.
Suppose the game carries out order 41 and then refuses order 42 because its queue is full. Asgard has already recorded a decision about 42. If that same request is delivered again, the engine should remember the refusal instead of giving it another chance now that the queue has room. From the engine’s point of view, the next new order is 43. The browser used to resume counting from the last order the game had applied, which was 41.
The checkpoint already held the answer. The browser had no way to ask for it, so it was trying to infer a fact about the engine from the visible consequences in the game. I added a way for the host to read how far the engine had actually got with each sender’s orders. The browser now reads that number after a restore. There’s a core test that queues an order for later, submits an order that consumes a number by being refused, and tries another with a number that skips ahead. It checks where the engine stopped counting, saves the state and checks the same number after a restore.
A screenshot could have made the old save look perfect. Smoke over the same buildings, the same tank in the same spot. The interesting test begins after the screenshot, when you ask the tank to do something.
When two vehicles touch
Movement exposed another version of the same problem. The original Rampart Zero reacts when one vehicle first comes into contact with another. Early in the port I approximated that event by checking whether their bounding boxes overlapped. A bounding box is a cheap way to narrow down what might be touching. At a corner, it can report a collision between two vehicles that still have room to pass.
The physics interface gave the game a contact count. Even an exact count leaves out the things you need to know here. Two pairs can be touching on successive ticks without either of the original pairs still touching. The port now asks Rapier which bodies were in active contact at the end of each step. The game compares that list with the previous one and runs the handlers for both vehicles in a stable order when a pair first touches.
The same attention goes into checkpoints. Rapier has state it carries between physics steps, including the state of the tree it uses to narrow down potential collisions. Asgard saves that, too. A checkpoint has to carry enough of the past for the next tick to agree with the one you would have got by leaving the game running.
The battle can run without a browser
Three.js got Rampart Zero into a browser. I’m still using it to draw the development port, along with the existing React interface. Underneath that interface, the battle runs in Asgard’s C runtime, compiled to WebAssembly. The browser sends commands and reads snapshots. The native build can run the same simulation code without opening a window.
That lets me put a test exactly where I want it. I can start with the state just before a wave, give the game the same orders and advance a fixed number of ticks. I can also render one of those snapshots when the question really is about what the player sees. Native and WebAssembly use the same source, but some floating-point calculations differ. I check exact replay within each qualified build profile.
The port now runs the campaign through the Titan and includes saves and the on-device Commander. I’ve played it. The scripted run that reaches victory gets extra materials from wave eight onward. That run exercises the late-game machinery. It still leaves me with the question a player has to answer with the resources on hand. What can I afford to change before the next wave? The invitation playtest remains on its own release.
Two bugs and a stopwatch
I wanted to find out what this bought a coding agent. I planted two defects in the game and gave fresh sessions the same reports. One defect made a swarmer deal 15 damage per second to buildings instead of 20. The other let a rocket’s splash damage hit friendly units. I tried the original TypeScript game with ordinary tools, the same game with its existing control tool, and the Asgard port.
All six fixes passed their acceptance checks. The ordinary TypeScript runs finished in 51 and 58 seconds. The Asgard runs took 167 and 208. Each result comes from one run, and the builds contended for the same machine. I also got the splash defect slightly wrong in the comparison. The TypeScript mutation swapped sides. The C mutation let friendly units take damage without protecting enemies, so part of the shared bug report was false for that build.
What I wanted from Asgard showed up in the evidence the sessions brought back. It ran the C game with a swarmer attacking a command center and checked that the building lost exactly 20 health in 60 ticks. The other session exercised the rocket in the running simulation and caught the discrepancy between the report and the seeded behavior. I could review both fixes against something the game had actually done. For a small arithmetic defect, a focused unit test is often the quickest way there. For a report about an order going missing after a reload, I want the agent to be able to reload the game.
The next save I want
Asgard can already run an action workload from EDEN//ZERO in addition to Rampart’s strategy simulation. The native viewer has been tested on macOS with Metal and still leaves some Eden weapon attachments undrawn. Those two games give me concrete reasons to change the runtime while I’m building it. An SDK can wait until the games have asked harder questions of it.
The next thing I want is for a playtester to send me a save and a report that something went wrong three orders later. I want an agent to take the same three steps, show me the first tick where the outcome diverges, and turn that sequence into a test I can keep. The work starts with being able to trust the answer to a small question: which order comes next?
Keep exploring
01The smoke changed when the camera turned
A camera rotation exposed a lighting problem in Asgard. The same playtest sent me back through the frame budget, construction preview and the simulation’s record of paid research.
One budget for the whole game
A phone can draw the battlefield, refresh the HUD and listen for orders. Asking it to do all three at once changed how I think about performance in Asgard.