Simulating natural systems: automata, flow fields, and growth
Learning objectives
- learner can implement cellular automata (Game of Life, Langton's Ant, continuous CA) from local neighbour rules
- learner can build Perlin flow fields and noise fields that steer motion organically
- learner can grow organic structures via diffusion-limited aggregation and circle packing
Capstone — one whole task that evidences the objectives
Build a 'nature of code' simulation suite: a Game-of-Life/Langton's-Ant automaton, a Perlin flow field steering particles, and a growth process (DLA or circle packing), each running as a self-contained live sketch.
Prerequisite modules
Nature simulations are the visual backbone of an audiovisual live set: an automaton pulsing on the beat, a flow field carrying particles through a breakdown, a dendritic growth blooming over a build. This module turns three families of natural-system algorithms into self-contained sketches you can drop into a projection rig and mutate live — where every sketch must keep running while you edit it, so clean state handling matters as much as the rule itself.
The arc starts with the most constrained system: grid automata. Begin from the local-neighbour-rule model and its non-negotiable two-phase update (compute all next states, then apply), instantiate it as Conway’s two survival/birth rules, then loosen it twice — Langton’s Ant swaps the synchronous grid for a single agent writing its memory into the environment, and the continuous-value averaging CA trades discrete states for fluid wave propagation. Next you leave the grid’s lockstep for continuous space: 2D noise traversal (nested loops, per-axis seeds, the typewriter-style row reset) generates smooth fields, noise-driven grid displacement clusters shapes organically, and mapping noise to angles yields the flow field that steers your particles. Finally, growth: DLA’s snap-to-nearest-neighbour accretion and collision-frozen circle packing each build structure no one designed.
The nine required atoms gate the capstone directly — each of its three sketches fails without its rule set, and the noise-traversal mechanics recur in all field work, which is why the two-phase CA update and 2D noise loop are drilled to automaticity. Supporting atoms deepen rather than gate: the random-walk lineage behind DLA, emergence as the unifying idea, organic geometry as the aesthetic frame, plus pointers toward the Nature of Code track and camera-input extensions.
Runnable examples
Generated from the context/ instrument corpus by concept (redistributable idioms only). Do not edit — regenerate with gen-module-examples.mjs.
modulation-warp
osc(4).modulate(src(o0), 0.6).out(o0)
hydra-0022 · CC0-1.0
s0.initP5(); src(s0).modulate(noize(), 0.3).out()
p5live-0038 · CC0-1.0
feedback-trail
osc(4).modulate(src(o0), 0.6).out(o0)
hydra-0022 · CC0-1.0
function draw(){ fill(0, 20); rect(0, 0, width, height); circle(mouseX, mouseY, 40) }
p5live-0003 · CC0-1.0
noise-field
noise(4, 0.1).out()
hydra-0002 · CC0-1.0
float h21(vec2 p){return fract(sin(dot(p,vec2(12.9898,78.233)))*43758.5453);}
glsl-0013 · public-domain
flow-field
let ang = noise(x*0.01, y*0.01) * TWO_PI
p5live-0008 · CC0-1.0
blur-soften
filter(BLUR, 4)
p5live-0073 · CC0-1.0
noise-drift
let x = noise(frameCount*0.002)*width, y = noise(frameCount*0.003)*height
p5live-0007 · CC0-1.0
Atoms in this module
Required — these gate the capstone
Supporting — enrichment, not gating
Part of curricula
- Live Visualist — zero to performing live-coded & generative visuals — Perform the set — live-coded, generative, audio-reactive visuals for an audience optional