Wednesday, April 18, 2012

Flocking

This is a demonstration of flocking behavior (like fish) by combining various simple AI algorithms.
It is written in C++, and uses Allegro.

In the video, each color arrow represents a different AI behavior algorithm.
  - The white arrow is me!
  - The first pink arrows that spawn are Dynamic Arrival AI, which means they go directly to a point and stop.
  - The second pink arrows that spawn are Dynamic Seek AI, which means they go to a point, but continue to circle around it.
  - The green arrows are Cohesion AI, which means they try to stay close to other nearby arrows.
  - The yellow arrows are Alignment AI, which means they try to travel in the same direction as nearby arrows.
  - The orange arrows are Separation AI, which means they try to travel away from other arrows.
  - Finally, these behaviors combined form the blue arrows, which demonstrate flocking behavior.

In the video, notice how the blue arrows form flocks, and then flocks come together to form one large flock.

No comments:

Post a Comment