Unreal Engine 5 (UE 5.8) NPC AI with Behavior Trees, Blackboards, EQS and StateTree: decorators with Observer Aborts, C++ BTTask nodes and running trees from an AIController. Use for UE enemy AI, BT_, BB_ or EQS_ assets, "my AI just stands there" or "MoveTo fails". Not for engine-neutral BT or utility code (`ai-behavior-trees-utility-ai`) or choosing FSM vs BT (`game-ai`).
Ships in gamedev. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Author NPC decision-making in UE5: a Behavior Tree reads a Blackboard, decorators gate branches, services keep keys fresh, EQS picks locations or targets, and an AIController runs it all. StateTree is the alternative for mode-based AI. Targets UE 5.8.
BT_/BB_ assets, decorators, services, custom BTTask/BTService/
BTDecorator C++ nodes, or the AIController that runs the tree.EQS_ assets, Run EQS Query, the EQS Testing Pawn).ST_ assets, UStateTreeAIComponent) or mixing it with a BT.When not to use: writing your own behavior-tree or utility-AI runtime, outside Unreal's
assets → ai-behavior-trees-utility-ai. Choosing an AI architecture or engine-neutral
steering and pathfinding → game-ai. The pawn and controller classes themselves →
unreal-cpp-gameplay.
Both ship in UE 5.8 and Behavior Trees are not deprecated. Default: keep whatever the
project already uses. For a new AI, pick StateTree when the behavior is a set of modes with
explicit transitions (patrol, alert, combat), and a Behavior Tree when it is a priority list
that must re-evaluate when Blackboard values change. They also combine: the BT task
Run State Tree (UBTTask_RunStateTree) runs a StateTree inside a branch, and StateTree has
its own Run Env Query task for EQS. StateTree on an AI needs the StateTree and
GameplayStateTree plugins and a UStateTreeAIComponent on the AIController, with an asset
that uses the StateTree AI Component schema. Ask before adding a second system beside the
first.
EngineAssociation in the .uproject (this skill targets
5.8). List existing AI assets and classes so you extend them instead of duplicating:
find Content -name "BT_*" -o -name "BB_*" -o -name "EQS_*" -o -name "ST_*" and
grep -rn "AAIController\|RunBehaviorTree\|UStateTreeAIComponent" Source. C++ AI code needs
"AIModule" in the module's *.Build.cs.BB_) first. One typed key per fact the AI remembers (TargetActor,
LastKnownLocation, bIsInvestigating). The tree references this asset.RunBehaviorTree(BT) in
OnPossess; that also initializes the Blackboard. Set the pawn's Auto Possess AI to
"Placed in World or Spawned" and its AI Controller Class.void AEnemyAIController::OnPossess(APawn* InPawn)
{
Super::OnPossess(InPawn);
if (BehaviorTree) // UPROPERTY(EditAnywhere) TObjectPtr<UBehaviorTree>
{
RunBehaviorTree(BehaviorTree); // also initializes the Blackboard the BT references
}
}
void AEnemyAIController::SetTarget(AActor* Target)
{
if (UBlackboardComponent* BB = GetBlackboardComponent())
{
BB->SetValueAsObject(TEXT("TargetActor"), Target); // must match the BB key name
}
}
// BB->ClearValue(TEXT("TargetActor")) drops the tree back to a lower-priority branch.
ROOT
└── Selector
├── Sequence [Blackboard: TargetActor Is Set, Observer Aborts: Both]
│ ├── MoveTo (TargetActor)
│ └── Attack
├── Sequence [Blackboard: LastKnownLocation Is Set, Observer Aborts: Lower Priority]
│ ├── MoveTo (LastKnownLocation)
│ └── Wait 3s, then clear the key
└── Sequence (patrol)
├── Run EQS Query (EQS_NextPatrolPoint -> PatrolLocation)
└── MoveTo (PatrolLocation)
Both on the combat branch means: start combat the moment TargetActor is set, and leave it
the moment it is cleared.
Say which of these you actually ran; reading the assets is not a test.
Engine/Build/BatchFiles/Build.bat <Project>Editor Win64 Development -Project="<path>.uproject" -WaitMutex; Linux and macOS use
Engine/Build/BatchFiles/Linux/Build.sh or Mac/Build.sh with the matching platform) and
fix every error and warning in your files.UnrealEditor-Cmd <Project>.uproject -run=DataValidation -unattended
runs the project's asset validators; fix every error it reports.FinishTest. Run it headless and read the
exit status and report:
UnrealEditor-Cmd <Project>.uproject -ExecCmds="Automation RunTest Project.Functional Tests;Quit" -unattended -nullrhi -ReportExportPath="<dir>".
Run -ExecCmds="Automation List;Quit" first if the test path is unclear. The Functional
Testing Editor plugin must be enabled. If the map won't run without a renderer, swap
-nullrhi for -RenderOffscreen (needs a GPU).unreal-mcp skill is installed and the editor's MCP server is
running, you can inspect the BT and StateTree assets live through it. The checks above do
not need it.RunBehaviorTree never ran.MoveTo fails instantly: no navmesh (add a Nav Mesh Bounds Volume and rebuild paths), or
the goal is off the navmesh.None. Self aborts
its own branch when the condition fails, Lower Priority lets it interrupt branches to its
right, Both does both.InProgress and never called FinishLatentTask, or
its abort path never finishes.SetValueAsObject("Taget", ...) does nothing, silently. Use a
FBlackboardKeySelector or one shared constant for the key name.bStripFromClientBuilds), so client code must not run it.references/custom-bttask.md before writing a C++ UBTTaskNode: instant and latent
tasks, per-AI node memory, AbortTask, typed Blackboard access, key selectors, and the base
classes for custom services and decorators.ai-behavior-trees-utility-ai: hand-written BT and utility AI runtimes, any engine.game-ai: choosing FSM, BT, steering or pathfinding.unreal-cpp-gameplay: the AIController and pawn classes, module setup.fps-shooter, tower-defense: genres that compose enemy AI.Last verified: 2026-11-11.
UEnvQuery gained bStripFromClientBuilds.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
80 skills in this plugin
/ai-behavior-trees-utility-aiEngine-neutral behavior tree and utility AI code for NPCs in any language: Blackboard, reactive composites, decorators and response-curve scoring. Use when an enemy keeps chasing after losing sight, restarts its action every frame or flip-flops between choices. Not for FSMs, steering or pathfinding (`game-ai`) or Unreal BT, EQS and StateTree (`unreal-behavior-trees`).
/audio-designEngine-neutral game audio technique: bus layout, volume sliders in decibels, loudness, ducking music under dialogue, adaptive music and SFX variation, with Godot, Unity and FMOD/Wwise mappings. Use when mixing a game, making music react to combat, fixing repetitive footsteps or beat sync, or a mix that clips or pumps. Not for the Godot audio API (`godot-audio`).
//gamedev:unreal-behavior-treesfrom gamedev
npx claudepluginhub cirobarone78/games-skill --plugin gamedev