Hey people,
I am creating AI for a map of mine, and I'm trying to create a function to make a unit flee from units that are chasing it. The problem is that it could be chased by multiple units at the same time, and I'm not sure how I would be able to create a system that would detect which multiple directions the unit is being chased from, and know how to calculate the correct angle to run to, to help get away.
also to be able to sift through the chasers and give them diff levels of priority so that if it is being chased from all sides - it will run towards weaker enemies.
I'm really not sure how to attack this problem... any help would be welcome...
thanks!
I am creating AI for a map of mine, and I'm trying to create a function to make a unit flee from units that are chasing it. The problem is that it could be chased by multiple units at the same time, and I'm not sure how I would be able to create a system that would detect which multiple directions the unit is being chased from, and know how to calculate the correct angle to run to, to help get away.
also to be able to sift through the chasers and give them diff levels of priority so that if it is being chased from all sides - it will run towards weaker enemies.
I'm really not sure how to attack this problem... any help would be welcome...
thanks!