Download

AI Perception FAIStimulus Tag Whats it for

Hi

AI Perception uses a struct called FAIStimulus .
Inside this struct it has member called Tag.
What is this member variable used for. The documentation has zero info on this.

Each AI perception entry sends you an actor and a FAIStimulus.
The actor has its own Tag, so whats the Tag inside FAIStimulus.

Cheers

Hi, I use it for hearing stimuli to differentiate between different “types” of noise events. E. g. if the AI hears an explosion/weapon I want it to react differently than hearing footsteps. Without having that tag I would have no idea how to achieve that… =)

Thanks for the info.

Does that mean the tag inside FAiStimulus is there for developer to use as he sees fit.
Meaning your code updates the tag when you receive stimulus.

For actors we create them and add tags if we need them.

For FAiStimulus , the engine creates this sends it to you when there is stimulus, and you decide to tag it or not on reception.

Sorry if the question sounds nooby, am abit new to the engine, am gona put a printf on the FAiStimulus tag in a minute .Just to see if its empty.

The only reason i would tag FAiStimulus when i get PecerptionUpdated, is if am saving the Stimulus for further processing later.

Unlike the actor tag that comes with the perceptionUpdate, i simply check the actor tag there and then and react, i cant understand why one would tag FAiStimulus, unless you sending it into a container/buffer to process later.

So am still confused regards the use case.

So far i have only used sight stimulus so might be something about hearing stimulus that i dont know.

cheers

I set the tag when I create Stimulus Event, not in the AI Perception Component.

For FAiStimulus , the engine creates this sends it to you when there is stimulus

So far i have only used sight stimulus so might be something about hearing stimulus that i dont know.

Sight sense updates on tick and the Stimulus there is created under the hood inside the Update function. The other senses work event driven. So you manually report a Stimulus event to the perception system, so there you can set the tag when you create the Stimulus event. For sight sense I don’t see any usage for the tag inside the Stimulus.

Thanks a much for the explanation cheers