Flag (or shift + flag) to see flocks form. Adjust the 3 variables to see how they affect flocking. Try to simulate murmuration (collective twisting, turning, swooping, and swirling, seen in starling flocks) Starting from random positions, birds form flocks by aligning, cohering, and separating from neighbors. Best not to use more than 60 birds unless using turbowarp: https://turbowarp.org/646967343
Turbowarp is best: https://turbowarp.org/646967343 The 3 variables correspond to the main rules: align, cohere, and separate. Each of those 3 rules has a weight variable that you can adjust. Setting a vriable to zero turns it off. The main point of the model is that there is no leader, yet flocking patterns emerge from just those three rules, aligning, cohering, separating. Birds only see nearby neighbors, not the whole flock, but the group self-organizes. My variant of Reynolds' "Boids" model. I added flapping, starling animation, simplified code a bit, used vectors, added sliders. It took me too long to make the animated starlings--I made a composite of many photos in Illustrator, moving wings for 5 poses. Sounds include lone starling and flock of starlings. Music: Aviary, from The Carnival of the Animals, by Camille Saint-Saëns. See also my boids of a feather (two separate flocks, and predator-prey flocks).