UAISense Age


Quick question about the age of a sense. In my testing so far a stimulus seems to always be 0. Is there anything you need to do to make a stimuli age or should this happen automatically?

1 Like

Stimuli age automatically with a fixed frequency (configurable via UAIPerceptionSystem.PerceptionAgingRate, you can set it in DefaultGame.ini). One thing to note though is that this is the age of the last stimuli, which means if something is in sight then sight-stimulus age will be always 0 (disclaimer: this rule has some border-cases). It’s basically “last time this thing has been sensed with given sense”.



Ok, that makes sense with sight but how come hearing is always at 0 as well?

Well, that would mean the stimuli is not getting aged :frowning: I can’t really see in the code why that could be the case. Would you mind sharing a stripped-down version of your project?

Unless! The default aging interval is 0.3 seconds, so if you’re making noises more often than that then that’s would explain it! :smiley:

I might have found a bug in stimuli aging. I’ll get back once it’s fixed.

It turned out that in some setups the timer responsible for stimulus aging was not ticking. This has been fixed and will ship with 4.8.

1 Like

Thanks for looking into that!

It still seems like stimuli aren’t aging on their own unless i’m just not understanding how to use them. I also was expecting TargetPerceptionUpdated to get fired when the current target expires but it doesn’t. Seems like you have to manually track the expiration?

1 Like