Skip to content

An attempt at recreating the famous Boids algorithm using the p5.js library.

License

Notifications You must be signed in to change notification settings

BenMaltby/Boids-Simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Boids-Simulation

This recreation was made with the p5js editor and therefore does not have all the necessary code files to run standalone. You could however copy and paste the code into the online editor, or view this demo.

I found this algorithm quite difficult to get correct. I found that there were so many ways to tweak the sliders and have different effects so finding a configuration that best mimicked birds or fish was quite difficult. That's why after some time the boids will become very tightly packed, which is also affected by the chunk size. I used a chunking data structure because I thought it would be a necessary optimization if I wanted to have several hundred Boids, it definitely helped but there were some places where I kind of shot myself in the foot and made it less efficient.

Images

A cool image that came from some messed-up parameters

About

An attempt at recreating the famous Boids algorithm using the p5.js library.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published