top of page

Creating noise and investigation behavior

To fill in the blanks a little bit between combat and patrol, I created an investigate task. This involves a different response to when the AI see's the player outside of their normal vision range or hears a noise around a corner. To create this task I had the AI record the player's location and move towards it after a short pause. This sounds simple enough but i wanted the AI to resume its normal perception settings while it was performing this investigation task. The problem was that the AI perception component I was using would only update when the player left the vision area, which lead to weird issues like the player being invisible if they didn't move. No tasks associated with the perception component so I had to improvise using tick, which would only fire through the perception event when in this investigation mode. I had to use a check against the player distance, controller alert mode and line of sight to make sure that the player was only detected properly in this phase.

Tick will only bet let through in the investigate phase.

The Investigate task is called after checking against the sense info.

Sense info details

Creating Noise

There was plenty of documentation on the AI perception component for hearing, using a similar system as the sight but with an event called from the player to create noise as a stimulus. However after setting it up "Exactly" as it is shown, I still couldn't get it to work, so again I had to improvise and I used a simple method that I am more familiar with. I set up a controller binding for an "Action" button in the player controller. When this is pressed, it creates a sphere trace to hit the AI character and calls the investigate event. Since this uses a radius, it has pretty much the same functionality as the noise create function, but I am disappointed that I couldn't figure out what was wrong. Although, at this point I can't be spending too much time one aspect of the project and I needed to move on.

Update video


Recent Posts
Archive
bottom of page