Sign in to follow this  

Flocking AI Algorithm.

Recommended Posts

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.

Share this post

Link to post
Share on other sites

Did you look at craig reynolds paper on flocking ?

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,

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this