This project builds on Ben Eater's Boids algorithm demonstration repo (copyright 2020 Ben Eater).
Check out his repo, ⭐️ it and read the original project's readme for more details!
This code is MIT licensed.
This is a boids (bird-oid objects) simulation done for a Multi-Agents Systems class, taken on 2022 at ENSTA Paris. More details on report.pdf
.
We have developed on Ben's original code by adding some functionalities:
- Predators (red triangles) that scare the boids
- Leaders (yellow triangles) that leave traces of their direction behind, helping other boids find their way running away from the predator – this was done to create an indirect communication scenario
- Turbulence areas (yellow circles), that throw boids away on a given direction
- Obstacles (black circles), that block boids from passing
- Optional use of the mouse as a leader (in this case, it does not leave traces behind)
This section has been kept from Ben's original Readme
It should run in any web browser. Download (or clone) the files. Then, just double-clicking on index.html
on most computers will open the simulation in your web browser.
In case this does not work, another way is to open the repo on VSCode, instal the LiveServer extension and activate a live server while on the index.html
file.
You can then edit boids.js
to tweak and experiment with the algorithm. Simply save your changes and reload the web browser page to see the effect.
Built on top of Ben Eater's awesome work.