747 rounds, 146 hits: the same fight, watched or not
Published
We ran the same 60-second battle twice: once on screen, once with the camera sent to another part of space. Both times, 747 rounds were fired and 146 hit. The result is identical to the last round, and an automated test makes sure it stays that way.
No shortcut when nobody is looking
In some space games, a fight nobody is watching is settled by a simpler, cheaper calculation, and players learn to look away to get a better result. Hostile Flagship has one set of rules. An area where you have a ship runs exactly as if you were watching it; only the drawing is skipped.
That means a rule can never ask “is this on screen?”. A ship is never hidden. Only its looks are: the model, the exhaust, the jump glow and the gun mounts all hang under one part that is switched on or off for drawing.
The test
The test sets up a full fight:
- The carrier at geostationary orbit with its four Strikers out, all Mk3.
- Six Mk3 enemy fighters 6 km out, and one wing of 25 swarm drones 7 km out.
- 60 seconds of battle.
It runs twice in two separate processes: once watched, once with the view moved away just after the fight starts. Each run prints a signature: enemies left, fighter rounds fired and hit, point-defence rounds fired and hit, and every one of our ships’ remaining hull. The test passes only if the two signatures match exactly.
It found a bug on the way: a big ship’s hull couldn’t be hit in an area nobody was viewing, because “not drawn” had been treated as “stowed in the hangar”.
Ground that doesn’t change when you look
Near the surface, ships follow the terrain. The ground under an area now comes from that area’s own terrain, the same triangles it is drawn with. Before, areas nobody viewed used a simpler formula that was 7–10 m off on average and up to 40 m. Now the difference is 0.000 m. A Hawkeye sent to Low in an area you aren’t watching settles about 305 m over the ground, as it should; before the fix it stayed at 25,000 m.
30 ticks a second
The simulation runs at a fixed 30 steps a second. The screen still draws at 60 frames a second or more, smoothly placing everything between the last two steps.
Going to 30 Hz exposed a bug. Fighter pilots aimed at a picture of the target one step old, which put their lead point about 17 m behind at 30 Hz. In a Mk3 duel they landed about half their usual fire. Carrying that picture one step forward fixed it: rounds per second in the duel went from 3.9 to 6.2. Then every on-screen marker (brackets, order lines, tracers) was moved to where things are drawn, not where the last step left them, so nothing appears twice.
The rules behind it
A few rules keep the game honest:
- The simulation runs in a fixed tick.
- Every command is an order, recorded as a row of data (see Commanding the fleet).
- Every unit has an owner.
- Randomness that changes an outcome is seeded, so the same fight plays the same way.
- The game uses simulation time, never the wall clock.
- One world, many viewers: what you see never decides what happens.
Multiplayer is planned.