A* Pathfinding Project

Cornered FleePath


#1

Hi Aron!

FleePath works really well, tweaking the value can result in a really panicked looking AI (which is the goal!).

However one thing I’ve noticed is that if the AI is cornered on the edge of the map, the calculated path will move toward the flee position. Is this by design? In scenarios where there essentially is no flee path, I think I’d have expected an error instead?

Thanks!


#2

Hi

The flee path will try to find the best path it can of a certain length. If there are no “good” paths it will pick the least bad one.


#3

Makes sense, thanks for the response!


#4

Hi there!

Sorry to revive this. But I don’t suppose you have a reliable way of knowing whether the flee path goes back towards the initial flee target or not?

Thanks!


#5

Hi

The only way I think would be to go through the points in the path and check if any point is closer to the flee point than the first point in the path.