Skip to content

andrew-t97/super-swarm-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐦‍⬛ Super Bird Swarm

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.

example swarm

🛠️ How do I build and install Super Bird Swarm?

📋 Prerequisites

  • CMake 3.10 or higher
  • SFML 2.5 or higher
  • A C++20 compatible compiler

🏗️ Building

  1. Clone the repository:

    git clone https://github.com/andrew-t97/super-bird-swarm.git
    cd super-bird-swarm
  2. Configure the project with Cmake:

    cmake -B build
  3. Build the project:

    cmake --build build

🚀 Running the simulation

After building, you can navigate to the build's source dir where you can run the executable:

cd build/src
./swarm_demo

📦 Installing the project for easier simulation running.

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

About

A demo of bird swarming behaviour in C++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published