Projects · 06 of 08
Life-sim
An interactive evolution playground. Neural-net swimmers that learn within their own lifetimes, under purely economic selection, with no fitness function. WebGL2.

- Year
- 2026
- Built with
- TypeScript, WebGL2
An evolution playground in a browser tank. Small creatures with neural networks for brains swim, eat, breed, and die, and nothing scores them. A creature that takes in more energy than it spends lives to reproduce, one that does not is gone, and that is all the selection there is. They also learn within their own lifetimes, so a useful reaction can show up in one life and be fixed by selection over the generations that follow.
It is built to be played with. You can reach in while it runs to change any setting, drop food, and follow one creature while you watch its brain fire. The colour of a dot is its diet, from green for a grazer to red for a predator, and the graph beside the tank shows how the population divides between them.
The hard part
Left alone, the tank filled with grazers and stayed that way. I wanted predators, and with no fitness function there is nothing to reward for hunting. The only thing I could change was the world. My first reading was that hunting did not pay, and I spent a while on the economics and wrote down that the size of the world had nothing to do with it. That was wrong.
How I solved it
I measured how far apart the creatures were. In the big, evenly fed world the nearest neighbour was about 75 units away on average, and a bite reaches 16. A predator could not have reached its prey however well hunting paid. So I gathered the food into a few small, deep pockets, which pulls the creatures close enough together for a predator to find a meal and also holds the population to a few thousand. Predators still tended to die out before they got going, so the world now starts with some. One more setting makes life harder for an animal that eats a little of everything, and with it the split between grazers and predators lasts past twenty thousand ticks on every seed I tried. By forty thousand some worlds have kept both kinds and some have lost one, and I have left that as it is.