Boids

I wanted to create a zero-player game, like a simulation or an AI vs AI game, using a 2D web browser canvas. Since I've spent my entire professional life working with Eulerian fields, I decided to take a different approach and chose the Lagrangian representation for this project.

I chose small, colorful, shiny, and simple units of light with particles around them to represent unit in swarm.

After little of coding, listening to good music, and several hours of watching these delightful little creatures fly around, the boids were born!

⚙️
Blur
Spark
Vectors
Vision range
Visual connection
Dying

Boids

Separation
Alignment
Cohesion
Collisions

What are Boids?

Boids are units of artificial life used in simulations to create emergent behavior. They follow simple rules to mimic swarm intelligence, similar to how birds or fish move in groups.

There are three basic rules that govern the simulation: Separation, Cohesion, and Alignment.

  • Separation: Prevents collisions with other units.
  • Cohesion: Keeps units grouped together.
  • Alignment: Aligns each unit with the direction of the local group.