Fleeing AI

Hi all,
I’m trying to make a fleeing AI. In my game I have these humans who are supposed to run away from zombies. The zombies can track humans very well but the humans themselves are kinda bad at running away.
At the moment, I’m making the humans just select a point directly away from the zombie and try to path there, but this does not really work as it gets them stuck against corners pretty easily.

Imagine a circular, looping corridor. Ideally, the human would keep running forward so that it would avoid the zombie, but at the moment it smooshes itself against the wall and dies.

I know this feature is included in the Pro version, but I do not have enough money to buy it, so I’m trying to make it myself.

Could someone give me some pointers on how to find a valid path away from the zombies, that does not get the human stuck?

Thank you very much.

You can try to pick points which are further away from the human, so they will (hopefully) get a longer path back which they can follow. You could also check the returned paths, if they are short you could perhaps pick a new slightly random point and try again to get a longer path.