← FIELD NOTES / ENGINE DEVELOPMENT

Asgard Tveir and the space between ticks

Porting Rampart Zero meant deciding when an order becomes part of the world, who it belongs to, and what the browser can honestly say has happened.

01

When did the Garage get its order?

One of the original Rampart Zero tests checks your materials at a very particular moment. The Garage has just been told to build a unit. The job is visible in the queue, but the game hasn’t started production or charged you for it yet. In the old browser game, I could look into the store between those two events. When I ran the test against Asgard Tveir, the first state I could inspect already showed the 150-material charge.

The old command changed the browser store immediately. The next simulation tick started the job. In Asgard, the command enters the world at the beginning of a tick, and that tick can also start production. The browser will see the result of both in the next snapshot. The test was asking to look into a moment the engine doesn’t expose.

That’s a small difference if you’re watching a Jeep come out of a Garage. It’s a consequential one if you’re trying to build an engine that an agent can drive and inspect. The game needs a clear answer about when an action took effect. A test, the HUD and a coding agent should be asking the same world.

02

Keep the old tests asking hard questions

I kept Rampart Zero’s browser presentation and its original Commander while moving authority for the battle into Asgard. The simulation runs in a WebAssembly worker at 60 ticks per second. The renderer gets snapshots. At that boundary, the temptation is to fill in anything the new engine doesn’t yet report. For a while, the browser was doing exactly that with some details of orders, squads and production.

Running the old tests against the new world forced me to look past what the screen could approximate. A plan can name a squad before any of its vehicles exist. If the player interrupts that plan, the jobs tied to it must still be identifiable in the production queue. Those facts now belong to the simulation, alongside the order details that the browser used to reconstruct.

The harness sets up its test worlds through Asgard’s commands and fixture operations, then drives the old test code against a real WebAssembly simulation. The development record reports 563 of the 566 selected UI, audio and Commander checks passing. The other three depend on the old window between a store write and a tick. Keeping the test expectations visible made it clear where I had a missing feature and where I had a different definition of when a change becomes observable.

03

Who gets credit for the Garage?

The browser had another tempting shortcut. While a Commander tool was working, the client marked its actions as coming from the Commander. That worked until a tool paused to await something and the player placed a Garage before it returned. Then an ordinary click could get the Commander’s name on it.

The regression starts a real Commander power task, holds it open, and places a Garage through the normal hotkey and click. The orders on either side belong to the Commander. The Garage in the middle belongs to the player. The client now assigns that identity where each action is submitted. The world also records the authority behind the order, so an explicit player instruction relayed by the Commander can still get the protection it would have had if you clicked it in yourself.

That provenance is part of the game. It can decide whether autonomy is allowed to override an order. I want it attached to the order that entered the world, where it can be read back alongside the decisions it affected.

04

The microphone was a different kind of evidence

The Commander scenario could load the model and stage game orders. Then I tried the microphone in a playtest and the browser refused to load the code that processes its audio. The local server’s policy allowed workers to load from generated URLs, while Chrome treated this audio worklet as a script. The development server rule was fixed, and the smoke test now tries loading that kind of worklet.

The engine can make a battle reproducible once the inputs reach it. Playing with the microphone exposed a failure before the first order. I need both kinds of evidence. The next time a Commander report says an order disappeared, I want to know whether the voice input failed, the client never submitted a command, or the world refused it. Each answer gives me a different place to start.

05

The original game was a reference throughout the port

The first Asgard workload was small enough to qualify carefully. The full campaign then gave the port harder evidence. I could keep the old interface, exercise airfields and research, and compare what happened when a plan outlasted the browser interaction that created it.

The Garage test belongs to that later stage of the work. It showed which facts needed to move into the new simulation along with the visible rules of production. A port earns its place when the same game decisions are available to the player and to a test.

Read the wider account in Carry the rules across first.

Explore the game The Rampart Zero Field Report
Read the history of Asgard Tveir Subscribe to Field Notes via RSS