Each gull reacts to every neighbour inside a perception radius: keep apart, match heading, stay close. Add a lighthouse to steer around, a fishing boat to follow and a raptor to flee, and watch the group behaviour respond.
The science
Boids (Reynolds 1987). Every bird updates its velocity from the neighbours inside a perception radius R: a = amax[ ws Σ(ri-rj)/|rij|² + wa(〈vj〉 - vi)/v0 + wc(〈rj〉 - ri)/Rc ]. Speed then relaxes to v0 and is clamped to 0.55-1.45 v0; positions advance with r += v dt at a fixed step of 1/60 s.
Metric vs topological. Here neighbours are everybody within R (like the original Reynolds model), so the effective neighbour count grows with density. Real starling flocks use about 7 nearest neighbours instead (Ballerini 2008) - switch the button to compare.
Obstacle avoidance. Spheres around the lighthouse and along the cliff face push birds away with an acceleration that grows linearly from 0 at 12 m from the surface to 3 amax at the surface. The check below flies a bird straight at the lighthouse.
Order parameter. φ = |Σ vi/|vi|| / N; random headings give about 0.92/√N.
Honest simplifications. Point masses, no aerodynamics, lift or wind, no vision cone, wing beats are cosmetic, the raptor never catches anyone and the sea is a vertex-animated sum of three sine waves rather than a fluid.
Models. Gull, raptor, sea cliff, lighthouse, rock stacks and fishing boat were modelled in Blender (named parts, baked textures, Draco GLB).