Skip to main content
gamedev.net
🔒 Locked

Flocking AI Algorithm.

Started by omegarealist 0 replies 3.4k views
Original Post
omegarealist
omegarealist
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.
Red Ghost
Red Ghost
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.