An interactive particle-life simulation. The entire rule set is a matrix of attraction and repulsion values. Eleven emergent patterns have been identified and formally classified. Every structure is found, not designed.
Three things to understand before you open the console.
Every dot in the simulation is a particle. Each particle belongs to a species, shown by its color. There are between 1 and 8 species active at once; with 6 species the matrix has 36 values and the interactions become genuinely complex.
Particles have position and velocity. They carry no other state — no memory, no identity, no communication.
The interaction matrix is the complete rule set. For each pair of species (row = actor, column = target), one number between −1 and +1 governs the force:
+1 = strong attraction. −1 = strong repulsion. 0 = no interaction.
Values in between produce weaker forces. A 6×6 matrix has 36 numbers. That is literally everything.
In the console you can drag any matrix cell up or down to change it in real time, and watch the field respond immediately.
The membranes, chasers, and oscillating structures you will observe are not programmed behaviors. No code produces them directly. They are consequences of the force equations alone.
Press R in the console to draw a new random matrix. Most configurations produce inert noise. Occasionally — unpredictably — one produces something that looks alive.
That hit rate, and the surprise when it lands, is part of what this is demonstrating.
The simulation supports up to 8 species. Each species has one relationship with every other species — including itself. That relationship is a single number: positive means attraction, negative means repulsion, zero means ignore.
With 8 species, there are 8 rows and 8 columns in the matrix. 8 × 8 = 64. That is the complete rule set at maximum complexity — every relationship between every pair of species, written out.
8 is the practical ceiling. Below 3 species the interactions are too sparse for interesting structure. Above 8, the field becomes crowded with competing forces and individual behaviors become hard to distinguish. 8 is the threshold where the full range of emergent patterns — membranes, chasers, vortices, oscillators — can coexist.
The console defaults to 6 species (36 numbers) — the sweet spot for observability. The background simulation on this page uses 5 (25 numbers). 64 is the headline: the maximum complexity the system can hold, expressed as a single integer.
| Species (N) | Matrix cells (N²) | Used in |
|---|---|---|
| 1 | 1 | — |
| 2 | 4 | — |
| 3 | 9 | — |
| 4 | 16 | — |
| 5 | 25 | This page (background) |
| 6 | 36 | Console default |
| 7 | 49 | — |
| 8 | 64 | Maximum · the headline |
64 numbers, each between −1 and +1. That is the entire rule set.
Everything else is consequence.
The particles in this simulation don't replicate. They don't consume energy in a thermodynamic sense or maintain homeostasis. By the standard biological definition — metabolism, homeostasis, growth, response, reproduction, evolution — nothing here is alive.
But watch long enough, and you'll see structures that persist: formations that hold their shape against perturbation, that move with apparent purpose, that respond to their environment without being told to.
The question of whether that resemblance is superficial — or whether life is just a particularly stable configuration of matter following simple local rules — is not a settled question.
The artificial life research community has studied particle life systems and related models seriously since the 1980s. Emergent replicators and primitive metabolisms have been found in related systems. Rudimentary evolution has been observed in systems with replication and selection pressure added on top.
Whether this particular implementation can reach those regimes is genuinely open — and is worth thinking about, not dismissing.
That ambiguity is the point. Every time you press R and watch a membrane form from a random draw of numbers, you're watching the gap between "a rule set" and "purposeful structure" collapse one more time.
Four operations per timestep, executed 60 times per second. This is the entire algorithm. No hidden layers.
The simulation runs in a unit square [0,1)² that wraps at every edge. A particle leaving the right re-enters from the left; leaving the top re-enters from the bottom. A torus: no boundaries, no edge effects, no particle loss.
Each frame, particles are placed into a grid. Each particle then checks only its 3×3 neighborhood — not all N others. Grid cell size equals rMax, so no neighbor within reach is ever missed. This makes computation O(N) rather than O(N²).
For each nearby pair, a force is computed using the curve shown below. The matrix value determines sign and magnitude in the interaction band. Forces sum across all neighbors; each particle is updated by its total.
Velocity is updated with force × timestep, then multiplied by a damping factor (friction < 1) to bleed momentum. Position advances by velocity × timestep and wraps to the torus. This repeats for all N particles.
This diagram shows the force a particle experiences as a function of normalized distance r to a neighbor (r = actual distance ÷ rMax). The curve has two distinct regions:
Repulsive core (r < β): regardless of the matrix value, all particles always push apart. This hard repulsion prevents any two particles from occupying the same space. It scales from −1 at r = 0 to 0 at r = β.
Interaction band (β ≤ r < 1): force is scaled by the matrix value for that species pair. The gold curve shows full attraction (a = +1), reaching its peak at r = (1 + β)/2. The steel curve shows full repulsion (a = −1). Values between −1 and +1 interpolate linearly. Force returns to zero at r = 1 (the edge of reach).
The curve is continuous at both boundaries — no discontinuous jump at r = β or r = 1. This smoothness prevents numerical instability.
The matrix below shows one sample configuration. Read it like a table: the row is the actor species, the column is the target species. A warm (gold) cell means that row species is attracted to that column species. A cool (steel) cell means repulsion.
Asymmetry is the key insight. The matrix is not required to be symmetric — and when it isn't, the dynamics become rich. If species A is attracted to B but B is repelled by A, A chases while B flees. If A loves B, B loves C, and C loves A, you get a three-way rotating pursuit. These asymmetric patterns are the grammar of particle-life behavior.
Most random matrices produce nothing interesting. The rare configurations that produce structure — membranes, chasers, oscillators — are the exceptions, and finding them by pressing R feels like discovery, not configuration.
| A → B | B → A | Result |
|---|---|---|
| attract | attract | Mutual bonding — stable pairs and clusters form |
| attract | repel | Chase dynamics — A pursues B, B flees A; directed motion emerges |
| repel | repel | Mutual avoidance — species separate into distinct territories |
| neutral | attract | One-sided pull — B orbits A while A drifts; satellite behavior |
| A→B+, B→C+, C→A+ (cycle) | Three-way rotating chase — a carousel of pursuit | |
| Strong self-attraction (diagonal) | Each species clusters independently; slow-moving dense clumps | |
↑ Sample matrix for the background simulation. Warm = attract, cool = repel.
Eleven behavioral archetypes have been identified and formally classified in Emergence — four classic and seven newly described. Each has a real-time computational detector. The four below are the most common; the full taxonomy is documented in the Pattern Field Guide.
Thin walls of one species enclosing another — a structure that looks exactly like a biological cell membrane. They form without being designed, hold shape against perturbation, and drift as a coherent unit.
Example: Red is strongly attracted to gold, while gold weakly repels red. Look for a red rim that keeps spacing around a gold interior instead of collapsing into it.
Typically: moderate reach · moderate core · asymmetric attraction
Tight coherent knots that hunt across the field. They dissolve on contact with a target cluster, then reform elsewhere and hunt again. From the outside, they look exactly like predators. They have no memory of prey.
Example: Red strongly self-attracts, red is drawn toward blue, and blue repels red. The red particles compact into a moving knot that repeatedly closes on blue clusters.
Typically: high force · low damping · strong asymmetric rules
Regions that expand and contract rhythmically — that breathe. The periodicity is not set by any clock in the code. It emerges from the force balance between species, a standing wave in configuration space.
Example: Cyan and purple attract each other at similar strength, with enough damping to prevent escape. Watch the mixed cluster tighten, overshoot, loosen, and repeat.
Typically: medium reach · high damping · near-symmetric rules
Rotating structures with a dense core and trailing arms. They absorb nearby clusters and grow. Their rotation isn't programmed — it emerges from the angular momentum of asymmetric force application as the structure forms.
Example: Gold strongly attracts itself and weakly attracts nearby cyan or blue particles. A dense gold core forms first, then loose colored arms begin orbiting around it.
Typically: large reach · low core · strong self-attraction
Each of the following systems produced vastly more complexity than its rule set seemed to allow. Particle life is the latest entrant in a tradition that stretches back to the 1950s.
Jeffrey Ventrella's Clusters is the closest direct ancestor of this simulation. It uses multiple kinds of particles, with each species pair assigned an attraction or repulsion rule. Ventrella emphasizes asymmetry: A can chase B even if B does not equally chase A. That one break from ordinary physical symmetry is what makes pursuit, orbiting, merging, splitting, and ambiguous cell-like entities possible.
Tom Mohr's Particle Life work explicitly credits Clusters as the original idea, then simplifies and formalizes the rule set. Emergence follows that line: species, a force matrix, locality, short-range repulsion, and medium-range attraction/repulsion.
Alan Turing's paper "The Chemical Basis of Morphogenesis" showed mathematically that two chemicals diffusing and reacting with each other — following simple equations — could spontaneously produce the stripe and spot patterns seen in animal coats. Pattern from uniformity: the first formal proof of emergence in biology.
Relevance: the first demonstration that local rules between undifferentiated components can produce global spatial structure. The intellectual ancestor of all systems described here.
Three rules governing a two-dimensional grid of on/off cells. From these rules emerged gliders, oscillators, logic gates, and — after decades of collaborative effort — a universal Turing machine: a system capable of computing anything. The rule set is two sentences. The behavior is unbounded.
Relevance: definitive proof that a system with extremely simple local rules can reach universal computational complexity. Sets the standard for what "emergence" means.
Craig Reynolds showed that flocking can be generated without scripting paths for individual birds. Each boid follows simple local steering rules, and the aggregate motion looks coordinated from above. It was a major bridge between particle systems, animation, and artificial life.
Relevance: establishes a key idea used throughout this project: convincing group behavior can be produced by local interaction rather than global planning.
Christopher Langton's analysis of cellular automata showed that the most complex, lifelike behavior occurs in a narrow band between too-ordered and too-chaotic systems — what he called the "edge of chaos." He proposed that life itself is not a property of matter, but of this critical regime of organization.
Relevance: provides the theoretical framework for understanding why particle life, when interesting, sits at the critical regime — and why most random matrices are not interesting.
Thomas Ray created a digital environment where simple machine-code organisms competed for memory and CPU time. Within hours of running, parasites evolved — organisms that hijacked others' replication machinery. Hyperparasites evolved to exploit parasites. Immunity evolved in response. Ray programmed none of this. He set up conditions where Darwinian evolution was possible, and it happened.
Relevance: demonstrates that genuine, open-ended biological evolution is achievable in a computational substrate given the right ingredients: variation, replication, and selection pressure. The gap this simulation has yet to cross.
Hiroki Sayama proposed an artificial chemistry in which swarm populations act as reactants. Instead of predefined reaction rules, new collective patterns emerge from kinetic interactions between multiple particle-like species, including segregation, movement restriction, and biological-looking structures.
Relevance: closest conceptual neighbor to Clusters from the artificial chemistry side: species-level interaction rules produce higher-level objects that behave like temporary organisms.
Schmickl, Stefanec, and Crailsheim studied a simple particle-motion law that produced self-structuring, self-sustaining, and self-reproducing cell-like patterns. Unlike ordinary particle life, their model explicitly investigates population dynamics of emergent cell-like structures.
Relevance: demonstrates that particle systems can cross from "looks alive" toward actual protocell-like dynamics when motion rules and density conditions support replication-like growth and decay.
Ventrella's Clusters ecosystem explores named presets such as alliances, red menace, mitosis, planets, and stigmergy. Mohr's Particle Life later simplified the rules and documented implementations, making the model easier to reproduce and analyze.
Relevance: this is the direct technical lineage: asymmetrical species-pair forces, local neighborhoods, and a matrix of social relationships between particles.
Bert Wang-Chak Chan's "Lenia" generalizes the Game of Life into continuous space, time, and state — replacing discrete on/off with continuous values, and replacing the update rule with a convolution kernel and a growth function. The result is a zoo of stable, moving "creatures" of astonishing complexity and apparent lifelike behavior, all from a single integral equation.
Relevance: shows that the Game of Life's core insight — emergence from a convolution-like local rule — scales all the way to visually convincing life-like creatures in continuous space. Particle life operates in the same conceptual space.
Recent work by Sayama frames heterogeneous swarm systems as a platform for open-ended evolutionary dynamics: not systems optimized toward one target, but systems that keep generating novel structures, behaviors, and ecological interactions.
Relevance: points to the next step beyond this demo: search spaces where emergent structures are not just observed, but harvested, mutated, recombined, and allowed to keep inventing.
Conway's Game of Life has a rule set you can state in three sentences. From it emerged gliders, oscillators, logic gates, and eventually — after decades of human effort — a universal Turing machine capable of simulating any computation. Three sentences of rules. Infinite computational depth.
"More is different. The ability to reduce everything to simple fundamental laws does not imply the ability to start from those laws and reconstruct the universe."
Particle life belongs to this same tradition. The force curve is simple enough to write on a napkin. The matrix has at most 64 cells. And yet: membranes form that no one designed. Chasers hunt that no one programmed. Oscillations breathe that no one set a period for.
Christopher Langton argued in 1990 [3] that life is not a property of matter but of organization — that what we call alive is not written into carbon or water or ATP, but into the critical regime of interactions, whatever the substrate. His evidence was cellular automata; the argument generalizes. If he's right, the question this simulation poses is not rhetorical.
We are not claiming this simulation contains life. We are claiming that the gap between "a rule set" and "behavior that looks purposeful" is smaller than intuition suggests — and that each time you press R, you run one more experiment into how small that gap might be.
These are not implemented features — they are directions worth exploring. The matrix-based interaction model maps naturally onto problems in science, engineering, and art.
The matrix UI is a natural interface for tuning multi-agent interaction rules before deploying to physical robots. Each cell maps directly to one behavioral policy between robot types.
The hit-rate mechanic — most configs produce nothing, occasionally one produces coordinated motion — mirrors exactly how swarm robotics researchers explore parameter spaces.
Teaching emergence, complex systems, and artificial life. The surprise of pressing R and watching a membrane form from a random draw of numbers is a lesson no textbook can replicate.
The hit rate itself is the lesson: most configurations produce inert noise. That ratio — rare order from abundant randomness — is the central fact of emergence.
Stable configurations recorded as presets, frames exported, the simulation coupled with audio reactivity. The behaviors are genuinely beautiful and non-repeating at human timescales.
The matrix becomes a creative instrument: a single number change shifts the entire aesthetic of the field.
Species = demographic groups. Matrix values = attraction or avoidance between groups. Segregation, flow corridors, and jamming emerge from the interaction rules alone — nothing scripted.
Urban planners and safety engineers use similar agent-based models to study crowd dynamics at transit hubs and evacuation scenarios.
Species = organism types. Matrix = predation, mutualism, competition. Boom-and-bust cycles, stable equilibria, and collapse arise without being scripted — from the matrix alone.
The asymmetry insight (A hunts B even if B ignores A) maps directly onto real predator-prey and competitive exclusion dynamics.
Particle types = molecule classes. Matrix values = binding affinity. Not predictive — but useful for building intuition about how local binding rules produce large-scale molecular structure.
Researchers in drug discovery use similar coarse-grained models to explore configuration space before committing to expensive simulations.
Apply a genetic algorithm that selects matrix configurations where particles form the most persistent structures or exhibit specific behavioral signatures. The randomize-and-observe loop you already have is manual evolution.
Automating the fitness function turns Emergence into a research instrument for hunting rare complex regimes — the same search the alife community has run on cellular automata for decades.
The same physics in a three-dimensional toroidal volume, rendered with WebGL or WebGPU. Membrane formation in 3D produces closed shells that more closely resemble biological vesicles.
Used in computational chemistry visualization and in alife systems where the third dimension enables qualitatively different stable structures that cannot exist in 2D.
No install. No server. No dependencies. Just particles, a matrix, and emergence.
Open EmergenceI've identified eleven pattern archetypes — but the state space of this simulation is vast and mostly unexplored. If you find a behavior that doesn't fit anything named here, something visually extraordinary, or a matrix that produces something I should know about, please reach out. I genuinely want to hear about it.