When the foxes ate themselves: a backwards number we trusted enough to trace
When we added the world’s first predator — a fox — we expected the tricky part to be the rabbits. It wasn’t. The fox does so little that its whole design is a study in restraint: it stands in the world and quietly raises the odds that a nearby rabbit dies, and that’s the hunt.
No chase, no pounce. So we were ready for the prey to behave strangely. We were not ready for a tuning result that said, plainly and repeatedly, that the deadlier we made the hunt, the faster the foxes themselves died off. This is the story of that backwards number — why we trusted it enough to dig, and what we found at the bottom.
How we tune a predator we can’t watch all day
You can’t tune an ecology by staring at one playthrough. A fox’s pressure plays out over a long stretch of in-world time, mostly in corners you aren’t looking at, and we wanted to know how the whole world responds before we commit to numbers. So we tune offline: we re-run the same world over and over while sweeping two knobs against each other — how many foxes there are, and how hard each one bites — and read the population curves that fall out. Because the simulation is built to grow the same world from the same seed every time, those runs are honest experiments and not noise: a difference between two settings is the settings, not luck.
The result we were hunting for was the gentlest pressure that still clearly mattered — foxes thinning the rabbits without crashing them, both species plainly persisting. Most of the sweep behaved. One axis did not.
The number that pointed the wrong way
As we turned the hunting strength up, the foxes’ own survival fell off. Not the rabbits’ — the foxes’. A fiercer predator is supposed to do better, or at worst hold steady while it grinds the prey down. Ours did the opposite: the harder we made it hunt, the quicker it vanished from the world.
This is exactly the kind of signal it’s easy to lose. It arrives buried in a table of numbers, it’s mildly plausible if you squint (“maybe fierce hunting collapses the food supply and starves them?”), and the cheapest thing in the world is to shrug, call it noise, nudge a knob, and re-run until the curve looks nicer. We’ve learned not to do that.
A backwards result isn’t an annoyance to re-roll past. It’s the world telling you something you don’t yet understand — and the fastest way to a wrong build is to stop listening at the first plausible excuse.
So we didn’t reason about why a fierce predator might die off. We went and read the actual path the code takes when a fox exerts pressure, and traced what that pressure touches.
Every fox was standing in its own kill-zone
The cause was almost funny once we saw it. A fox doesn’t target a specific rabbit; it casts a zone of danger around itself, and any creature inside that zone gets a higher chance of dying. The way we’d built it, we gathered up the danger zones of all the foxes, and then we checked every creature in the world against them — to see who was standing in a threat.
Every creature includes the foxes. And a fox is always at distance zero from itself. So each fox sat dead-center in its own danger zone, registering the maximum possible threat — from itself. The foxes weren’t being eaten by anything out there. They were eating themselves. And because the threat scales with how hard hunting bites, cranking the hunting strength up just made each fox a more lethal threat to itself. The deadlier the world’s hunting, the faster every fox killed itself off. The backwards curve was telling the exact truth.

What’s worth dwelling on is how invisible this was to careful reading. Nothing in the code said “fox harms itself.” The harm emerged from a perfectly reasonable-sounding sentence — “apply each fox’s danger to every creature in range” — meeting an unstated fact: a fox is in its own range. You don’t catch that by re-reading the line; you catch it by trusting a measurement that the line’s plain meaning can’t explain.
The fix was a rule, not a patch
The temptation with a bug like this is to special-case it: skip the fox when it checks itself, subtract its own contribution, paper over the zero-distance case. We didn’t want a patch; we wanted a rule that says what’s true. The true thing is simple: danger only flows from predator to prey. A predator is immune to predation — a hunter is not a threat to itself.
That single rule made the whole class of problem go away, and it’s the kind of world-statement we can stand behind rather than a quiet exception buried in the math. We did scope it honestly, though. “Predators are immune” only holds while the fox is the only predator in the world. The day we add a hunter that eats other hunters, this is the very first thing we’ll have to revisit — immune-to-your-own-danger and immune-to-all-predation stop being the same rule the moment a second predator exists. We wrote that caveat down next to the rule so future us can’t forget it was a simplification, not a law.
With the fix in, the sweep behaved the way intuition always said it should: foxes persist, and the rabbit population thins smoothly as the hunting strength rises. The curve stopped pointing backwards because the world stopped being wrong.
Approaches that agreed, and one false alarm at the end
Two quieter beats from this slice are worth keeping, because they’re the same lesson from different angles.
Before any of this, we’d sketched the whole predator feature several competing ways — a do-the-least-possible version, a get-the-reproducibility-airtight version, and a be-most-faithful-to-the-design version — expecting to argue them out and pick one. Instead, the sketches kept converging on the same core shape: predation as a quiet weight on the existing death roll, not a new kill event. We took that convergence, rather than any single argument, as the real signal the shape was right. When you set out from different priorities and keep ending up in the same place, the place is probably correct.
And right at the finish line, a late check threw a scare that looked exactly like a performance regression — two scenes suddenly running slow. By the rule above, an alarming signal earns a real look, not a hand-wave. The real look found the cause immediately: the laptop had dropped into low-power mode and was throttling the work. On normal power the scenes ran fine. It was the same discipline as the fox bug, pointed the other way: investigate the suspicious reading rather than assume it — sometimes the answer is “real bug,” and sometimes it’s “check the environment first.” Either way you find out by looking.
The same instinct caught both: a wrong-way population curve, and a frame-rate dip that was only the wall socket. Suspicious signals get traced. They don’t get explained away.
One thing this whole episode was emphatically not about is whether the predator is balanced. It isn’t, on purpose — a lone hunter only pushes prey numbers down, and the upward force that turns pressure into a living equilibrium is reproduction, which is still ahead of us. We tell that design story separately. This post is only about the moment the world reported something impossible, and we believed it long enough to find out why.



