The herd that kept coming back: switching on the far country, and the fix that let it rest

← All field notes

The Long Watch simulates its wildlife at three levels of detail; the deepest keeps a whole herd, far off-screen, as a single number rather than as animals. We built that layer piece by piece and left it switched off — and the first time we ran it for real, a herd kept coming back, rebuilt from scratch every update, piling up without end. Here is the bug, and the fix that let it rest.

The far country

Near the camera, every creature is its own animal, fully simulated — a few hundred at once, the ones you can see and follow. Just beyond, a cheap buffer keeps them as lightweight individuals so they slip back into full detail without a seam. And deep off-screen, past the last place anyone is watching, a whole population is advanced as one aggregate: a herd tracked as a number and a rough summary of what it was like, rather than a crowd of separate bodies. Deciding what to run in full and what to abstract is a balance we’d struck long before this.

That deepest rung is its own long story — how a herd folds into a count when you look away and rebuilds when you return, and how the far world keeps living as populations while no one watches. This post is about none of it working, the first time we tried to switch it on.

One rule matters for what follows. The line between “tracked as individuals” and “tracked as a number” is not the camera. It is a point that drifts across the world on a patrol set by the seed and the elapsed clock — never by where you happen to be looking — because what the world remembers off-screen must not change with the camera. Regions cross that boundary and come back as the point wanders. That drift is what finally lets the deepest tier run at all — and it is also what set the trap.

An aerial golden-hour view of a voxel valley; a herd grazes near the distant horizon and blurs into haze at the far edge.Concept art · pre‑alpha
Out past the last watcher, animals soften into a single far-off count.

The first time it ran for real

The part of the system that decides which populations exist was range-blind. Every update step it did the same three things: re-seed a fresh population for every eligible patch of world, materialize a batch of live animals for each patch currently in range, then delete the population’s record. On its own, each step looked reasonable. Run in a loop, it was a disaster.

The animals it had just spawned were now sitting inside the individual-tracked zone — so they were never folded back into a number. The next step re-seeded the same patch and spawned another batch on top of the first. For a patch that stayed in range near the boundary — exactly where the drifting line sweeps back and forth as the view pans — animals piled up with nothing to stop them. The same herd re-materialized every moment.

The herd came back every single update — and every copy it left behind stayed.

We measured it the first time the real loop ran. In a light scene the off-screen population climbed by about twenty creatures every step; in a heavier one, close to a hundred a step — both rising without bound, forever. No amount of tuning touched it. It wasn’t a balance we’d set wrong; it was a herd being torn down and rebuilt on top of itself, over and over.

Why every check stayed green

The uncomfortable part is that nothing failed. Our reproducibility checks — the ones that catch the world quietly growing a different forest from the same seed — all passed, because none of them actually built the off-screen layer. They exercise the near-field simulation directly, where the bug simply isn’t. The duplication only appeared when we drove the whole cycle over and over with the boundary point moving: when we ran the world for real. A diagnostic that did exactly that watched the population accumulate on every step, plain as day.


Materialize once, then park

The fix gives each population a two-state memory. When a region first comes into range, its herd materializes once — and then parks. It stays on record and is not rebuilt; while it is parked and in range, the step that used to re-seed it simply skips it. Nothing is torn down. Nothing is duplicated. The herd is there, made of real animals, and left alone.

A herd should form once and hold still — not be rebuilt every moment you keep watching.

The other half is un-parking. When the boundary drifts back out past a parked region, its now-distant animals are folded into the single-number aggregate by the ordinary collapse path — no death, no bodies, they simply become a count again — and that count snaps back to the carrying capacity the patch’s seed says it should hold. Return later and the herd re-materializes fresh from that number. Form once, hold, fold back, reform: the round trip the deepest tier was always meant to do, instead of a herd rebuilt on the spot every update.

The subtle half: save and reload

Then there is quitting and reopening. On reload, the game has to know which populations were parked — which herds are standing as real animals and which are still just numbers. The tempting shortcut is to read it off the live animals in the saved world. We deliberately don’t. Which regions were materialized is reconstructed purely from where the seeded boundary point sat at the last update — never from the loaded animals.

The reason is the same principle the whole tier rests on. Reading the live animals would let what the world persists depend on where the camera had been before you saved — two players on the same seed could reopen to different herds simply because they’d looked at different corners. Deriving it from the seed anchor keeps the saved world camera-independent, exactly as intended — the same discipline we chased across every front when we made the saved far world derive from the seed and the land alone. Storing a herd that has genuinely drifted while unwatched is its own separate story.

An aerial golden-hour view of a herd resting together in a calm, distant voxel meadow.Concept art · pre‑alpha
After the fix, a far herd forms once and holds, no longer rebuilt every moment.

What it settled to

With the fix in, the runaway flattened. The light scene that had been gaining twenty creatures a step settled to roughly a third of a creature a step — a slow drift toward equilibrium, not a climb. The heavier scene that had been gaining a hundred a step settled to net-zero, even a touch negative. The number stopped being a pile-up and started being a population: growing, leveling, holding.

The layer itself is still switched off in the shipped game. This fix doesn’t turn it on — it makes it correct, so that when we do, a far herd forms once and rests instead of respawning without end. On the world sizes people play today, the near and distant tiers already cover the whole map; there is no deep off-screen yet to abstract. The far country is built, persistent, and waiting for the worlds big enough to need it — a herd that has, at last, stopped coming back.

Keep reading

Concept art · pre‑alpha