TypeScriptRustNeural NetworksCanvas 2DViteegui / eframeArtificial LifeDockerNginxGitLab CI/CD
The Game of Life
An evolutionary neural-network ecosystem you can watch and steer in real time. Every creature carries its own 13 → 8 → 5 brain, and behaviour improves across generations through survival and reproduction alone, no training, no backpropagation. Runs fully in the browser, and as a native Rust desktop app.
Screen recording of the live application
The Game of Life is an interactive artificial-life laboratory: a living habitat where you set the pressure and the creatures evolve their own answers to it.
Every creature owns a small feed-forward neural network with a fixed 13 → 8 → 5 topology. Thirteen inputs give it relative direction and proximity to the nearest food, a possible mate, and the nearest barrier, plus its own energy, age, speed, and a noise channel. Eight hidden tanh neurons sit in the middle. Five outputs drive behaviour: turn left, turn right, thrust, rest, and brake. That is the creature's entire mind, there is no training loop, no fitness gradient, and no backpropagation anywhere in the system. Selection is the only teacher: creatures whose random weights happen to find food and partners leave more descendants, and their weights spread.
Reproduction is deliberately expensive. Two creatures must both be old enough, have eaten enough, hold enough energy, be off cooldown, be under the mating age limit, and physically meet in the habitat. Each parent pays an energy cost. For every weight and bias in the child's brain, the simulation independently picks the value from one parent or the other, and the inherited value may then mutate according to a live mutation-rate control. Colour is inherited the same way, offspring blend their parents' hues along the shortest circular path. So lineages stay visually traceable across generations.
Nothing is a black box. Select any creature and its live neural field is drawn beside the habitat: teal links are excitatory, orange links inhibitory, line weight encodes magnitude, and node colour tracks the neuron's signed activation at that instant. You can follow the top-scoring creature automatically, open a generation champion from the ledger, and walk one step back up the lineage to each direct parent's brain.
Evolution runs inside data-driven scenarios, each with its own map, resource pattern, and three observable survival goals: Living laboratory (shifting mazes and hard-to-reach food clusters), Corner harvest (energy pushed to the four distant corners), The great divide (a permanent wall with a single narrow passage and a 70/30 food split), and The oasis (most food inside a gated central refuge). The goals are milestones for the observer, creatures never receive them as inputs.
The world is yours to shape while it runs. Mutation rate, food growth, world harshness, lifespan curves, reproduction thresholds, feeding cutoffs, barrier behaviour, and population limits all apply to the live engine immediately; only starting population and starting food require a restart. Playback runs from ½× to 16×, with a CPU workload guard that lowers simulated-time speed before heavy populations can monopolise the main thread.
Simulations persist and travel. The full world scenario, every creature and its exact brain weights, food, barriers, history, statistics, and settings autosaves locally every minute and on tab hide, using a versioned compact codec with deduplicated ancestry profiles, binary brain blocks, and gzip compression. You can rename, branch, and resume saves, or export a .gol.gz file and hand it to someone else to continue; sharing is file-based, and nothing is ever uploaded.
The project ships on two runtimes from one design. The web build is a dependency-light, client-only TypeScript and Vite application rendering to Canvas 2D, with no framework, no backend, and no database. The native build is a Rust desktop application on eframe/egui with GPU-backed rendering, integrated window controls in a draggable toolbar, and its own save flow, it runs on Linux, Windows, and macOS. A buildable, source-only ZIP is regenerated from an explicit allowlist on every production build, so anyone can compile and run the desktop version themselves.
Engineering-wise it is built as a strict-TypeScript system with a deterministic test suite covering neural inference and inheritance, the world engine, collisions, snapshots, save validation and compression, storage fallbacks, the Canvas renderers, and the settings layer, plus a Playwright pass against the production bundle. It deploys as a static bundle behind nginx in Docker via GitLab CI.