Deer AI - Player Avoidance

Hi there.

I’m currently prototyping a hunting and tracking game that includes a deer with AI. Currently, the deer has a number of set waypoints (basically just positions in the world) in the map, when the deer is ‘spooked’ (when the player gets too close), it runs to the waypoint furthest from the player. The issue i’m currently having is that the deer sometimes runs directly past the player (like very close!) on its way to the next waypoint. This is a bit of an issue as it ruins the gameplay experience a bit. It doesn’t make sense logically for the deer to run right past the person it’s escaping from!

I’m wanting the deer to not run close to the player at all, like heavily avoid the players position, say like not going closer than 2000 units of the player. I’ve been struggling to figure out how I can make this happen. Any help is appreciated.

Thank you!

Hey there - I’m the creator of the Animal Behavior Kit in the MP. I have this exact behavior for the animals (flee). My recommendation is to try a different solution than preset way points.

Search for EQS in the UE4 documentation and you will see an example of how to set this up :slight_smile:

Hope this helps!

Thanks for your response! I ended up figuring out myself that the waypoint system wasn’t going to work. I ended up programming some zone based wander/escaping, did the trick reasonably. I’ll look into the EQS if I end up working more on this project. Thank you for your suggestion.