home/ modules/ physics-agents-and-emergence

Physics, autonomous agents, and emergence

  • 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

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.

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

A class is a template; an instance is one concrete object created from that template
Concept L2 First instrument H
Processing classes bundle related fields and methods into reusable, instantiable objects
Concept L2 First instrument H
Physics simulation models position with velocity plus acceleration, where each value updates the next
Concept L2 First instrument H
Circle-circle collision is detected by comparing center distance to sum of radii
Procedure L3 Craft H
Emergence is complex organized behavior arising from many simple local interactions
Concept L3 Craft H
Realistic flocking simulation requires only three local rules: separation, alignment, cohesion
Principle L3 Craft H
Wiring a sensor to an actuator with a straight or crossed connection produces approach or avoidance behavior
Concept L2 First instrument HL
Braitenberg Vehicles show lifelike behaviour emerging from direct sensor-to-motor coupling
Concept L3 Craft H
Nodes that mutually repel each other self-organise into an even spatial distribution without explicit placement logic
Concept L3 Craft H
Connecting nodes with springs that pull toward a rest length produces force-directed layouts and elastic motion
Concept L3 Craft H
Varying the initial spatial distribution of agents changes the global form that emerges from identical local rules
Principle L3 Craft HL
A small random deviation prevents emergent systems from collapsing into a uniform state
Principle L3 Craft HL
Defining a small set of behavioral rules for elements produces emergent visual complexity through their interactions
Procedure L3 Craft HL

Supporting — enrichment, not gating

Processing class inheritance lets subclasses extend and override their parent's behaviour
Concept L3 Craft H
Multiplying a single generative element by many instances reveals emergent system behavior
Principle L2 First instrument H
Humans acting unconsciously in a system can serve as autonomous generative agents
Concept L4 Performance H
Circle packing fills a region by growing circles until they touch, then freezing each on collision
Concept L3 Craft H
Diffusion-limited aggregation grows organic dendritic clusters by snapping each new particle onto the nearest existing one
Concept L3 Craft H
P5LIVE realizes particle systems with real per-element p5.Vector state, making the concept portable from GLSL-fake to genuinely simulated
Concept L2 First instrument LH