AI_BaseAgentController — AI Controller
Blueprint Spec — UE 5.5–5.7
Parent Class
AIController
Dependencies
Purpose
Central brain for enemy AI characters. Manages perception, decision-making via Behavior Trees, high-level state machine transitions, alert level propagation, and combat coordination. Possesses BP_EnemyBase pawns and controls their actions through Blackboard values and Behavior Tree execution.
Variables
| Name |
Type |
Description |
AIProfile |
DA_AIProfile |
Configuration asset |
PossessedEnemy |
BP_EnemyBase |
Current pawn reference |
BlackboardComp |
UBlackboardComponent |
Blackboard instance |
BehaviorTreeComp |
UBehaviorTreeComponent |
Behavior tree runner |
PerceptionComp |
BPC_AIPerceptionSystem |
Sensory input |
StateMachine |
BPC_AIStateMachine |
State logic |
AlertSystem |
BPC_AlertSystem |
Threat level |
bIsActive |
Bool |
Enabled / disabled |
AggressionRange |
Float |
Engage distance |
SuspicionRange |
Float |
Investigate distance |
CombatRange |
Float |
Preferred combat distance |
HomeLocation |
FVector |
Spawn or patrol anchor |
LastKnownPlayerLocation |
FVector |
Blackboard updated |
bHasLineOfSight |
Bool |
LOS status |
LostPlayerTimer |
Float |
Seconds since last sighting |
Blackboard Keys
| Key Name |
Type |
Description |
SelfActor |
Object |
Self reference |
TargetActor |
Object |
Current threat |
TargetLocation |
Vector |
Last known threat location |
HomeLocation |
Vector |
Patrol anchor |
AIState |
Enum (EAIState) |
Current state |
AlertLevel |
Float |
0.0–1.0 awareness |
bHasLOS |
Bool |
Line of sight |
bIsInvestigating |
Bool |
Searching location |
PatrolIndex |
Int |
Current waypoint |
CombatStance |
Enum |
Aggressive / Defensive |
StimulusLocation |
Vector |
Sound/sight trigger point |
Enums
| Enum |
Values |
Description |
EAIState |
Idle, Patrol, Suspicious, Alerted, Combat, Searching, Fleeing, Disabled |
AI behavior state |
Functions
| Name |
Inputs |
Outputs |
Description |
OnPossess |
Pawn: APawn |
— |
Bind blackboard, run BT |
OnUnPossess |
— |
— |
Cleanup |
InitializeAI |
Profile: DA_AIProfile |
— |
Set up components |
SetAIState |
NewState: EAIState |
— |
State machine transition |
UpdatePerception |
Stimulus: FAIStimulus |
— |
Process sensory input |
SetTarget |
Target: AActor |
— |
Update blackboard target |
ClearTarget |
— |
— |
Target lost |
StartInvestigation |
Location: FVector |
— |
Move to investigate |
RequestReinforcements |
— |
— |
Alert nearby allies |
GetCombatReadiness |
— |
Float |
Based on health, ammo, alert |
OnTakeDamage |
DamageResult: FDamageResult |
— |
React to being hit |
CanSeeTarget |
— |
Bool |
LOS check |
LostSightOfTarget |
— |
— |
Start search timer |
ReturnToPatrol |
— |
— |
Reset to patrol state |
GetHomeLocation |
— |
FVector |
Patrol anchor |
SetFocalPoint |
Location: FVector |
— |
Aim facing direction |
Event Dispatchers
| Name |
Parameters |
Fired When |
OnAIStateChanged |
OldState: EAIState, NewState: EAIState |
State transition |
OnTargetAcquired |
Target: AActor |
New threat detected |
OnTargetLost |
— |
Target out of range/perception |
OnAlertRaised |
AlertLevel: Float |
Alert threshold crossed |
OnReinforcementRequested |
Location: FVector |
Call for backup |
Blueprint Flow
Communications With
Reuse Notes
- Designed as parent for all enemy types (humanoid, creature, drone)
- Perception, alerts, and state machine are swappable components
- Behavior tree is data-driven via AIProfile
- All decision values (ranges, thresholds, speeds) come from data asset
- Renamed from
BPC_AIControllerBase to AI_BaseAgentController per Master naming convention.
- Cross-references updated:
BPC_PerceptionComponent → BPC_AIPerceptionSystem, BPC_BehaviorTreeManager → BB_AgentBoard, BPC_HealthComponent → BPC_HealthSystem.