Pathfinding NPCs avoiding eachother


#1

Hello everyone! =)
I am making a small top down stealth game, in wich every NPC has it´s own routine, as long as the player doesn´t does something suspicious(yes, very hitman inspired). To do this i used the pathfinding behavior. now the problem is that those NPCs will inevitably at some point be in collision with each other. Simply separating will get no good results, as in the particular case in wich they are walkin in opposite directions, that looks very messy (basically they will teleport each in the position of the other).
In the FAQs i read that the pathfinder calculates the path and then moves, and therefore does not care about object moved after calculation is done. But i need it to do exactly that. Is there a way to overcome this?

Thank you in advance for any help!

PS: I tried everything i could think of (stopping pathfinding, creating an obstacle, and reactivating it afterwards) everything. Calculating the pathfinder at every turn does not work, and neither if i do it by “if distance is less than”.


#2

Hi,
I think you would need to stop the path and trigger a new one every second or so, to take into account the moving obstacles.