This skill gives an agent a method for building NPC decision-making in Unreal Engine 5.8. A Behavior Tree reads a Blackboard, decorators gate branches, services keep keys fresh, EQS picks locations or targets, and the AIController runs the tree. It also says when StateTree is the better fit.
It covers the failures people search for: AI that never starts, MoveTo that fails at once, trees that ignore a key change because Observer Aborts is None, and custom tasks that misbehave with several NPCs because they keep state in member variables.
What You Get
- An eight-step workflow from project discovery to verification
- A C++ AIController pattern that runs the tree and sets Blackboard values
- A reactive priority tree layout showing how Observer Aborts Both behaves
- A reference on writing custom BTTask nodes, instant and latent, with per-AI node memory, AbortTask, services and decorators
- A gotcha list for navmesh, key typos, shared node state and stripped EQS assets
Common Use Cases
- Fixing an enemy that just stands there or a MoveTo that fails instantly
- Building a combat, investigate and patrol tree driven by Blackboard keys
- Writing a custom C++ task that waits a random time and cancels cleanly when aborted
- Choosing between a Behavior Tree and StateTree for a new AI
What Makes It Unique
The skill is pinned to Unreal Engine 5.8 and compares Behavior Trees with StateTree, including the plugins StateTree needs and the task that runs a StateTree inside a branch. It insists on proof: a headless functional test that checks a Blackboard key or distance, with reading asset files not counting as a test. It leaves engine-neutral behavior tree code to a separate skill.
Under The Hood
The agent loads the SKILL.md, and the custom task reference only when it writes a C++ node. It runs shell commands in your project: find and grep to list AI assets and classes, the engine build script to compile, and the editor command line to validate assets and run automation tests headless. It writes C++ source and may suggest editor steps for you to do. It does not fetch web pages itself. An optional Epic editor connection can inspect assets live if you have it installed.