Launcher

Type to filter results. Use arrow keys to navigate, Enter to select.

Preferences

You've reached the end of the results

Project Overview

Programmed from scratch using clean, standard C++ object-oriented practices, this simulator implements the classic Boids algorithm developed by Craig Reynolds in 1986. Hundreds of independent “fish” agents follow three simple local rules — separation, alignment, and cohesion — and flocking behavior emerges naturally from their interaction, without any centralized control.

Source Code Repository

Technical Details

  • Built with C++ and the SFML library (fetched automatically via CMake’s FetchContent) for real-time 2D rendering.
  • Each fish steers based on the average heading and position of nearby flockmates while avoiding crowding.
  • The project ships with manual and unit tests (run via CTest) to validate the underlying vector math.
Benchmark charts showing FPS dropping and fish count rising over a one-minute run that adds 20 fish per second

Benchmarked by spawning 20 fish per second for a minute: frame rate holds steady near 60 FPS until a few hundred fish are on screen, then degrades as the flock grows past what the naive O(n²) neighbor search can keep up with.

Project History

Originally built in 09/2024, the codebase was significantly reworked two years later: bugs in the direction-handling logic were fixed, the class structure was made more readable, and unit tests were added. Velocity-vector-based steering — a more physically accurate version of the algorithm — is planned for a future iteration.

References