Skip to content

prototype · artificial-life

Predator and Prey: Tuning a Living Balance

An interactive predator–prey ecology where satiation, ambush-toxic prey, and a death-scent signal produce population oscillations you can retune in real time — and watch collapse the moment you push a slider too far.

  • emergence
  • complex-systems
  • simulation
  • ecology
  • predator-prey
  • agent-based-models

A companion to Digital Bacteria and the note And on the Seventh Day, He Rested. Same idea, different world: set a handful of local rules, then watch a balance appear — or fail — without ever scripting it.

This is an 80×80 ecology. Predators hunt prey; prey reproduce up to a cap. No equations govern the populations; the famous predator–prey oscillation, when it shows up, is emergent from thousands of local decisions. Press Play, then drag any slider and watch the system answer.

Depredador–Presa · Sandbox ecológico

Fase 1: predadores (máx 64) cazan presa que se reproduce a un tope. Una fracción de la presa es tóxica (indistinguible). Tuneá el balance en vivo.
presa comestible
presa tóxica
predador (lleno)
predador (hambriento)
olor de muerte
Live simulation. Drag the sliders to retune the balance. Open full screen ↗

Satiation is what keeps it alive

The single rule that stabilizes everything: a full predator stops hunting. Once its energy passes a satiation threshold it ignores prey it does not need. That is a functional response — and it is the difference between an ecosystem that breathes and one that eats itself to extinction.

Remove it and the dynamic flips. Hungry predators sweep the grid, prey crashes, predators starve, and the whole thing flatlines. The oscillation in the chart is not decoration; it is the system finding the only stable behavior its rules allow.

The prey that fights back

A fraction of the prey is toxic — and indistinguishable. The predator cannot see toxicity. To its senses a poisonous cell looks exactly like food; it only finds out by biting, and a bite can be lethal.

The only honest signal is indirect: when a predator dies from poison, it leaves a death scent on the cells around it. Survivors evolve no taste for poison — they just learn, reflexively, to avoid where death happened. Toggle show toxicity to see what the colony is blind to. It is the same motif as the bacteria world: the dangerous thing and the safe thing emit the same signal, and survival is about reading the context, not the bait.

Toxicity is not free for the prey either: it carries a reproduction cost and its own population cap, so the world holds three coupled populations — predators, edible prey, and poison — each pulling on the others.

Things worth trying

  • Push prey reproduction up. Watch the predators boom on the surplus, then overshoot and crash it.
  • Raise the toxic fraction. The predators thin out as poison becomes a minefield — until the death scent teaches them to route around it.
  • Drop the avoidance reflex to zero. They stop reading the warning and walk into poison. Population by recklessness.
  • Lower satiation’s effect (energy gain very high). Gluttony, then collapse.

It stays a toy. But it makes the lesson tangible: you do not control the populations. You set the conditions — reproduction, metabolism, lethality, the strength of a reflex — and the balance is something the world works out on its own. Once it starts running, the job is to watch.

Experiment

Prototype boundary

Labs are exploratory notes, not production guarantees. Status labels make maturity explicit.

Privacy

Safe publication rule

Labs should describe patterns and tradeoffs without exposing private infrastructure, tokens, identity provider details, or operational logs.

Related work