Primordial Part 1 — Emergent Behaviors & Neuroevolution

Abundant food. Simple senses. Short lives. Can evolution build intelligence from nothing but physics and survival?

Scroll to explore

← Primordial Part 1

The Premise

Let evolution design both the body and the brain

No one picks the network architecture. No one writes a loss function. Fifty organisms go into a 2D world with food and physics and nothing else. They have bodies made of springs and masses, brains made of neural networks, and a genome that encodes both. Find food, survive, reproduce. That's it. Everything else (locomotion, foraging, body shape, predation, speciation) has to emerge on its own.

What emerges over 100,000 ticks and 128 generations is a miniature history of life. Species diverge. Ecosystems form. Radiations explode across the population, then consolidation sweeps the board. And at the end, evolution reveals something uncomfortable about its own logic — a result that sets up everything Part 2 is designed to address.

The Body

Spring-mass morphology that evolves

Each organism's body is a graph of point masses connected by springs. The genome encodes node types and edge connections. Nodes come in seven varieties: a core that serves as the center of mass, bone nodes for structural rigidity, muscle anchors that form the endpoints of controllable springs, sensors that detect nearby food and organisms, mouths that eat, fat nodes that store energy, and armor nodes that reduce damage.

Edges are springs governed by Hooke's law. Bone springs are rigid with high stiffness and low damping. Muscle springs have a controllable rest length: the neural network sets a contraction target each tick, and the spring force drives the body toward that configuration. Tendon springs are semi-rigid connectors. The physics runs as Verlet integration with multiple substeps per simulation tick.

Locomotion is discovered, not programmed. An organism with muscles on its sides has to learn to alternate contractions to produce forward movement. Asymmetric bodies produce turning. Bodies with sensors at the front and muscles at the back evolve to chase food. The relationship between morphology and behavior is entirely emergent.

The Brain

Neural networks optimized by survival, not gradients

Each organism has a feedforward neural network. The input layer receives sensory data: distance and type of nearest food and organisms per sensor node, the organism's energy level and age, and proprioceptive feedback from current muscle lengths. A small memory register persists values across ticks, giving organisms a primitive form of short-term memory.

The output layer controls the body. Each muscle gets a contraction target. Two additional outputs signal eating intent and reproductive readiness. The hidden layer size and activation function are encoded in the genome and evolve over generations — organisms can grow or shrink their hidden layer and switch between tanh, relu, and sigmoid activations as mutations test different neural architectures.

There is no backpropagation and no loss function. Weights are inherited from parents with Gaussian noise, and the mutation scale itself is a genome parameter that evolves. Organisms that survive long enough to reproduce pass their weights to offspring. A child is born pre-wired with its parent's learned behaviors plus small random variations. Over 128 generations, the population converges on effective control strategies through pure selection pressure.

The Mechanism

Mutation, speciation, and meta-evolution

Reproduction is energy-gated. An organism must accumulate enough energy (60% of capacity for asexual, 50% for sexual) and survive long enough (100 ticks minimum) before it can split. The offspring inherits a mutated copy of the parent's genome. Body mutations add or remove nodes, change node types, add or remove edges, and perturb node positions. An evolvable symmetry bias makes mirrored mutations more likely, producing bilaterally symmetric creatures.

Brain mutations perturb weights, grow or shrink the hidden layer, and switch activation functions. Larger bodies cost more energy to maintain and more energy to reproduce, creating natural pressure against unbounded growth. Organisms age: metabolic costs rise after 60% of their lifespan, and death comes at 5,000 ticks. This forces generational turnover — even the most successful forager eventually dies, making room for its offspring to test new strategies.

Speciation emerges from a genome distance metric. When a child's genome diverges past a threshold from its parent, it's assigned a new species ID. This enables tracking of evolutionary lineages and prevents incompatible genomes from sexually reproducing.

Mutation rates are themselves genome parameters. An organism with a high body mutation rate produces more varied offspring. Some will be worse, but some might discover advantageous new morphologies. An organism with a low mutation rate produces more consistent offspring, preserving what works. Evolution optimizes its own rate of exploration.

The Ecosystem

Food chains that nobody designed

The environment is a continuous 2D world with toroidal topology (edges wrap). Plant resources spawn over time with a bias toward nutrient-rich areas. When organisms die, their body mass converts to meat resources that decay slowly. Decayed meat produces nutrients that boost local plant growth. This creates a complete energy cycle: sun to plants to herbivores to carnivores to decomposition to nutrients to plants.

Organisms with mouth nodes can eat plants by contact. They can also bite other organisms: mouth-on-body contact deals damage proportional to the number of mouths, reduced by the target's armor nodes. If hunting other organisms is more energy-efficient than foraging for plants, evolution will find that strategy. Carnivory, herbivory, and scavenging are emergent strategies, not programmed categories.

There is no hard population cap. Population self-regulates through energy costs, aging, and finite food supply. Anti-extinction safeguards prevent total ecosystem collapse: plant spawn rate never drops to zero, and if the population crashes below a threshold, random viable organisms immigrate. These mechanisms allow dramatic population dynamics — booms, busts, and the recurring radiation-consolidation cycles that emerge as the simulation's most surprising behavior — without the simulation going permanently dead.

Chapter I

Genesis

The simulation begins with 50 organisms scattered across a landscape. Each has a random neural network and a simple five-node body: a core, a sensor, two muscle anchors, and a mouth. Their brains fire random signals. Muscles twitch without purpose. Most organisms wander aimlessly, burning energy faster than they can find food.

Within 400 ticks, the population crashes from 50 to 10. An anti-extinction floor keeps the simulation alive. A handful of survivors cling to existence: organisms whose random weights happen to produce net movement toward food. These are the founders. Every organism that will ever live descends from them.

This is the simulation's answer to whether intelligence can bootstrap itself from random noise. The answer is yes, but barely. Out of 50 random neural networks, only a few produce behavior that happens to correlate with food-seeking. Everything that follows is refinement of those accidental strategies.

Genesis — First Moments of Life

The founding population. Random neural networks produce uncoordinated movement. Green dots are plant resources. Click an organism to inspect its body plan.

Chapter II

First Divergence

Within hundreds of ticks, mutations accumulate. A child's genome diverges far enough from its parent that the speciation threshold triggers. A new species is born. The first split is modest (the two lineages are nearly identical), but it marks the beginning of a tree that will branch hundreds of times over the next 100,000 ticks.

Some offspring add extra sensor nodes. Others shift muscle positions for better locomotion. Each new species is a slightly different bet on which body plan and which neural wiring will turn food into babies fastest.

First Divergence — Species Begin to Branch

The first speciation event. Colored rings around organisms indicate species identity. Watch for the emergence of distinct body plans.

Chapter III

Collapse

Around tick 3,000, something breaks open. Enough generations have passed that foraging strategies produce reliable food-seeking. The population explodes: 20 to 75 to 231 to 283 in just 3,000 ticks. Speciation events cascade — 36 distinct species at peak diversity. This is the simulation's Cambrian Explosion.

But the bloom overshoots. 283 organisms compete for finite food. Plant spawn rate can't sustain the population. Resources deplete. The population crashes: 283 to 209. Species diversity drops from 36 to 27. The expensive organisms go first: too large, too metabolically costly, too slow. What remains are the leaner, more efficient lineages.

This first crash is driven by resource scarcity rather than inability to function. It's a fundamentally different selection pressure from the founding die-off, and it reshapes the ecosystem in ways that echo for tens of thousands of ticks.

Collapse — The First Resource Crisis

Population crash from resource depletion. Watch species disappear as the ecosystem contracts. Only the most efficient lineages survive.

Chapter IV

Radiation

After the crash, the ecosystem finds a rhythm. Population bounces between 250 and 310 in irregular cycles. A successful mutation spreads, the population swells, resources tighten, the weakest starve, the population contracts. Boom-bust on repeat, each cycle running a few thousand ticks.

Generations stack up fast. Each inherits its parent's neural weights plus small random perturbations, and the mutation rate itself is evolvable. Organisms that have tuned their own rate of change leave more descendants. Too much mutation and offspring are broken. Too little and they can't adapt. Evolution learns how much to mutate.

This is peak diversity. 36 species coexist, each running a slightly different strategy. Some lineages grow larger bodies with more sensors. Others stay small and efficient. The ecosystem is at its richest, and it's about to simplify.

Radiation — Peak Species Diversity

Maximum biodiversity: 36 species coexist with distinct body plans and behaviors. The species roster shows the full ecosystem.

Chapter V

The Innovator's Dilemma

By tick 50,000, one of the most surprising emergent phenomena has become unmistakable: the maximum generation doesn't climb steadily. At tick 45,000, the oldest surviving lineage reaches generation 72. By tick 48,000, it's dropped to 66. A species with 72 generations of evolutionary refinement went extinct, replaced by a younger lineage with fewer iterations but a better fundamental strategy.

This is the biological equivalent of the innovator's dilemma. Incumbents optimized for current conditions lose to disruptors with less refinement but better foundational strategies. The older species may have over-specialized for an environment that shifted, while the younger one stumbled into a superior body plan through a lucky mutation.

The pattern recurs throughout the simulation. Generation count oscillates: 72, 66, 70, 73, 78, 81, 85, 88, 87, 85, 86, 87. Each dip marks an extinction event where a deep lineage dies and a shallower one takes its place. Evolutionary "success" measured by generational depth doesn't guarantee survival.

Generational Shift — Old Lineages Fall

Midpoint of the simulation. Watch for species turnover as younger lineages displace older, more refined ones.

Chapter VI

Balance

By tick 80,000, the ecosystem has found something that isn't quite stability but isn't chaos either. Population oscillates 255–305. Species swing between 17 and 35. The generation counter climbs from 106 toward 128. A bounded loop through the space of possible ecosystems, traced over and over.

Three full radiation-consolidation cycles complete during the run. Diverse phases (20–30 species) alternate with consolidated ones (9–15) in a rhythm nobody programmed. Mutation creates diversity. Competition destroys it. Resources modulate the pace. The result is an oscillation that looks, from a distance, like breathing.

Senescence keeps the gears turning. Metabolic costs rise after 60% of max age, and death comes at 5,000 ticks. Even the best forager eventually dies, making room for its mutated offspring to try something different. 128 generations in 100,000 ticks.

Equilibrium — Dynamic Stability

The ecosystem at carrying capacity. Organisms with neural networks refined across 110+ generations compete for finite resources. Population oscillates but the system is stable.

Chapter VII

Second Radiation

Between ticks 65,000 and 70,000, species diversity plummets to 9 — the absolute lowest in the entire simulation. A few hyper-efficient lineages crowd out everything else. This is competitive exclusion taken to its logical extreme: the fittest organisms don't create the richest ecosystems. They simplify them.

But from this bottleneck, diversity rebounds. By tick 76,000, species count jumps back to 26. By tick 94,000, it reaches 27 again. The consolidation removed the old guard of species, creating ecological vacancies that new variants rush to fill. This is the third adaptive radiation cycle, and by now the pattern is unmistakable: consolidation, bottleneck, radiation, consolidation.

Second Radiation — Diversity Rebounds

A new wave of speciation fills niches vacated by the consolidation bottleneck. New body plans and neural architectures continue to emerge.

Chapter VIII

Deep Time

At tick 100,000, the simulation ends — but the ecosystem doesn't. 282 organisms across 22 species are alive, their neural networks refined across 128 generations of pure evolutionary search. A diversity spike to 35 species at tick 99,000, just before the end, confirms the system remains fundamentally creative. New species are still being born, new body plans still being tested.

Generation 100 was reached at tick 75,000 — a symbolic milestone. One hundred generations of neural networks optimized purely through survival pressure. No human ever looked at these networks. No gradient was ever computed. These are optimization products of a process that discovered food-seeking, locomotion, and competitive strategy from random noise.

100,000 ticks wasn't enough to exhaust the evolutionary potential of this simple system. Given more time, what would emerge?

Deep Time — Generation 128

The final moments. Organisms with neural networks refined across 128 generations navigate a world their ancestors could barely survive in. These are the products of pure evolutionary search.

The Data

What evolution actually discovered

The story above sounds like progress: radiation cycles, species turnover, deepening generations. But the data tells a different story. Evolution didn't build complexity. It destroyed it. The organisms at generation 128 are simpler than their ancestors. Not refined. Stripped.

Ecosystem Timeline — Population and Species

Population (green, left axis) oscillates 250–310 in boom-bust cycles. Species count (gold, right axis) swings between 9 and 36. Hover for exact values at any tick.

The founding organisms each have five nodes: a core, a sensor, two muscle anchors, and a mouth. By generation 128, 95% of organisms have exactly three nodes: a core and two mouths. Sensors went completely extinct. Muscle anchors nearly disappeared. Bones, fat, and armor never gained a foothold. Evolution didn't build more complex bodies. It stripped them down to the minimum viable configuration.

Body Composition — Node Types Over Time

Total node count across all organisms, broken down by type. Watch sensors (blue) and muscles (red) disappear as mouths (yellow) dominate. The population converged on a 3-node minimalist design.

The economics are straightforward. Every node costs energy per tick. A sensor gives the brain three inputs (food distance, organism distance, organism type), but the brain can find food through brownian motion and mouth contact alone. The sensor doesn't pay for itself. More nodes means more energy burned, which means dying sooner, which means fewer offspring. Evolution does the math.

The mouth makes it worse. One neural output controls both eating and attacking. An organism can't eat without biting anything it touches. So pure mouth-bodies are the optimal design: eat efficiently, damage competitors by accident, keep metabolic costs as low as physically possible. Evolution found the answer. It just wasn't the answer anyone wanted.

Species Dynamics — The Rise and Fall of Lineages

Each band represents a species. Width shows population size. Watch lineages emerge, dominate briefly, then go extinct as new variants replace them. Despite high species turnover, all lineages converge on the same minimal body plan.

The radiation-consolidation cycles are real, but look closer: they're cycling between variants of the same body. Species differ in neural weights, not morphology. The tree branches hundreds of times and every branch leads to the same destination. Three nodes. Two mouths. No sensors.

The lesson is blunt. Give evolution a world where food is abundant, lifespans are short, and bigger bodies cost more without doing more — and it will discover that the best body is the smallest one. The simulation didn't fail. It answered the question honestly. The wrong answer just means we asked the wrong question.

100k
Simulation Ticks
128
Generations
4,345
Evolutionary Events
0
Loss Functions

What's Next

Part 2: Fixing the Rules

Evolution answered the question honestly: when food is everywhere and bodies are cheap, the best strategy is the simplest one. Three nodes. Two mouths. No sensors. The problem wasn't the algorithm. It was the environment. Nothing in these rules rewarded growing larger, seeing farther, or developing complex morphology.

Part 2 changes seven things. Cut the food supply in half. Triple the lifespan. Make sensors worth their metabolic cost. Separate eating from attacking. Give bodies a mechanical reason to grow. Add sexual reproduction. Then run it three times longer and see what evolution builds when the rules actually reward complexity.

300,000 ticks. 457 generations. Mass extinctions, fragile recoveries, and organisms that never stop adapting.

← Overview Primordial: Neuroevolution
Next → Part 2: Fixing the Rules

Tech Stack

Python NumPy Neuroevolution Spring-Mass Physics Spatial Hashing D3.js Canvas API
View Source → ← All Projects