Download

Controlled Stalking AI Random Radius Patrol "Get Random Point"

So, Basically I have an enemy AI that patrols the map randomly to try and find the player and gives chase if the player is in its sights.

Here’s my current blueprint for the AI behavior

So The main focus is going to be on the Get Random Point.
So the whole map has navigation on it, and the map is completely flat.

The AI can (Chase Player when player is in sight) (Stop chasing player when player gets far enough) (Roam around completely randomly on the map)

Now here is how I want the AI to work.
The AI is TOO random, at the size the map is the chances of the having the AI get the chance to chase you is extremely low. I want the AI to always be somewhat stalking the player (NOT CHASING) or at least have the AI roam around his general area. When the player tries to move around the AI moves somewhere in the players general direction, what I have attempted but failed to do is make it so that the player has a a radius around him and the AI finds a random point in that radius area to go towards.

So I’m not sure how to go about this but any help will be much appreciated.

I currently look into patrol AI, will check your script later tonight.

My thoughts about what you want.

Make 2 radius check, first radius is chase, when that radius is met, make second radius for stalk, like follow player up to min radius. When radius 2 is active you could start a random integer timer, when that is run down he attacks. I think this can be done easily, however the enemy wouldn’t circle the player, just follow at shortest distance.

I looked at the BP picture and you need to select random point in relation with your player current location.
Use “get player pawn” and "get actor location, " and add it to the “get random point” vector. Try to clamp it to the x,y axis (since z is up.)