Physics, autonomous agents, and emergence
Learning objectives
- learner can build object-oriented agents with velocity/acceleration physics and collision detection
- learner can define local rules (boids, Braitenberg, springs, repulsion) that produce emergent global behaviour
- learner can reason about how initial conditions and noise shape the emergent form of a rule-based system
Capstone — one whole task that evidences the objectives
Implement a live agent-based ecosystem — flocking boids or a spring-mass/repulsion network — where OOP agents with physics and collisions self-organise, and demonstrate how changing initial conditions and noise reshapes the emergent form.
Prerequisite modules
This module is where your visuals stop being drawings and start being populations. In a live set, an agent ecosystem is the visual layer that stays alive between your edits: a murmuration drifting over a techno drop, a spring network twitching in time with a bassline. The audience sees an organism, not a loop — and the whole task here is to build one on a Processing/p5 canvas that you can perturb live without it collapsing into either uniformity or chaos.
The arc starts scaffolded: define one agent class (“a class is a template; an instance is one concrete object”), give it the velocity-plus-acceleration update, and get a single body bouncing. Then multiply it into an array and add circle-circle collision — these two frame-loop mechanics are the part-task drills, because during a performance you will retype them from muscle memory. With mechanics in hand, the module shifts to behaviour: Braitenberg’s sensor-to-motor wiring is the minimal template for “agents that seem to want things,” and Reynolds’ three boids rules or the spring/repulsion force pair show how purely local rules self-organise into flocks and readable layouts. The final, unsupported stretch is compositional control: reseeding initial positions and injecting bounded jitter, so you can steer the macro form without touching the rules — exactly what the capstone demands you demonstrate live.
Required atoms are the load-bearing set: OOP structure, physics integration, collision, the emergence concept, each named local-rule family, and the two perturbation principles — the capstone fails without any one of them. Supporting atoms widen the palette: inheritance for specialised agent variants, the multiply-by-100 instinct, and cousins like circle packing, DLA growth, and human-driven agents that suggest where this ecosystem thinking goes next.
Runnable examples
Generated from the context/ instrument corpus by concept (redistributable idioms only). Do not edit — regenerate with gen-module-examples.mjs.
particle-system
let pts = font.textToPoints('P5', 0, 200, 200, {sampleFactor: 0.2})
p5live-0029 · CC0-1.0
physics-sim
let dir = p5.Vector.random2D().mult(random(2, 5))
p5live-0013 · 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 recommended
Unlocks — modules that require this one