Issue with AI Sound Perception


Author - Cameron Euston


The Problem

I started this week working on the new enemy in our game that would operate purely off of sound. This obviously requires a good enemy perception system to make it feel right. I was originally using the built in AI Perception system in Unreal Engine but ran into and issue with noise falloff for noises far away. Unreal by default does not have a way to receive the loudness of the sound from the perception component and the only way to change that is by editing the engine's source code.

In the following video you can see that the ai sound perception is working but the debug messages only print -1 for the strength of that sound.


The Solution

I was not confident enough to start changing the source code all alone so I decided on a different solution. I decided that I was going to make my own ai perception system for sound. This is not as complex as it sounds as I am just sphere casting and getting all actors with my custom sound perceiver component and calling a function on that called receive noise. This then adds the loudness to the suspicion meter that once it reaches a certain threshold causes the enemy to attack or investigate. 

The following video shows the new system properly adding the intensity of the new sound to the suspicion meter and having that gradually decrease over time. The enemy will also chase when the suspicion is high enough.

Leave a comment

Log in with itch.io to leave a comment.