Coding a Boids Flocking Simulation

Опубликовано: 25 Март 2025
на канале: Suboptimal Engineer
10,825
261

Boids is an algorithm developed by Craig Reynolds in 1986. It aims to emulate the flocking behavior of birds by applying three simple rules: separation, alignment, and cohesion. In this video, we go over the process of building a boids simulation in Unity. The code for this project, and links to any references I used, are available in my GitHub repository.

📖 Code - https://github.com/SuboptimalEng/boids

🎥 YouTube -    / suboptimaleng  
💻 GitHub - https://github.com/SuboptimalEng
🐦 Twitter -   / suboptimaleng  
🧵 Threads - https://www.threads.net/@suboptimaleng
📸 Instagram -   / suboptimaleng  

== [ Resources ] ==
Boids by Craig Reynolds - https://www.red3d.com/cwr/boids/
Ben Eater's Boids Simulation - https://eater.net/boids
Daniel Shiffman's Boids Simulation - https://processing.org/examples/flock...
Sebastian Lague's Boids Coding Adventure -    • Coding Adventure: Boids  
Catlike Coding's Creating a Procedural Mesh Tutorial - https://catlikecoding.com/unity/tutor...
David Zulic's Custom Debug Draw Tutorial for Unity -   / unity-drawing-custom-debug-shapes-part-1  

== [ Timestamps ] ==
00:00 Boids Explained
00:49 Separation Algorithm
01:16 Separation Code
01:51 Demo 1
02:14 Alignment Algorithm
02:36 Alignment Code
03:10 Demo 2
03:50 Cohesion Algorithm
04:10 Cohesion Code
04:40 Demo 3
05:09 Performance Optimization
06:09 Demo 4
06:44 More Optimizations
07:24 Compute Shaders Code
08:09 Demo 5

== [ Tags ] ==
#suboptimal #unity #gamedev