# data[].attributes.headline
An illustration of the alignment principle

# data[].attributes.subject
An illustration of the alignment principle

# data[].attributes.body
Eventually if we wait long enough, all the boids will have the same velocity (meaning direction and speed)

# data[].attributes.headline
An illustration of the cohesion principle

# data[].attributes.subject
An illustration of the cohesion principle

# data[].attributes.body
Eventually if we wait long enough, all the boids would form one group and would stop moving

# data[].attributes.headline
An illustration of the seperation principle

# data[].attributes.subject
An illustration of the seperation principle

# data[].attributes.body
All the boids stay seperated from each others

# data[].attributes.body
Yet to come

# data[].attributes.headline
Adding a leader boid with a random trajectory (the blue dot)

# data[].attributes.subject
Adding a leader boid with a random trajectory (the blue dot)

# data[].attributes.headline
A simulation I made with the explained principles 

# data[].attributes.subject
A simulation I made with the explained principles 

# data[].attributes.body
There are so many things you can play with to give various comportements to your flock !

For instance :

maximum cohesion force

maximum speration force

maximum alignment force

maximum speed

**Warnings**
One would say that python isn't the most convenient language to do such animations because it is pretty slow and "live animations" are not smooth. He would be right. Even if the code could be improve using numba or by refactoring it (Some may have noticed that we don't have to check all the boids of the block for each boid, which is pretty long to do, but we can limit ourselve to check only the neighbours of each boid... I didn't do that here) python isn't the ideal language. But matplotlib was fine to edit the animations and I had it installed on my laptop so I used it + I wanted to practice python.

# data[].attributes.body
I wanted to add some features to the algortihm I wrote so by surfing on the internet, I found many things I could add to my simulation. I choosed 2 things :

I added obstacles that the boids would have to avoid

I added the possibility to have a "leader boid" which would be followed by all the other boids

You could add many other things such as the fact that birds don't see at 360° around them so you might want to implement that etc... or you could argue that birds have different masses than 1kg and implement that and see the effects etc..

# data[].attributes.body
I put here all the links I've read to write this padlet AND code the simulation you can see on the videos :

https://imagecomputing.net/damien.rohmer/publications/2002_2006_student_work/2004_boids/rapport/boids_3eti_rohmer.pdf

https://www.youtube.com/watch?v=mhjuuHl6qHM

https://www.red3d.com/cwr/boids/

https://www.youtube.com/watch?v=4LWmRuB-uNU

https://eater.net/boids

https://medium.com/better-programming/boids-simulating-birds-flock-behavior-in-python-9fff99375118

# data[].attributes.body
Newton's law :
m \times a = F_{alignment} + F_{cohesion} + F_{seperation}
But we consider we live in a world where the mass of everything is 1kg so :
m=1kg
Then we will discretize time and get the velocity (considering a time step equal to 1 sec) :
\frac{v_i - v_{i-1}}{\Delta t} = a_i = F_{alignment} + F_{cohesion} + F_{seperation} \Rightarrow v_i = v_{i-1} + F_{alignment} + F_{cohesion} + F_{seperation}
And identically we can have the position of our boids :
\frac{p_i - p_{i-1}}{\Delta t} = v_i \Rightarrow p_i = p_{i-1} + v_i
One will see that this physics equations are pretty easy to write in any programming language.  All we have to do is to write these equations for each boid. The real difficulty is to write the expressions of the forces.

# data[].attributes.body
"steer to avoid crowding local flockmates"

Last but not least, we don't want our boid to collapse with his nieghbours. One way to do that is to consider that our boid will steer away from its neighbours in such a way that the steering force is inversly proportional to the distance between them.

If you think about it that makes sens : if a flockmate is far the starling won't really have to avoid him but if it is close enough, it will pay attention to avoid it.

Once again you can think of that as a "repulsive steering seperation force" which will merely add up with the two previous forces we wrote !

So there we are ! All we have to do now is to apply this principles to all the boids at the same time which is pretty easy to do in any programming language !

# data[].attributes.body
When birds, especially starlings, flock together, we call that phenomenom murmuration. When it occures, thousands of birds fly together, forming various random patterns. It is pretty impressive. During their flight, birds seem connected with each others. You can find out more by watching this pretty cool video by Smarter Every Day :

# data[].attributes.attachment_link.title
How Flocking Birds Make Amazing Murmurations (Boids Algorithm) - Smarter Every Day 234

# data[].attributes.body
Actually, scientists found out that starling flocks have more in common with physics than with biology ! At least you can easily model a murmuration using physical principles.

Let's take an example with only two starlings :  it's easy to understand that assuming they are going to the same place, when one turns the other knows when to turn since they can see each other. They will adjust their speed to stay together. If they are to close, they will move away a little bit etc... You can think of it as two particles attracted to each others but which can't get to close.

The magic of murmuration is that it doesn't occure with two or ten birds but with thousands of them.

# data[].attributes.body
So how can we model thousands of starlings each connected with the others ? Well Craig Reynold found a way to do it. Here I will describe the most simple way to do it and present a mere implementation of this algorithm using python. Then I will present you various way to improve the algorithm.

First things first, you have to know that the following principles can be apply to birds or fishes or insects or other living creatures, that's why we will refere to them as boids.

I will use the link down below to explain the algorithm. It the original website Craig Reynold used to present his work.

# data[].attributes.attachment_link.readable_text
In 1986 I made a computer model of coordinated animal motion such as bird flocks and fish schools. It was based on three dimensional computational geometry of the sort normally used in computer animation or computer aided design. I called the generic simulated flocking creatures boids. The basic flocking model consists of three simple steering behaviors which describe how an individual boid maneuvers based on the positions and velocities its nearby flockmates:

Separation: steer to avoid crowding local flockmates

Alignment: steer towards the average heading of local flockmates

Cohesion: steer to move toward the average position of local flockmates

Each boid has direct access to the whole scene's geometric description, but flocking requires that it reacts only to flockmates within a certain small neighborhood around itself. The neighborhood is characterized by a distance (measured from the center of the boid) and an angle, measured from the boid's direction of flight. Flockmates outside this local neighborhood are ignored. The neighborhood could be considered a model of limited perception (as by fish in murky water) but it is probably more correct to think of it as defining the region in which flockmates influence a boids steering.

a boid's neighborhood

A slightly more elaborate behavioral model was used in the early experiments. It included predictive obstacle avoidance and goal seeking. Obstacle avoidance allowed the boids to fly through simulated environments while dodging static objects. For applications in computer animation, a low priority goal seeking behavior caused the flock to follow a scripted path.

In cooperation with many coworkers at the Symbolics Graphics Division and Whitney / Demos Productions, we made an animated short featuring the boids model called Stanley and Stella in: Breaking the Ice. This film was first shown at the Electronic Theater at SIGGRAPH '87. There was a technical paper on boids published at the same conference. In the course notes for SIGGRAPH '88 there was an informal paper about obstacle avoidance.

Since 1987 there have been many other applications of the boids model in the realm of behavioral animation. The 1992 Tim Burton film Batman Returns was the first. It contained computer simulated bat swarms and penguin flocks which were created with modified versions of the original boids software developed at Symbolics. Andy Kopra (then at VIFX, which later merged with Rhythm & Hues) produced realistic imagery of bat swarms. Andrea Losch (then at Boss Films) and Paul Ashdown created animation of an "army" of penguins marching through the streets of Gotham City.

As luck would have it, Chris Langton organized the original ground-breaking Artificial Life Workshop a few months after the boids paper was published in 1987. A helpful go-between got word to Chris and he let me give an informal presentation on boids at the Workshop. The boids model has become an oft-cited example of principles of Artificial Life. Flocking is a particularly evocative example of emergence: where complex global behavior can arise from the interaction of simple local rules.

In the boids model (and related systems like the multi-agent steering behavior demos) interaction between simple behaviors of individuals produce complex yet organized group behavior. The component behaviors are inherently nonlinear, so mixing them gives the emergent group dynamics a chaotic aspect. At the same time, the negative feedback provided by the behavioral controllers tends to keep the group dynamics ordered. The result is life-like group behavior.

A significant property of life-like behavior is unpredictability over moderate time scales. For example at one moment, the boids in the applet above might be flying primarily from left to right. It would be all but impossible to predict which direction they will be moving (say) five minutes later. At very short time scales the motion is quite predictable: one second from now a boid will be traveling in approximately the same direction. This property is unique to complex systems and contrasts with both chaotic behavior (which has neither short nor long term predictability) and ordered ( static or periodic) behavior. This fits with Langton's 1990 observation that life-like phenomena exist poised at the edge of chaos.

The boids model is an example of an individual-based model, a class of simulation used to capture the global behavior of a large number of interacting autonomous agents. Individual-based models are being used in biology, ecology, economics and other fields of study.

Note that the straightforward implementation of the boids algorithm has an asymptotic complexity of O(n²). Each boid needs to consider each other boid, if only to determine if it is not a nearby flockmate. However it is possible to reduce this cost down to nearly O(n) by the use of a suitable spatial data structure which allows the boids to be kept sorted by their location. Finding the nearby flockmates of a given boid then requires examining only the portion of the flock which is within the general vicinity. Using such algorithmic speed-ups and modern fast hardware, large flocks can be simulated in real time, allowing for interactive applications.[new]

Online resources related to boids

Other computational models of group motion

Computer animation

Eurythmy by Susan Amkraut and Michael Girard contained the first procedural animation of flocks when it was shown at the Film & Video Show of SIGGRAPH '85. It is available on SIGGRAPH Video review (SVR Issue 21, Entry 2). Some imagery from the final version appear on this page fromArs Electronica 89. Amkraut and Girard also created flocking and herding in the 1993 VR production Menagerie.

Jessica Hodgins and colleagues at Georgia Tech's GVU have created several physically-based models of group behaviors such as herding one-legged hoppers and a pack of bicyclists.

Disney's The Lion King (1994) included a wildebeest stampede by Kiran Joshi, MJ Turner,et al.. Here are two stampede-related items from Brian Tiemann's excellentThe Lion King WWW Archive:

Xiaoyuan Tu implemented a realistic, physically-based model of fish schooling as part of her dissertation research on artificial animals. See also:

Course CS206 at George Washington University includes an assignment to implement aBehavioral Motion Control System like boids. You can see some of the student's animations from: 1997, 1998 and 1999.[new]

Games, Interactive graphics and virtual reality

Rip-Off (1980) a video arcade game designed byTim Skelly featured a group of three autonomous "enemy tanks" which exhibited coordinated group motion. They avoided collisions with each other and would seek the goal objects ("canisters"), or if they got too close, the player controlled vehicles. The combination of goal seeking and collision avoidance produced a motion like flocking. For more details, read Tim Skelly's owndescription of the behavior. See also this Rip-Offscreenshot and this page about an emulator. [new]

Plasm: A Fish Sample (1985) by PeterBroadwell , Rob Myers, Robin Schaufler,Eva Manolis, et al., premiered at the SIGGRAPH 85 art show. On at least one occasion, a school accidentally arose in this "virtual fish tank".

The Virtual Fishtank introduces visitors to the sciences of complexity, artificial life and related fields. It is an online version of a project that started as aninstallation atThe Computer Museum in Boston. Its goal is to introduce visitors to the sciences of complexity and artificial life. The original project was jointly developed by theMIT Media Lab (see their project page) and NearLife Inc. (see theirrecent projects page).

Virtual Great Barrier Reef: A theoretical approach towards an evolving, interactive VR environment using a distributed DOME and CAVE System (1998) byScot Thrane Refsland,Takeo Ojika, Tom Defanti, Andy Johnson, Jason Leigh, Carl Loeffler, and Xiaoyuan Tu in Proceedings of Virtual Worlds '98. Paris, France, July 1-3, 1998. Also available in PDF.

Robotics

Maja Mataric headsThe Interaction Lab at the University of Southern California which studies robotic group behaviors. See also Maja's dissertation and these videos of robots performing various group behaviors, including flocking.(Some press clippings from WIRED and CNN. And see this delightful story about Maja (the second paragraph))

Cooperative Mobile Robotics: Antecedents and Directions by Y. Uny Cao, Alex S. Fukunaga, and Andrew B. Kahng (UCLA 1996) surveys research in robot groups.

The Robot Sheepdog Project by Richard Vaughan et al. provides an interesting contrast to much of the work cited on this page: the flocking/herding involved is of natural animals while a robot plays a role similar to a sheepdog. As is done when training real sheepdogs, ducks are used here as a less challenging stand-in for sheep. Read the delightful paper for more detail. See also Neil Sumpter's pages about thevision research related to robo-sheepdog.

The Examination and Exploration of Algorithms and Complex Behaviour to Realistically Control Multiple Mobile Robots (1997) by Duncan Crombie, examines algorithms to control multiple mobile robots, focuses on behaviors that can be obtained through local control, and demonstrates createing complex behaviours with simple algorithms.[new]

Self-Organization in Large Populations of Mobile Robots (1993) by Cem Ünsal Describes the use of a homogeneous population of robots, anArmy-ant swarm, for transportation of material. Investigates both spatial and behaviroal self-organization.[new]

Distributed Ant Robotics a collection of publication and resources by Israel Wagner [new]

Calculating Swarms (2000) by Ivars Peterson(in Science News) discusses swarm intelligence, emergent computation and collective robotics.[new]

Aerospace (coordinated groups of aircraft or spacecraft)

Education (about distributed and complex systems)

Artificial life and Evolutionary computation

Art

Biology

Physics

Tamás Vicsek published an analysis of flocking particles in Physical Review Letters on August 7, 1995, which focused on transitions in collective behavior. (I will provide a more complete description here when I better understand Prof. Vicsek's work.)

J Dana Eckart implemented a cellular automata model of flocking using his Cellular system based onVicsek's work.

Surprises in Nonequilibrium Critical Phenomena: From Flocking Dynamics to Chemical Reactions (0.7 MB gzipped Postscript) by Yu-hai Tu presented at the 1996Santa Fe Workshop on Nonequilibrium Phase Transitions.

Flocks, Herds, and Schools: A quantitative theory of flocking by Toner and Tu in Physical Review E, October 1998, Volume 58, Issue 4, pp. 4828-4858. See the AIP summary: Birds of a Feather: The Physics of Flocks, this summary from Academic Press, and this article from Newsweek.

Physics of Flocks (Part 1 andPart 2) by Karl Kruszelnicki, transcripts and audio recordings fromGreat Moments in Science on the Australian Broadcasting Corporation.

Search, optimization and visualization techniques inspired by flocks and swarms

Particle Swarm Optimization (and see the original 1995 PSO paper by James Kennedy and Russ Eberhart) searchs a multidimensional solution space. Somewhat like a genetic algorithm, but the PSO's search points move as a swarm through the space with a velocity, altered by steering accelerations. See also thisPSO demo applet.

The use of Flocks to drive a Geographic Analysis Machine (1998) by James Macgill and Stan Openshaw, uses a flock model, with communication between boids, to better search for clusters in spacial datasets, just as a natural flock provides better foraging than individual birds could manage. See this demo applet.

Information Flocking by Glenn Proctor is a data visualization technique that portrays datapoints asfish that school through a 3d space, revealing correlations in the data by their motion and clustering. See the paperInformation Flocking: Data Visualisation in Shared Worlds Using Emergent Behaviours (1998, PDF 91KB) by Glenn Proctor and Chris Winter.[new]

Ant-based Load Balancing in Telecommunications Networks (1996) by Ruud Schoonderwoerd, Owen Holland.Janet Bruten and Leon Rothkrantz. See also these related links: There's an ant in my phone (1998) by Mark Ward in New Scientist, British Telecom: Notes from the Ant Colony (1997) by Julia Flynn in BusinessWeek, and Collective Intelligence for Network Control. [new]

Other emergent, collective behavior

Other topics...

John Mee's term report on software to simulate the movement of a flock of birds.

G. Keith Still has developed a system called Legion to simulate the motion of large crowds of people. It can handle crowds of more than 100,000 people. See also these related pages, and these articles by Sheryl Canter in PC Magazine from April 1996 andMay 1996.

A page of Java-based demos by the Biological Model Simulation group at Keio University. The demos are in 2d and include basic schooling, predation, interactive feeding, and schooling with two species.

Daniel Bullok wrote a fishtank simulation as a class project.

Jonathan Robbins' page The Boids is the report from his Science Project -- his 8th grade Science Project, mind you. (Yikes! Kids these days!)

Simulation of Herding with Dynamics by Howard Zhang uses a simple spring-mass model of animal bodies and simulates herding on the plane. This report contains good diagrams and descriptions of the implementation of component steering behaviors.

The Computational Beauty of Nature is the web site for a book of the same name byGary W. Flake (shop for the book here). He implemented boids and added another rule which cause the boids to attempt to maintain a clear view ahead of them. This resulted in flocks which form the classic "V" formations of migrating geese. See theJava demonstration.

In a class project called A-Life Foodchain Simulation Leon Blackwell extends a boid-like model to include predator-prey interactions.

The Duck Pond: Following, Flocking and Herding a 1977 class project by Brian O'Connor. Includes source code and animations.(Although there seem to be access problems for some of the files.)

E Pluribus Unum (the January 1999 installment of Brian Hayes' column on Computing Science inAmerican Scientist) talks aboutemergence using examples such as flocks, schools, herds, traffic jams, ant colonies, and forest fires.

Flocking, Boids and Tag (1998) by Aron Helser. This class project involved an interactive flock which plays the game of tag and allows the use to either ride along passively with a member of the flock, or take control and pilot the boid.[new]

Natural flocks, herds, and schools

Some seminal papers from the (hardcopy) literature:

The Structure and Function of Fish Schools (1982) by Brian Partridge inScientific American, June 1982, pages 114-123.

The Chorus Line Hypothesis of Manoeuvre Coordination in Avian Flocks (1984) by Wayne Potts, in Nature, Volume 309, May 24, 1984, pages 344-345.

Animal Groups in Three Dimensions: How Species Aggregate (1997) edited by Julia K. Parrish and William M. Hamner. A collection of papers related to a 1991 workshop on measuring and modeling animal aggregations. Use this link to shop for the book.

A 22 second movie of a school of anchovies (160x120 pixels, in JPEG (1.1 Mb) andQuicktime (1.8 Mb) formats) swimming in the Kelp Forest tank at theMonterey Bay Aquarium from a page offish videos atFINS. See also the live Kelp Cam view of this tank.

Here are some other flock/herd/school pictures on the web: schooling anchovies, school from below, crowded fish, orca and herring, herd of running Akhalteke, school of spadefish, Gallimimuses flock (Jurassic Park), V formation of geese, herd of wild asses, wildebeest herd, herring schooling (MPEG, 0.5 Mb), herring school turning (MPEG, 1.0 Mb) ...

Temple Grandin's interesting site on behavior of livestock and other subjects, contains a section on Recommended Basic Livestock Handling which covers topics such as: each of which contain pictures and diagrams on geometrical relationships between herds of livestock, the shapes of their enclosures, and the positions of human handlers.

William H. Calvin's book The Ascent of Mind discusses the predation on herds of early humans in Chapter 8:Hand-Ax Heaven (you may wish to search for the first occurance ofherd).

Lessons from Geese: on the structure of migratory goose flocks, and folksy thoughts on applying these ideas to groups of humans.

V formations: at the bottom of Jim Rible's page about the Canada Goose there is a discussion about the mixed evidence for an aerodynamic explanation of the "V" formations often seen in migrating ducks and geese. See also the cited references.

A page by Uwe Kils illustrating how individual fish in a school benefit from reduced predation due tooptical confusion.

An essay called Migration Advantages of Shoaling by Tony J. Pritcher in his book Behaviour of Teleost Fishes describes research by Uwe Kils into the effect he callssynchrokinesis whereby small movements of individuals copied through the shoal provide an accurate movement towards better conditions. (Contrast this with the work ofToner and Tu (above) which suggests that individual errors are damped out by interaction with the rest of the group.)

Vigilance, Flock Size, and Flock Geometry: Information Gathering by Western Evening Grosbeaks (1995) by Marc Bekoff a field ethology study of how the size and relative positioning of this bird affect the vigilance (scanning) behavior of individuals in the group.[new]

Cutting horses and herding dogs: these two types of trained animal behaviors have evolved into modern sport competitions. Their origin was to assist humans raising stock animals, and they can still be found in this role today. Both are related to herding behavior in special ways.
The cutting horse derived from the American cowboy culture and is specifically trained to handle cattle. A cutting horse's skill is in being able to defeat the cattle's herding instinct, allowing it to separate off (cut) one individual at a time. The site of theNational Cutting Horse Association includes history andvideos of the sport.[new]

Some general information about these animals:

Software

(There is additional source code for Java implementations listed on the boids applet page.)

Boids

This is the original 1986-1988 implementation, written in Symbolics Common Lisp, and based on Symbolics' S-Geometry 3d modeling system and S-Dynamics animation system. (Modern versions of those applications are available from Winged Edge Technologies, see: Mirai Modeling and Mirai Animation. Your browser may not recognize this file as Lisp source code and try to reformat it as filled text. If so use [View / Page Source] or equivalent, or download the file.)

C++ Boids

This platform-independent boids implementation by Christopher Kline includes C++ source code and an Inventor-based binary executable demo for SGI machines. These boids support both flocking and obstacle avoidance.

Buzzz!

An After Dark screen saver module for Macintosh computers bySimon Fraser. This very nice package implements a parameterized version of boids including several species of creatures (wasps, birds, fish, sheep...) based on altering the parameters. There are control panels that allow you to experiment with the parameters. For other sources of this software see Simon'sAD page.

boids.exe

by Jürgen Schmitz. Version 1.0 of a Windows application featuring three distinct species of flocking birds and nice control panels for adjusting their parameters. See the readme file for more information.

SchoolView

This is a screen saver for NeXT computers by David Lambert based on the boids model. C code and related files are available for FTP. See the readme file for details.

A-Quarium

A screen saver for Windows by Ric Colasanti. A-Quarium is a fish tank simulator somewhat related to boids. "...a fish will try to swim with a close neighbour if it is of the same species, and will try to swim away if it is of a different species. The behaviour of the fish tank is an emergent property of all the individual fish actions..."

Max Boids

There is an implementation of boids for MAX, an interactive real-time graphic programming environment, fromIRCAM and Opcode.

Boppers

This Windows 3.1 software originally accompanied the book Artificial Life Lab by Rudy Rucker, Waite Group Press, 1993, now out of print. It includes an implementation of boids and related ALife models.

Imagine Flock 3D

A commercial "IPAS plug-in" for 3D Studio from CBL Technology.

Stone's Mac Boids

This is an application for a PowerPC Macintosh using QD3D. Other versions exist for 68000 Macs with FPU, and as After Dark modules. See the main page by Stone (Ishihama Yoshiaki) for other alife-related Mac and Java software.

MatFa's Boids 0.1

Mattias Fagerlund wrote this very nice 2D implementation of boids for Windows 95 or WindowsNT and provides both executable and source code. A screen shot on the web page shows the interactive slider controls and a large flock flying around several obstacles.

Boids: DirectX Flocking Sample

A boids implementation by Stephen Coy has been included in the DirectX sample code since version 5. Stephen suggests that better source code is included with DMBoids the DirectMusic demo based on boids.

Boids for Apprentice

A boids demo based on Christopher Kline's implementation (see above) is included in Eric Powers's OpenGL/OpenInventor tool calledApprentice which is free for non-commercial, educational use.

Cool School

By David S. Hooper, Cool School simulates a school of fish and predators using behavioral modeling. The O(n²) cost of the naive boids algorithm is reduced by by subdividing the population into a hierarchy of "subschools". He reports running at interactive rates with 32 subschools each containing 33 fish on a 200MHz Pentium-class machine. Cool School was developed as part of theVirtual Whale project mentioned above.

Simulation of a Flock of Birds

A 1997 class project at Stanford by Chris Quartetti and Eng-Shien Wu, includes a movie file showing flocking and collision avoidance, and C++ source code.

Boids Demos in VRML, Java3D, and C

Anthony Steed (of University College London) developed the first two implementations to compare VRML and Java3D, and the third to test the DIVE multi-user VR system. Source is includes for all three.

Flock This!

A commercial plug-in from Northern Lights Productions for theElectric Image animation system, creates herds and flocks of animated characters.[new]

Gnat Cloud andMega Flies

Keith Wiley created these Mac applications to simulate extremely large swarm-like populations, using modifications of the basic boid algorithms. See also hisFlock With Obstacles applet. [new]

vbBoid

Richard Lowe wrote this boids implementation in Visual Basic and provided the source code at PlanetSourceCode's VB repository. (I have not seen it run but:) It apparently provides for interactive specification of obstacles.[new]

3D Boids

Robert Platt wrote a boids implementation as a Windows application for a Final Year Project in college. The original version used Direct3D and he later rewrote it to useOpenGL. Binaries and source are available for download from his page.[new]

The Birds

Olcay Cirit wrote this 2d shooter game based on boids. It runs under Windows 95, 98, and NT and is available for free download. You can shot at the flocking birds, but watch out, because they can shoot back! And since they are a flock, they can make coordinated group attacks.[new]

Crowd simulation

Bill Powers developed these models of "people moving in relation to other people and things" as part of a suite of (Windows PC based) demonstrations of hisPerceptual Control Theory. Powers and his colleagues in the Control Systems Group seek to model and understanding the purposeful behavior of living organisms.[new]

Creature Behaviour Simulator

James Greenbank wrote this ecological simulation of a three species system using individual-based local rules. It is written as a Java application. This page contains links to a paper, the source code and both platform-independent and Windows-specific executables.[new]

CM: Flocking Model

a StarLogoT implementation of flocking from Connected Mathematics ("Making Sense of Complex Phenomena Through Building Object-Based Parallel Models.") Includes links to a movie of the simulation and a page of background. [new]

flock v1.0

John Kundert-Gibbs wrote this flocking plug-in for Maya in its scripting languageMEL. It is available at the HIGHEND3D repository.[new]

Greg's boids

Greg Johnson wrote this boids code to use with the Persistence of Vision Raytracer, the page contains links to the code, a movie, and some diagrams of the steering force vectors used in the boids model.[new]

Lexicological note: in addition to common terms like flock, herd, and school, English has a rich history of specific words to describe groups of various animals, sometimes known as collective nouns or venereal terms. These words were used more frequently when hunting wild animals was a major source of food. For an amusing discussion of these words see the book An Exaltation of Larks by James Lipton (Viking Penguin, 1993, ISBN 0140170960). Here are some web pages that provide similar information:

Send comments to Craig Reynolds < cwr@red3d.com>
visitors since June 29, 1995
Last update: September 6, 2001
(fixed the "early motion tests" link December 6, 2006)
(fixed links to Brian J. Mork's work July 30, 2007)

# data[].attributes.attachment_link.title
Boids (Flocks, Herds, and Schools: a Distributed Behavioral Model)

# data[].attributes.attachment_link.description
In 1986 I made a computer model of coordinated animal motion such as bird flocks and fish schools. It was based on three dimensional computational geometry of the sort normally used in computer animation or computer aided design. I called the generic simulated flocking creatures boids.

# data[].attributes.body
You can think of each boid as a particle which has  :

a position

a velocity (you can think of it as a vector which means the boid has a direction and a "speed" at which he travels)

an acceleration which is how its velocity varies in time

a mass (here we will assume all the boids have the exact same weight = 1 kg because it symplifies a lot the implementation)

And the more important things :
Each boid has a range in which he sees other boids : we can call that range the perception range. If some are to far from him it won't interact with them. So each boid will only interact with its nearest neighbours. In a first approach, we'll consider that each boid can see at 360° around him.

So what we want to do in this algorithm is to control the velocity of the boids (hence their position) so that we can move them forming murmuration.

I'll also consider we are in a 2D world in order to simplify drawings an explanations.

# data[].attributes.body
The original description of this principle is : "steer towards the average heading of local flockmates".

So lets focus on one boid and see how he interacts with others in this principle. Basically what it says is that at every time, the boid "finds" what's the average direction of his neighbours (meaning the boids which are in his perception range) and he aligns its direction with it. Physically it means the boid will align his velociy (which is his direction) with the average velocity of his neighbours.

And this makes a lot of sens if you think to the starlings flocks : locally, all the birds are going in the same direction.

In the end, you can think of that as a "steering alignment force". And as Newton has inveted a really handly law in physics, this force is related to the acceleration of our boid. And in a discrete world, if we chose to have a time step equal to 1 sec, this force is directly related to the velocity of the boid ! So there we have made our first step to model murmuration !

# data[].attributes.body
"steer to move toward the average position of local flockmates"

So if we continue to focus on one boid, what this principle says is that, at every time, our boid has to move so that it's next position steers toward the average position of the boids which are in his perception range.

Once again, this makes sens, each starling wants to stay with the flock so he tends to move toward the average position of its neighbours. In that way he never goes to far from the others.

And again you can think of it as an "attractive steering cohesion force". And as we said before, this force is related to the velocity of the boid. And as physics is wonderfull, the sum of the force apply to the boid equals its acceleration (because its mass is 1kg). This means the "attractive steering cohesion force" adds up with the "steering alignment force". This is really convenient for the implementation.