Skip to content
/ Boids Public

An implementation of Boids Algorithm (Craig Reynolds 1968) in Android.

Notifications You must be signed in to change notification settings

arpitmx/Boids

Repository files navigation

image
Alt Text

Boids 2D : Flock Simulation

Understanding Collective Motion

Boids, a term derived from "bird-oid," is an artificial life algorithm developed by Craig Reynolds in 1986 to simulate the intricate flocking behavior observed in groups of animals, particularly birds. The algorithm's elegance lies in its simplicity, employing three basic rules that govern the motion of individual entities (boids) within a group, leading to complex and visually appealing collective patterns.

In the context of Boids 2D, this algorithm comes to life in a visually stimulating simulation. Users can observe the dynamic interplay between boids, hunters, and environmental elements like walls, experiencing firsthand how the simplicity of rules leads to the emergence of intricate and realistic group behaviors.


Screenshot 1 Screenshot 2 Screenshot 3 Screenshot 3

In App Clip :

telegram-cloud-document-5-6138602645125861175.mp4

Three Fundamental Rules of the Boids Algorithm:

1. Alignment:

  • Rule: Boids align their direction with the average direction of their neighbors.
  • Purpose: Encourages entities to move in the same general direction as nearby members, creating a sense of cohesion and alignment within the group.
image

2. Cohesion:

  • Rule: Boids move towards the average position of their neighbors.
  • Purpose: Promotes togetherness as entities are drawn towards the center of the group, preventing dispersion and fostering a cohesive flock.
image

3. Separation:

  • Rule: Boids avoid collisions by steering away from nearby entities.
  • Purpose: Prevents overcrowding and collisions by ensuring that entities maintain a minimum separation, allowing for fluid and organized group movement.
image

Emergent Behavior:

The brilliance of the Boids algorithm lies in the emergence of complex behaviors from the application of these three simple rules. By following these principles, individual boids collectively exhibit mesmerizing patterns such as flocking, schooling, and herding, mirroring the natural world.

Screenshot 3

Key Features of Boids 2D Simulation:

1. Diverse Entities:

  • Boids ⚫️ 🔴: Observe the nuanced behaviors of boids, each contributing to the overall fluidity of the flock.
  • Hunters 🕊️: Introduce a new layer of complexity with hunters, creating interesting dynamics within the simulated ecosystem.
  • Walls 🦅: Explore how environmental elements like walls influence the group's movement, leading to unexpected patterns.

2. Interactive Vertex Mode:

  • Vertex Mode Switch ✨: Take control of the simulation by switching between modes, influencing the behavior and trajectory of individual entities within the flock.

3. Implementation Details:

  • Language: Developed in Kotlin.
  • Graphics: Utilizes the Canvas API for rendering captivating 2D visuals.

4. Ongoing Exploration:

  • Stability Updates: Benefit from continuous improvements ensuring a stable and seamless simulation.
  • UI Polish📍: Enjoy a refined user interface that enhances the overall user experience.

Download

The app is hosted on Google play store

Get it on Google Play

About

An implementation of Boids Algorithm (Craig Reynolds 1968) in Android.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages