About the Flocking demo
This Flocking Demo was created for fun and as a learning expirence. The Demo demonstrates the AI flocking technique based on the orginal 'Boids' algorithm by Craig Reynolds.
For those who don't know flocking is an AI technique which attempts to mimic the 'flock' behaviour of groups of birds or schools of fish.The three simple rules to implement this behavior are:
-
Boids steer towards the average position of the flock
-
Boids steer away from nearby Boids who are too close
-
Boids try to match the velocity of other Boids within the flock.
To make the demo more interesting I added rules of my own.
There are also controls to adjust the number of boids of each colour as well as the maximum speeds and avoidence thresholds.



Executable Download
An executable version can be downloaded here.
The demo requires DirectX 9.0c to be installed. The redistributable can be found here.
Source Code Download
The full source files can be downloaded below. Feel free to study, break apart and use as you see fit. Some credit if you use my code in your project would be nice but not essential.Don't forget to check out the Librarys needed to make the code compile at the links below.
Source Files Download.
Language and API's
The Flocking Demo was created in C++ using the Simple and Fast Multimedia Library(SFML) for sprite and window manipulation and Crazy Eddies GUI (CEGUI) library for the GUI componemts.
Project Links
Simple and Fast Multimedia Library
Crazy Eddies GUI Library
Craig Reynolds Boids
|