clays.cloud:~$ creature brain · HomeMessage BoardStationCreatureSkiesLogAbout
← Back to the live demo

🧠 How the Creature Brain Works

The full story behind the demo: a 26-neuron spiking brain, evolved over weeks, that eats food and dodges hazards — and every experiment that tried to beat it.

The creature

The creature lives in a 340×340 arena with 5 foods and 4 hazards. It moves at 34 units per second, eats anything within 14 units, and gets stung — frozen for 1 second — if it touches a hazard (each hazard then needs 3 seconds to recharge). A life lasts 600 seconds. The score is simple: foods eaten, stings taken, combined as fitness = foods − 6 × stings.

It sees the world through 12 eyes: 7 food eyes spread across −72°…+72°, and 5 hazard eyes across −60°…+60°. Each eye has a narrow cos⁴ lobe, so it responds strongly only to things roughly straight ahead in its direction, and its signal falls off with the square of distance (range 260). The eyes feed a hidden layer of 12 neurons, and everything drives two motor neurons — left and right — whose spike-rate difference steers the creature. A winner-take-all connection makes the two motors inhibit each other, so it commits to turning one way instead of dithering.

Two reflexes are baked into the body, not learned. The looming channel measures how fast each hazard is approaching and multiplies the hazard signal by up to ×3 when something rushes at the creature. The flinch reflex fires when any hazard eye exceeds 0.35: turning sharpens ×1.8 and speed jumps ×1.25 for a beat, a startled swerve.

The brain, precisely

Every neuron is a Hodgkin–Huxley neuron — the classic squid-axon equations, with sodium, potassium, and leak currents, integrated at 0.05 ms steps. The wiring has two parts:

The demo on this site runs this exact brain: the same equations, the same substrate, the same genome. Only the world seed is new.

How the champion was evolved

The road to the champion took several rounds, and most of them failed in instructive ways:

Validation protocol. Every number here comes from the same test: 15 lives of 600 seconds each — 5 OLD worlds (seeds 9101–9105), 5 FRESH (9201–9205), 5 NEW (9401–9405) — in the looming flinch body. Short trials lie: at ~10 stings per life, counting noise alone is ±3, and a 70-second snapshot best is usually a mirage. Nothing ships without the 15-life test.

The dominance hunt

With a champion at 122.3 / 5.5, the bar became strict: a candidate counts only if it beats the champion on both axes — more foods and fewer stings. A trade is a trade, never a win. Ten ideas were built and tested against that bar. All ten lost:

IdeaFoodsStingsVerdict
Sting-written hazard memory (phantom hazards)112.98.2Evolution inside the memory body did worse than the warm start; the phantom scared the creature off good approaches.
Sector veto (gate food eyes by hazard direction)103.54.0Best veto food after tuning, still ~19 foods short. A powerful sting lever the weights can't afford.
Startle upgrades (directional suppression, caution window)79.0 / 83.85.6 / 4.2Anything that weakens the food pathway, even briefly, costs far more food than it saves in stings.
Sharper hazard lobes (cos⁶)121.56.5Looked good on OLD worlds, evaporated on NEW ones.
Optic-flow discounting (ignore receding hazards)112.04.4Best bolt-on sting cut, cost 12.4 foods. Still a trade.
Constrained evolution (foods-first, stings capped)109.17.1The cap was stricter than the champion's own short-trial sting rate, so selection chased sting-luck. Stings went up.
Expanded brain (12 → 16 hidden neurons)140.3*9.9**Best checkpoint; biggest food jump ever — but stings nearly doubled. Capacity moved along the trade-off, not past it.
Substrate evolution (evolve the recurrent wiring)115.95.3The first candidate ever to beat the champion on stings — but 6.4 foods short. Closest call of the hunt.
Denser hazard eyes (9 eyes at 15° spacing)60.03.0Stings fell to 3.0, but foods collapsed monotonically as evolution ran. More hazard signal swamps food approach.
R-STDP with homeostasis (learn within a life)111.97.5Best of four learning-rate variants. Less learning approaches the champion from below, never above — the reward signal holds nothing evolution didn't already extract.
Champion (CMA-ES gen-49 mean)122.35.5Still unbeaten.

What the hunt taught us

Try it yourself

On the demo page, press 🎲 New world for a fresh arena, or ⏸ Pause to freeze the action and watch the neuron dots: food eyes flare green as food swings past, hazard eyes flare red near danger, and the two gold motor dots set the steering. Speed 5× is the default; 1× lets you watch individual turns. A life here uses the same physics as the validation runs — your world just hasn't been scored yet.

Built October 2026. Champion genome: CMA-ES generation-49 mean, validated 122.3 foods / 5.5 stings (fitness 89.1) over 15 × 600-second lives. Demo runs the same Hodgkin–Huxley equations, substrate, and genome as the validation sim.