Core concepts
The parts of an agent
| Part | Lives on | Job |
|---|---|---|
UPulseAIAgentComponent | Pawn | Profile, team, difficulty, group, home, patrol route. Replicates one net state (awareness, target, LOD, group role) and announcements for UI. |
APulseAIController | Controller | Applies the profile on possess: perception, awareness, brain. Answers friend or foe through the attitude solver. A character that orients itself to its movement turns to the focus while one is set (bTurnToFocus), so a standing agent faces its target. |
UPulseAIAwarenessComponent | Controller (server) | What the agent knows (FPulseAIAwarenessMemory): targets, how sure it is, the current target. |
UPulseAIBrainComponent | Controller (server) | Runs the profile’s StateTree, thinks less when far from players. |
UPulseAIProfile | Asset | Everything that makes a kind of agent: StateTree, team, perception, speeds, leash, difficulty, extensions. |
UPulseAISubsystem | World (server) | All agents: LOD, alarms, group roles, freezing. |
The agent sits on the pawn so any controller can read it. APulseAIController is optional: an own controller can create the awareness and brain components and call UPulseAIAwarenessComponent::Setup and UPulseAIBrainComponent::RunStateTree itself.
Data flow
- Perception (sight, hearing, damage) reports to the awareness component; own sources call
ReportStimulus. - Awareness updates its memory on a timer: the rules in
Pulse::AI::Memoryreturn the new memory and a change list, and only then the component sends the StateTree events (Pulse.AI.Event.TargetSpotted,.AwarenessChanged,.TargetChanged,.Damaged,.Alarm,.Noise,.TargetLost). - The brain’s StateTree reacts with transitions and runs tasks. Tasks read awareness and agent through the controller.
- Awareness and target are mirrored to the agent’s net state (
FPulseAIAgentNetState) and replicate, so clients can show them.
The StateTree schema
The schema Pulse AI (UPulseAIStateTreeSchema) is the engine’s AI schema (context AIController, pawn as Actor) plus the context Agent and Awareness, so bindings reach them directly. The Pulse AI nodes only need the AIController, so they also run in trees with the engine’s StateTree AI Component schema.
Extension points
| Extension | Base | Where |
|---|---|---|
| Target scorer | FPulseAITargetScorer | Profile: Target Scorers |
| Perception modifier | FPulseAIPerceptionModifier | Profile: Perception Modifiers |
| Attitude solver | FPulseAIAttitudeSolver | Project Settings > Pulse > AI |
| Profile extension | FPulseAIProfileExtension | Profile: Extensions, or per difficulty |
| StateTree nodes | FPulseAITaskBase, FPulseAIConditionBase, FPulseAIEvaluatorBase, FPulseAIConsiderationBase | Your module |
All are instanced structs: derive in C++, they show up in the editor’s pickers. They keep no per-agent state.