DevLog #10 – A replay is just orders and a seed. Then a soldier takes a step
United States
Breaking News:
Washington DC
Sunday, Nov 29, 2026
Every RTS player knows the replay button. Classic RTS replays aren’t videos. They’re a short list: the map, the settings, a random seed, and every order every player gave, each stamped with the moment it was given. Press play and the game simulates the whole match again from scratch, feeding in the same orders at the same moments. If the simulation is deterministic, you get the same match, battle and all, from a small text file. Our seven-minute test match is 23 KB.
The catch is that one word, deterministic. Byzen’s skirmish replays have been exact since this week. This devlog is about everything between “we have the orders” and “it plays back the same”.

The end of a seven-minute skirmish, rebuilt from 119 orders and a seed. The replay bar (from the game’s Spanish UI) reads 7:00 / 7:00, finished.
In September we audited the code to see whether replays were possible. They weren’t. We found about a hundred calls to Unity’s global random number generator in gameplay code: AI decisions, fire, wildlife, weather, terrain. Every system drew from the same global stream, so one extra roll anywhere shifted every roll after it. And almost all the logic ran in Update() with the frame’s delta time, so the outcome depended on your frame rate.
So the replay design was put on hold behind two foundation pieces.
The AI also had to start playing by the same rules as the player. It used to place buildings and train units by calling functions directly. Now it issues orders like everyone else, so its moves are recorded in the replay too.
“It looks the same” doesn’t count. Once per second of simulated time, every 30 ticks, the game computes a 64-bit FNV-1a hash of the world state. It walks every entity in a fixed order (faction, then id) and feeds in positions rounded to millimetres and hit points rounded to hundredths. The rounding matters: float noise that changes nothing shouldn’t change the hash.
The recording stores that hash series alongside the orders. During playback, each new hash is compared with the recorded one for the same tick. If one differs, the replay tells you right away. It shows the tick and both hashes, and warns that from that point on, what you’re watching isn’t exactly what happened.
One tick, in a fixed order. Rendering happens between ticks and only interpolates.
By 9 November everything above was done, plus a replay player with play, pause and speeds from ×1 to ×8. Every order was applied. The economy matched. A side that stood still matched.
Units that walked ended up about a metre off.
The culprit was Unity’s NavMeshAgent, the component that walks a unit along its path. It’s good at its job, but it moves units every rendered frame, with its own local avoidance between agents, and none of that runs on our tick. A metre doesn’t sound like much. But a metre decides whether a lancer is in range this second or the next, and from there the whole battle goes its own way.
So we replaced the agent as the owner of movement. UnitMotor exposes the same interface the agent did (set a destination, has a path, remaining distance, velocity), so the unit code and the animation code didn’t change. Underneath, everything runs on the tick:
Dropping Unity’s avoidance brought back an old RTS problem. Send twenty men to the same point and they arrive, push each other, and keep pushing forever, lined up against a wall. The rule now is simple: if a unit is within 4 metres of its target and hasn’t got any closer for a second, it has arrived. Then it lets go of its path, so a crowd at rest stays at rest.
Buildings, fences, trees and ore veins used to cut holes in the NavMesh at runtime with Unity’s carving, which also happens outside our tick. Now each one registers as a blocker and the NavMesh is rebaked synchronously, inside the tick, when something changes. That costs about 40 ms per rebake. Felled trees and exhausted veins are batched every 10 seconds, so a woodcutter doesn’t trigger a rebake per tree. When the NavMesh changes, every walking unit asks for its path again, in creation order.
Units weren’t the only thing living on the frame. The clock and weather, surface water and mud, the river, fire, cattle and herds, boars, fish, wildlife, the night watch and the AI’s resource trickle all ran in Update(). Rain that falls a little faster on a fast machine makes a little more mud, and mud slows units down. So all of them moved onto the tick too, through one SimWorld step. Lighting, shaders and footprints stayed on the frame, because they’re presentation.
That move turned up a small bug. Fish and wildlife share a random stream, and both are created in the same frame when a map loads. Unity doesn’t guarantee which of two objects starts first, so whichever went first took the first numbers. Now the world steps in an order sorted by type and by where each thing was spawned, and that order comes from the seed.
Cattle and wildlife now also simulate across the whole map, not only on screen. That was the only way to keep them in step.
With all of that in place, one more difference remained, and it only showed up in the second match of a session. That happens to be exactly where a replay lives: you finish a match, then you watch it.
The cause was one static field. Our round-map code remembers a signature of the deep-water volumes the NavMesh was baked with, so it knows when to rebake. Static fields outlive a match. In the second match of a session, the code compared against the first match’s water, made a different decision, and the NavMesh came out slightly different. Same map, same seed, a different set of walkable triangles. It’s now reset with everything else when a match starts.
It’s the kind of bug determinism work is full of: nothing is random, but something from outside the match’s inputs leaks into the match.
The test: a 420-second skirmish against the AI, with 119 orders and a real fight. Played back, all 420 of 420 hashes match, with no desync and no dropped orders. A 150-second match gives 150 of 150. The whole EditMode test suite passes, apart from one MOBA protocol test that was already failing before this work.
The match was recorded on 10 November. We played the same file again while writing this, three days and several commits later: 420 of 420 hashes, 119 of 119 orders, still no desync.
Replays, from the Skirmish screen. Each match is saved automatically when it ends. These are our test runs on one map: about 7 KB for two and a half minutes, 21–23 KB for seven.
We want to be upfront about this, because it’s more than an invisible engine change: