Wilden

Photosynthesis and the arithmetic of light

By Robin Dowling · 2 months ago

A while ago I wrote that the simulation had found "an eternal cycle of energy": sessiles feed on the soil, motiles feed on sessiles and each other, and death returns elements to the soil. It was a satisfying story. It was also, it turns out, not quite true.

Every world I ran would eventually die. Sometimes it took thirty hours, sometimes less, but the ending was always the same: a slow rundown to collapse, then a reset. I kept treating this as a tuning problem — nudging the fifteen-odd dials from that earlier post, hoping to catch the balance. It never held. So I finally built a proper measurement tool, a headless probe that runs a seed for hundreds of thousands of ticks and prints a census of the population, and I let it tell me what was actually happening instead of guessing.

A plant

The answer was uncomfortable. The "eternal cycle" wasn't a cycle at all — it was a battery slowly draining. Energy leaks out of the world on every path: organisms burn energy just to stay alive, only half of what a predator eats actually transfers (the rest dissipates), and only a fraction of a corpse returns to the soil. A closed system with that many leaks and no real inflow has exactly one stable state, and it's zero. Everything I'd been tuning was just adjusting the rate of the collapse.

Worse, the one thing keeping the world alive was cheating. Every time an organism reproduced, its offspring was handed a fresh packet of energy conjured from nothing. That was the hidden inflow propping the whole thing up — and because it was free, a population of predators could grow forever with no prey to eat, which is nonsense. A world with no plants should starve.

So I stopped tuning and started fixing the physics.

First, I closed the mint. An offspring's starting energy now comes out of its mother — a real transfer, capped at what she can actually afford, not a gift from the void. Immediately the nonsense stopped: a plant-free world of predators now decays instead of growing, because nothing can reproduce without paying for it out of energy it actually ate. This made every world run down faster — which sounds like a regression, but it was the point. With the fake inflow gone, I could finally see the true shape of the economy: all leaks, no source.

Then I gave the world a sun. Plants now capture a little sunlight each tick — photosynthesis, the thing every real ecosystem is ultimately powered by. I made the light a fixed budget per patch of ground, shared among the plants standing on it, so a crowded patch gives each plant less. That one detail turned out to be quietly important: it means the land has a natural carrying capacity built into the physics, without me imposing an artificial population cap. Finite sunlight over finite ground.

That was the moment the numbers changed. For the first time, across every random seed I threw at it, the world stopped going extinct over a full run. Every joule in the simulation now traces back to the sun, flows up through plants into predators, and returns to the soil on death. A real cycle, at last — not a story I told myself.

It is, I should be honest, not finished. Closing the mint left my predators too frugal to breed, so I loosened their reproductive cost and they recovered. Feeding the plants directly let them run away in dense blooms, so I changed how reproduction responds to hunger — a starving organism now genuinely can't breed, instead of breeding a tiny bit anyway, which used to let a million half-starved plants overrun the world. Each fix reveals the next imbalance. Right now the worlds survive, but they lean lopsided — oceans of plants, a thin scattering of grazers — and I'm still hunting the dial that gives a proper predator–prey balance rather than merely a persistent one.

Since writing the above, I have found the name for what is holding the predators back: the Allee effect. Warder Clyde Allee described it in 1931 — below a critical population density, per-capita growth drops to zero because organisms simply cannot find mates. My motile organisms must be within five position units of a compatible mate to reproduce, and they can only detect mates within one map cell (125 units). On a million-cell map with thirty scattered predators, those encounters almost never happen. The empirical threshold is about sixty motile organisms — above that, mate-finding sustains itself; below it, the population is alive but not reproducing. The solar budget controls how many predators survive the initial post-genesis crash, which determines whether the population lands above or below that threshold. It is the one physically meaningful knob: how much sunlight the world receives determines how much life it can support. I wrote more about this search in the next post.

But it feels different this time. I'm no longer turning dials at random on a system that can only lose. I'm shaping a world that has a source, a flow, and a floor — and asking it to find its own balance on top of that. Which, come to think of it, is the only kind of equilibrium worth finding.