Skip to content

A simulation that replicates the flocking behavior seen in nature, similar to how birds and fish move cohesively in groups.

Notifications You must be signed in to change notification settings

JatinChopra/Boids-Flocking

Repository files navigation

Boids Flocking Simulation

A simulation that replicates the flocking behavior seen in nature, similar to how birds and fish move cohesively in groups.

Run : https://boids-flocking.vercel.app/
View related post on Twitter , LinkedIn

How it works

This core of this simulation is based on Steering Forces.

Basic Flocking Rules Include

  1. Separation: Boids steer away to avoid bumping into each other
  2. Alignment: Boids steer in the same direction as nearby boids.
  3. Cohesion: Boids steer towards the center of the group.

Predator-Prey Dynamics: A predator chases one group of boids while the others avoid it if it gets too close. I also gave predator ability to shoot projectiles and show explosion with some simple particle effect.

I wanted it to look more cool so I made the camera follow predator in a cinematic way and added unreal bloom effect.

Screenshots

boid image

Resources

Original Boids Model by Craig Reynolds
SubOptimal Engineer Three.js Playlist
Nature of Code - Autonomous Agents

About

A simulation that replicates the flocking behavior seen in nature, similar to how birds and fish move cohesively in groups.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published