Neuroevolution Sandbox
A NEAT-style artificial-life world — creatures with evolving neural-network brains, no fitness function, evolution you watch in real time.
Project ALife: a population of creatures lives in a 2D world, each driven by its own recurrent neural network. There's no fitness function and no training loop — they eat, move, reproduce, and die, and over generations their genomes and brains mutate (brains can grow new neurons). You watch evolution happen live and can click any creature to inspect the network inside its head. Early and experimental, but a genuinely fun one — GPU-batched with PyTorch and streamed to a PixiJS frontend.
What it is
A NEAT-style artificial-life sandbox. A population of creatures lives in a 2D world, and each one is driven by its own small recurrent neural network. There’s no fitness function and no training loop — creatures simply eat, move, reproduce, and die. Over generations their genomes and brains mutate, and whatever survives is whatever the world happened to select for. You watch it happen in real time, and you can click any creature to see a live graph of the network inside its head.
It’s early and experimental — I’ll come back to that at the end — but it’s fun thing, because nobody scripts the behaviour: it evolves.
Senses in, actions out
Nothing is hand-written. Every tick, a creature perceives its surroundings — nearby food, corpses, other creatures, flocking signals, the time of day, its own energy — and its brain turns that into movement and behaviour. A genome holds its traits (diet, colour, size, and more); the brain does the deciding.
Evolution that grows brains
When a creature reproduces, its offspring’s genome and brain are mutated — and crucially, brains can grow: a mutation can add new hidden neurons, so network topology evolves over time (NEAT-style) rather than staying a fixed shape. That one detail is what makes it feel alive rather than like tuning weights.
A living ecosystem
- Food grows and depletes on a day/night cycle.
- Creatures spend energy to live and to think — bigger brains cost more energy, which quietly pressures brain size.
- Herbivores and carnivores emerge from a single diet gene rather than being defined up front.
- Dead creatures leave corpses that decay and can be eaten.
- Boid-style flocking signals (separation, alignment, cohesion) are fed into each brain, so group behaviour can emerge on its own.
The engineering
The parts I’m happiest with are underneath the visuals:
- GPU-batched simulation. Sensing, feeding, boids, and brain inference are all batched with PyTorch and run on GPU/MPS when available, behind an adaptive scheduler that measures tick times and falls back to CPU when it should.
- Live neural-network inspector. Click a creature and its brain is drawn with Cytoscape.js, nodes lighting up by activation — you’re literally watching an evolved network think.
- Efficient streaming. The world state is packed into binary and streamed to the PixiJS frontend over WebSocket, so large populations still render smoothly, with a pannable/zoomable camera and pause/speed controls.
Honest status
This is a work in progress, and I’d rather say so plainly:
- The interface is currently Russian only — no English translation yet.
- The balance is largely untested, so populations happily boom, collapse, or stagnate depending on your settings.
- Memory and communication between creatures are designed but not yet built.
The roadmap is exactly those gaps — persistent memory so creatures can remember, signalling between them, an English UI, and real balance tuning. For now, a lot of the fun is in finding settings where evolution does something genuinely surprising. Code’s on GitHub.