UE4.7 PawnSensing OnHearNoise

There seem to be two issues with the PawnSensing component, one which is a bug, and one which may or may not be a bug.

  1. Hear events are never fired while See events are fired. They are mutually exclusive, with See events taking priority if both happen.

  2. The Volume output of the event is always the loudness of the original noise, regardless of distance or occlusion.

Hello,

Sorry for the delay, I had to set up a test for the AI team to explain what was happening here. I was able to reproduce the issue and have created a bug report for the AI team (UE-11759). I am seeing what can be done to get those resolved as soon as possible. Please let us know if you encounter any other unexpected behavior.

Thanks!

Just an update, this is not scheduled to be fixed, as Pawn Sensing is legacy code that is being replaced by AI Perception. Our AI developers suggest using that component instead as we are actively developing with it.

I actually tried using the AI Perception component previously, and couldn’t get it to work. No matter what values I put, the update event is never called, and in addition, it isn’t obvious how it’s even used (it only gives actors as arguments, where’s the additional data such as volume for hear events?)

The way that AIPerception currently works is that you add senses and they will return the actor(s) that triggered them. You can see the data for the area of sight/hearing in the “Sense Config” parameters. Here’s a screenshot of one of my tests:

Select the component, then in the details, hit the “+” next to “Senses Config” to start adding events for when the senses are triggered. You can then establish what sense will be “Dominant” as well.

I spoke with some AI developers and they are telling me that there are a lot of fixes coming for the component in 4.7.4 and 4.8 as well, so it may be a bit buggy as of this moment. If you encounter any bugs, just let us know and we can let you know if they are being fixed already.

Let me know if that helps you.

Yes, I already knew that, the update event is just never called, no matter what values I put for the senses, or what senses I use (tested only with sight and hearing).
I tried a simple test that prints something to the screen whenever the event is called.

And I’ll ask again - how would one be able to access something like the volume value of a hear event?

Hopefully the fixes involve removing the AI panel, it was pretty confusing until I realized it’s useless.

Thanks for replying.

I see what you mean now, sorry about the misunderstanding. Have you registered the sense to the character? Here’s an example:

36175-untitled.png

Once it is registered, it will be an active sense on the AI in the world.

I am currently contacting the developer making the specific features of the AIperception component about visualizing the area of each sense. He’s on vacation, but I’ll be able to get an answer to you for that once he’s back.

Ah, I wasn’t aware of the need to manually register entities.
With that, sight detection works, hearing still fails.

I think I’ll just wait with AI Perception until it’s a bit more mature, and use two PawnSensing components in the meantime.

That’s understandable. It will be in much better working order in the next release, AI senses are in a transitional period right now. Sorry about that.

I did find out that you can enable the debugging visualizers in the Editor Preferences > Gameplay Debugger menu. Check on the “Perception” checkbox.

Once it’s enabled you toggle AI debug in game by pressing '-key (preferably while looking at the AI you want to debug). If it doesn’t work and you’re in PIE/SIE, make sure the “AI debug” show flag is enabled on the viewport you’re playing in (it’s under “Developer”).

I hope that helps. Thank you for your patience!

I have exactly the same problem, that the OnPerceptionUpdated event is never called. I tried both, manually registering the stimuli source via BP as suggested above, as well as to set the “Auto register as as Source” flag in the perception stimuli source component. None of these helped. I am using 4.8. Any ideas what I might be missing here?