
Let's pick the first branch. This branch divides into two branches that tell the stalker to do one thing or another depending on the stimulus type. The first branch happens if the stimulus was 1 (if the stalker heard the player, or an object) and the second branch happens if the stimulus was 2 (if the stalker saw the player).
In part 3, I had mentioned I was also outputting a "stimulus type" variable from the AIPerception component. This is why I was using it. The idea is to have different patrol patterns depending on the stimulus.

Checking the first branch: the stalker goes to the sound source location and then gets into the patrolling state. The branch has a Sequence node, and you know this means every Service (from left to right) will run after the previous one is finished. What this group of nodes does is this: it makes the stalker pick a random point so it "patrols" around its location, to simulate the "you must be somewhere around this area" situation.

The second and third Services are built-in Services, but the first one is custom-made. It picks a random location within 800 units from the stalker, and then "ends" the Service using the Finish Execute node so the Sequence can move on to the next Service. One thing worth noting is that the picked location should be farther than 500 units from the stalker, and if the condition is not met a new location is picked. The reason I did this was to avoid a situation where the stalker just gives a couple of steps from its current position.

The other branch is similar, except that it will pick a location around the player. The stalker also picks a random location, this time around the player, and moves to that location.



Other ideas you can implement: For the patrol state when the stimulus was sight, you could make the player do something to avoid detection (like a QT event), or make the stalker stand near an exit in case the player wants to get away. Also, make the stalker decide if it should follow or ignore sounds if its already looking for the player (meaning, the stalker is in patrolling state). This is where my AI series end, but I will share more techniques and ideas to work with AI as I test and redesign my enemy.
Get Unreal Engine: https://www.unrealengine.com/