Group Movement with Flocking
There needs to be a way for the leader or followers to determine if an obstacle is a temporary (and thus tolerable) situation or if it is truly going to cause a problem.
Think about this: When walking through a forest, for example, or past another interposing object of some sort, if we know where the leader is going, we can realize that, despite being seperated for a brief period, we will soon be rejoined (via direct LOS) in a moment - therefore, we persist as if we were not separated at all. To model this would entail not just an idea of where our leader is at the moment but also a concept of where that leader is going and therefore our own future relative location.
Our questions become:
Is that future relative location a valid one?
Is it accessible from here?
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!"
Handling it is a matter of each blocked unit backtracking to the closest state at which a valid path can be found (the same paradigm as backtracking up a search tree when you find a dead leaf). Avoiding it requires prediction (reasoning about actions/plans/behaviours) and a means of assessing whether each unit should carry on with what it is doing or change its behaviour. My earlier suggestion was in this vein, but only one unit did the reasoning (the leader) and commanded the others to change. This is one of the simplest means of doing this (and almost certainly not likely to be the best in all situations).
Steadtler: Obviously, how you reform is a matter of assessing the requirements of the situation. If you're in a forest, the leader could simply say, "I'm heading in this direction at this speed as best I can. You do your best to maintain a parallel trajectory" and then each unit manages themselves until told otherwise. This is a perfect situation for switching between steering behaviours that are primarily designed to maintain formation and those that are primarily designed to get the unit to the goal. Think of a subsumption architecture for this. Combine 'stay in formation' behaviours with 'move to goal' behaviours. When you find lots of objects that are making it hard to stay in formation, relax that behaviour and give more weight to 'move to goal' behaviours.
Sometimes if you can't solve the problem, you need to back up one layer of assumptions.
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!"
Cheers,
Chris