Technique · Geometry

Flocks

Boids drawn as individual arrows and silhouettes: a classic flock with predators, an epidemic spreading through it, a flock following a curve in 3D, and a murmuration.

Flocks is drawn geometry, rebuilt as it changes. Every piece on Synapse Drip is made from a recipe that layers techniques like this one, and you can change any of it in the Studio.

Good to know

  • No boid knows the shape of the flock: Reynolds's insight was that a convincing flock needs no leader and no plan, only each member reacting to the few others nearest to it.
  • Fish schools do the same without sight: a fish senses the movements of its neighbours through the lateral line, a row of pressure sensors along its body, as well as seeing them.
  • Reynolds's flocking method was used in the feature film Batman Returns in 1992, for the swarms of bats and the marching penguins, and in 1998 he received an Academy Scientific and Technical Award for his pioneering work in computer animation.
  • Craig Reynolds made the first boids in 1986 and published them at SIGGRAPH in 1987 in a paper called Flocks, Herds, and Schools: A Distributed Behavioral Model; he took the word from bird-oid object.
  • A real flock avoids a predator by turning away at once: the fear of an attacker outweighs the pull of the flock, so the flock opens round it and closes again behind.

The mathematics

  • Separation pushes a boid away from each neighbour closer than 0.028 with a force that fades to nothing at that distance, alignment adds an acceleration proportional to the difference between its velocity and its neighbours' average, and cohesion one proportional to the offset to their centre; the three are simply added.
  • To find neighbours the flock is sorted into a grid of cells 0.070 wide, so each boid looks only at its own cell and the 26 around it, and gives up after about 44; the work grows with the number of boids, not with its square, which is why 650 boids cost a few milliseconds a frame.
  • Speeds are held between 60 and 130 percent of the set speed so that no boid stops, and the screen wraps round like the board of an old arcade game, a torus, so a boid leaving one edge comes back at the opposite one.

In art

  • A flock is a favourite subject of generative artists because the picture comes from the rules alone: the artist sets the strengths of three impulses and the form of the flock arrives by itself.
  • Murmurations at dusk have been photographed, filmed and painted for centuries; the dark silhouettes against a pale sky here are a nod to those pictures, and a flock drawn as plain arrows on black recalls the first computer animations of birds.

More ways to use it

Related techniques

L-system · Space colonisation · Diffusion-limited aggregation · Flow ribbons · Ridgelines · Curve families · Streamlines · Paint strokes

All 90 techniques