Advertisement

Flocking AI Algorithm.

Started by May 13, 2008 11:00 PM
0 comments, last by Red Ghost 16 years, 6 months ago
I need a Flocking AI Algorithm so that when I call for things to flock together they will do so and perform as a crowd and mimick each other but not immediatly so they look like they still have independent AI functions. I would appreciate any help and would prefer code samples.
Hi,

Did you look at craig reynolds paper on flocking ?
http://www.red3d.com/cwr/boids/

There is everything you need to implement the flocking behaviour.

Regarding being able to switch between one navigational AI and another, I would suggest to use a behaviour class. In normal use, each entity uses its base behaviour class. When you order to flock, you just deactivate the base behaviour and stack up the flocking behaviour for each entity. When entities are flocked together, you pop the flocking behaviour and activate back the base behaviour.

Hope that helps.

Ghostly yours,
Red.
Ghostly yours,Red.

This topic is closed to new replies.

Advertisement