Conway's Game of Life is the classic cellular automaton: each cell is dead or alive, and simple rules flip it. Lenia is its continuous cousin. A cell holds a real number (biomass) between 0 and 1, and the rules are smooth differential equations. Grow a single blob of biomass and, without any blueprint, it spontaneously organises into glowing stripes — a Turing pattern.
Below is one Lenia run. It starts as a plain disc of biomass. As it grows, the uniform centre becomes unstable and breaks into alternating stripes — a classic Turing morphogenesis instability, the same maths behind animal coat patterns. Scrub it, or press play.
25 frames, one every 25 iterations, on a 192×192 grid. A single disc starts at iteration 0; by the end it has filled much of the frame with glowing stripes. Biomass is shown with a magma colour ramp that peaks on the pattern band.
X += dt·(GAIN · K∗G(X) − X). The term
−X is a decay; K∗G(X) is growth. G
is a smooth bell curve exp(−((n−μ)/σ)²) of the
local density: growth is a band, strongest at a specific population, dying off for
sparse and crowded cells. That nonlinearity is what makes pattern.K is a Gaussian ring of radius
13 — a convolution. The peak of the growth curve sits at μ=0.27,
σ=0.038: a narrow band. This is the classic Turing regime.powf(x,2) with x*x in the
hot loop tripled the speed (13 s → 4 s on the first test).back to the lab ·
source: ~/src/lenia.c