I've been looking into flocking and I'm attempting to find to way to have a group flock in a certain formation.
For example: having a group of birds flying in a V shape, or soilders marching in lines.
I have ideas about how it could be done, but I'm wondering if theres any good( and hopefully free) resources that would show better ways of doing it.
Thanks
Moving in formation
simplest answer is move the leader and make the others child objects with a position offset from the parent. you could simply have the others follow using ai it would be less efficient but would look more real. The answer on following is in the first suggestion create the points and move each individually to fly to the moving points. To follow the points just have the entities determine the pitch and yaw angle to the point and then set their rotation controls to match. You then just need to set the momentum to reach the point by either accelerating or decelerating if beyond it.
So if I'm understanding you are to have a group of points traveling around (most likely parented to a leader), and I guessing having each solider assigned to a certain point that it'll follow around?
I know how to chase after a point, I have was wondering what the most efficient way to have a formation was. Thanks for the ideas.
I know how to chase after a point, I have was wondering what the most efficient way to have a formation was. Thanks for the ideas.
Again... define your formation any way you want. Assign one slot to be the leader. The slots are always defined relative to the leader (e.g. back 50 pixels and left 50 pixels). Assign your peeps to slots. Move them to those slots. When moving the formation, pathfind only the leader. The relative slots move along with the leader because they are simply defined relative to the leader. Everyone else is trying to get close to their assigned slot as it moves.
Done.
Done.
Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play
"Reducing the world to mathematical equations!"
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement