AI Perception bAutoRegisterAllPawnsAsSources?

Hi,

I’m trying to get a handle on what this flag is for and why it’s needed (/ only used for “Sight”). I’m still learning the Perception code, but the bAutoRegister… flag appears to be adding any existing (and thence every new) Pawn to a list of those “perceived” by the Sense, via RegisterSource (which is only defined currently for Sight).

It would appear that this generates far more sight targets than necessary, as anything derived from Pawn will be picked up and tracked - there doesn’t seem to be any filtering going on (for example, by picking targets with the AIPerceptionStimuliSource component).

If this flag was set to “false” and StimuliSources with “Sight” enabled were set to “Auto Register as Source”, would this achieve a similar (but filtered) result?

I’m likely to have a lot of Pawns in the world and would ideally like to keep the Sense system as lean as possible.

Is there any way to change the default “true” on Sense_Sight to anything else without just editing the code (I note all of the member variables have blueprint metadata, but I can’t find an instance of the Sight class anywhere to actually edit them)?

Many thanks.

Hey Stuart,

To disable the “auto register” mechanic for Sight sense all you need to do is add following lines to your DefaultEngine.ini

[/Script/AIModule.AISense_Sight]
bAutoRegisterAllPawnsAsSources=false

If this flag was set to “false” and StimuliSources with “Sight” enabled were set to “Auto Register as Source”, would this achieve a similar (but filtered) result?

It should, yes.

Word of justification, the current default behavior of “register all” is done for simplicity sake, so that stuff works out of the box. Most people won’t have a lot of pawns :wink:

Let me know if you have any follow-up questions.

Cheers,

–mieszko

Aside from it being “DefaultGame.ini”, it would appear I’m learning something every day about this magical engine. Many thanks for the quick response :slight_smile: