Super Bird Swarm is a simulation of bird flocking behaviour using the Boids algorithm. The simulation demonstrates how birds (boids) can exhibit complex flocking behaviour through simple rules:
- Alignment - Birds steer towards the average direction of birds around them.
- Cohesion - Birds steer towards the average position of the birds around it.
- Separation - Birds steer to avoid crowding other birds around them.
Within the simulation, you can adjust the weights of each of the simulation's rules to see how they impact the flocking behaviour of the birds.
- CMake 3.10 or higher
- SFML 2.5 or higher
- A C++20 compatible compiler
-
Clone the repository:
git clone https://github.com/andrew-t97/super-bird-swarm.git cd super-bird-swarm
-
Configure the project with Cmake:
cmake -B build
-
Build the project:
cmake --build build
After building, you can navigate to the build's source dir where you can run the executable:
cd build/src
./swarm_demo
If you don't want to navigate the build files to run the simulation you can install it into a directory instead. Just run the following in the project's root after you've built the simulation.
cmake --install build --prefix <dir-to-install-into>
You can then run the simulation with the following:
cd <dir-to-install-into>/bin
./swarm_demo