Prevent collisions between mobs/npcs/units piloted by computer AI : How to avoid mobile obstacles?
        Posted  
        
            by 
                Arthur Wulf White
            
        on Game Development
        
        See other posts from Game Development
        
            or by Arthur Wulf White
        
        
        
        Published on 2012-11-24T13:14:33Z
        Indexed on 
            2012/11/24
            17:19 UTC
        
        
        Read the original article
        Hit count: 295
        
Lets says we have character a starting at point A and character b starting at point B. character a is headed to point B and character b is headed to point A. There are several simple ways to find the path(I will be using Dijkstra). The question is, how do I take preventative action in the code to stop the two from colliding with one another?
case2: Characters a and b start from the same point in different times. Character b starts later and is the faster of the two. How do I make character b walk around character a without going through it?
case3:Lets say we have m such characters in each side and there is sufficient room to pass through without the characters overlapping with one another. How do I stop the two groups of characters from "walking on top of one another" and allow them pass around one another in a natural organic way.
A correct answer would be any algorithm, that given the path to the destination and a list of mobile objects that block the path, finds an alternative path or stops without stopping all units when there is sufficient room to traverse.
© Game Development or respective owner