A simple fish school simulation using C++ with SDL2 and ImGui. This project demonstrates the boids algorithm for emergent behavior.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
This project is built and tested on Ubuntu. You will need the following packages installed:
build-essential
cmake
libsdl2-dev
libsdl2-image-dev
You can install them using apt
:
sudo apt-get update
sudo apt-get install build-essential cmake libsdl2-dev libsdl2-image-dev
-
Clone the repository:
git clone https://github.com/sbstndbs/fish-simulation.git cd fish-simulation
-
Initialize submodules:
git submodule update --init --recursive
-
Create a build directory:
mkdir build cd build
-
Run CMake and build the project:
cmake .. make
-
Run the simulation:
./sdl-imgui
- Add cohesion behavior to the boids algorithm.
- Implement a quadtree to optimize neighbor searching.
- Add more fish species with different behaviors.
- Create a basic simulation with SDL2.
- Integrate ImGui for real-time parameter tuning.
The fish texture path is set to ../img/fleche.png
in src/test_imgui.cpp
. Make sure to run the executable from the build
directory so it can find the image files correctly.