DEV Community

Cover image for I built an artificial life simulation where nothing is scripted - predators had to evolve
Dominik Vytisk
Dominik Vytisk

Posted on

I built an artificial life simulation where nothing is scripted - predators had to evolve

Organisms get a genome, an energy budget, senses and a small recurrent neural net. That’s it - no if (predator) flee, no herbivore/carnivore classes, no flocking rule. Foraging, predation and scavenging have to pay for themselves in energy or they don’t happen.

The part I didn’t expect: the eight communication channels start with no meaning assigned, and the sim measures what they end up correlating with. In long runs, the strongest channel hits r ≈ 0.4 against the context it’s emitted in. Hundreds of learned-behaviour lineages also outlive the organism that originated them.

Runs in the browser, with WebGPU and a Canvas2D fallback. What would you throw at it to break it?

Github Repo

Top comments (0)