ReportNoiseEvent working on actors without AiPerceptionStimuliSource

Ai has hearing as sense. I make a generic actor (stock AActor) do ReportNoiseEvent and the Ai hear it. What does AiPerceptionStimuliSource do then? i thought that you needed to have that component to be detected by any sense by the Ai

Hi, from looking through the source code:

(-) AISense has a virtual function called RegisterSource which has no implementation, it is just virtual void RegisterSource(AActor& SourceActors){} which will be called every time a new actor gets registered

(-) All AI senses (e. g. sight, hearing, damage,…) inherit from AISense

(-) AISense_Hearing does not override RegisterSource, meaning for hearing it won’t matter anything whether pawns get registered or not. AISense_Sight does override RegisterSource though, so there it matters.

(-) ReportNoiseEvent is a static function inside AISense_Hearing which means it can be called from everywhere and I don’t see any checks about the Instigator being registered.


So seems to me that AIPerceptionStimuliSource is for the sight sense and/or if you want to build your own sense inheriting from AISense

That seems that is the case, however i don’t understand why most tutorials say that AISense_Hearing must be added as sense to the Stimuli component. Placebo?

No idea. I guess either it makes some difference somewhere between adding it or not, or who made the tutorial doesn’t know that it makes no difference and just thinks it needs to be added. So if the tutorial is from someone from epic who also works on AI then I would guess that it has some sense to add it, otherwise I would guess placebo =)