Advertisement

Path finding for a continuously chasing agent?

Started by October 11, 2009 06:40 AM
11 comments, last by alvaro 15 years, 1 month ago
One thiong to consider is that such an pathfinder does not have to find a perfect path all the times and can be more realistic to have imperfections in it (such as repathfinding only on intervals and possibly having to backtrack when it seemingly becomes apparent that the original path was wrong -- easy to do in cluttered terrain in real life -- and if its very open terrain then the A* search is a very fast bee-line for the target anyway).


An optimization could be to mark waypoints (like quarters along full paths length) and as the target moves only recalculate the last segment ( a much lighter processing load). (Handle endcases smartly -- like spacial terminal guidance if the target is in close proximity , etc....) Periodic full repathing could be done to catch major chase path realignment.
--------------------------------------------[size="1"]Ratings are Opinion, not Fact
Could you not revert to re-calculating a path only when the player leaves the line-of-sight of the end node of the current path? And then use steering behaviors when close to the player until he leaves LOS again?
Advertisement
About the original question, I would go with some fast pathfinding routine that you can run every few frames (you should probably also spread the computation over several frames), and making approximations is perfectly OK.

I was just thinking, will your agent magically know where the player is, even if he's out of sight? Or will you just go to the last known position of the player? What if you get there and you still don't see him? (I am not sure if this is possible in your scene...)

This topic is closed to new replies.

Advertisement