UAIPerceptionSystem

By design checks perception between hostile teams

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

AIModule

Header

/Engine/Source/Runtime/AIModule/Classes/Perception/AIPerceptionSystem.h

Include

#include "Perception/AIPerceptionSystem.h"

Syntax

class UAIPerceptionSystem : public UAISubsystem

Remarks

By design checks perception between hostile teams

Variables

Name Description

Protected variable

uint32: 1

 

bHandlePawnNotification

Protected variable

TArray< FDelaye...

 

DelayedStimuli

Protected variable

AIPerception::F...

 

ListenerContainer

Protected variable

float

 

NextStimuliAgingTick

Timestamp of the next stimuli aging

Protected variable

float

 

PerceptionAgingRate

Protected variable

TMap< const AAc...

 

RegisteredStimuliSources

Not a UPROPERTY on purpose so that we have a control over when stuff gets removed from the map

Protected variable

TArray< UAISens...

 

Senses

Protected variable

TArray< FPercep...

 

SourcesToRegister

Protected variable

FActorEndPlaySi...

 

StimuliSourceEndPlayDelegate

Constructors

Name Description

Public function

UAIPerceptionSystem

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Protected function

bool

 

AgeStimuli

(
    const float Amount
)

Returns true if aging resulted in tagging any of the listeners to process its stimuli (

Protected function

bool

 

DeliverDelayedStimuli

(
    EDelayedStimulusSorting Sorting
)

Sorts DelayedStimuli and delivers all the ones that are no longer "in the future"

Public function Static

UAIPerceptio...

 

GetCurrent

(
    UObject* WorldContextObject
)

Public function Static

UAIPerceptio...

 

GetCurrent

(
    UWorld& World
)

Protected function

AIPerception...

 

GetListenersMap()

Public function Static

TSubclassOf<...

 

GetSenseClassForStimulus

(
    UObject* WorldContextObject,
    const FAIStimulus& Stimulus
)

Public function Const

bool

 

IsSenseInstantiated

(
    const FAISenseID& SenseID
)

Public function Static

void

 

MakeNoiseImpl

(
    AActor* NoiseMaker,
    float Loudness,
    APawn* NoiseInstigator,
    const FVector& NoiseLocation,
    float MaxRange,
    FName Tag
)

Public function

void

 

OnEvent

(
    const FEventClass& Event
)

Public function Static

void

 

OnEvent

(
    UWorld* World,
    const FEventClass& Event
)

Public function

void

 

OnEventsBatch

(
    const TArray< FEventClass >& Event...
)

Public function

void

 

OnListenerConfigUpdated

(
    FAISenseID SenseID,
    const UAIPerceptionComponent& List...
)

Public function

void

 

OnListenerForgetsActor

(
    const UAIPerceptionComponent& List...,
    AActor& ActorToForget
)

Public function

void

 

OnListenerForgetsAll

(
    const UAIPerceptionComponent& List...
)

Protected function

void

 

OnListenerRemoved

(
    const FPerceptionListener& Updated...
)

Protected function

void

 

OnListenerUpdate

(
    const FPerceptionListener& Updated...
)

Protected function

void

 

OnNewListener

(
    const FPerceptionListener& NewList...
)

Protected function Virtual

void

 

OnNewPawn

(
    APawn& Pawn
)

Protected function

void

 

OnPerceptionStimuliSourceEndPlay

(
    AActor* Actor,
    EEndPlayReason::Type EndPlayReason
)

Protected function

void

 

PerformSourceRegistration()

Protected function Virtual

void

 

RegisterAllPawnsAsSourcesForSense

(
    FAISenseID SenseID
)

Iterates over all pawns and registeres them as a source for sense indicated by SenseID.

Public function

void

 

RegisterDelayedStimulus

(
    FPerceptionListenerID ListenerId,
    float Delay,
    AActor* Instigator,
    const FAIStimulus& Stimulus
)

Public function Static

bool

 

RegisterPerceptionStimuliSource

(
    UObject* WorldContextObject,
    TSubclassOf< UAISense > Sense,
    AActor* Target
)

Public function

FAISenseID

 

RegisterSenseClass

(
    TSubclassOf< UAISense > SenseClass
)

Public function

void

 

RegisterSource

(
    AActor& SourceActor
)

Registers given actor as a source for all registered senses

Public function

void

 

RegisterSource

(
    AActor& SourceActor
)

Registers a source of given sense's stimuli

Protected function

void

 

RegisterSource

(
    FAISenseID SenseID,
    AActor& SourceActor
)

Requests registration of a given actor as a perception data source for specified sense

Public function

void

 

RegisterSourceForSenseClass

(
    TSubclassOf< UAISense > Sense,
    AActor& Target
)

Public function

void

 

ReportEvent

(
    UAISenseEvent* PerceptionEvent
)

Public function Static

void

 

ReportPerceptionEvent

(
    UObject* WorldContextObject,
    UAISenseEvent* PerceptionEvent
)

Protected function Virtual

void

 

StartPlay()

Public function

void

 

UnregisterListener

(
    UAIPerceptionComponent& Listener
)

Public function

void

 

UnregisterSource

(
    AActor& SourceActor,
    const TSubclassOf< UAISense > Sense
)

Unregisters given actor from the list of active stimuli sources

Public function

void

 

UpdateListener

(
    UAIPerceptionComponent& Listener
)

Registers listener if not registered

Overridden from FTickableObjectBase

Name Description

Public function Virtual Const

TStatId

 

GetStatId()

Return the stat id to use for this tickable

Public function Virtual

void

 

Tick

(
    float DeltaTime
)

FTickableGameObject begin.

Classes

Enums

Name

Description

Protected enum

EDelayedStimulusSorting

Deprecated Variables

Name Description

Protected variable

uint32: 1

 

bStimuliSourcesRefreshRequired

This property will be removed in future versions. UnregisterSource is called by AActor.OnEndPlay delegate and will perform the cleanup.

Deprecated Functions

Name Description

Protected function

void

 

AgeStimuli()

Parameterless AgeStimuli has been deprecated, please use the other AgeStimuli flavor. To get behavior identical to the old one calls AgeStimuli(PerceptionAgingRate).

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss