Agent skill · gamedev-skills
ai-behavior-trees-utility-ai
Build a production behavior-tree runtime (Blackboard, action/condition leaves, sequence/selector/parallel composites, decorators) and a Utility AI system (response curves — linear, exponential, sigmoid, quadratic — considerations, and action evaluators), plus hybrid BT-drives-Utility agents. Use when implementing a reusable behavior-tree or utility-based decision system, or tuning enemy/NPC decisions beyond a simple FSM, or when the user mentions behavior tree, blackboard, decorator, selector, sequence, tick status, utility AI, response/scoring curve, or consideration. For choosing between FSM/BT/steering or for pathfinding, use game-ai; for Unreal's BehaviorTree/Blackboard assets, use unreal-behavior-trees.
What it needs
About 4k tokens when loaded.
What this skill does
Behavior Trees & Utility AI Two complementary ways to structure NPC decision-making, plus how to combine them. A behavior tree (BT) expresses structured, prioritized, reactive logic as a tree that is "ticked" each step. Utility AI answers "how much do I want each option right now?" by scoring actions with normalized curves and picking the best. Ship believable agents by using a BT for structure and Utility AI where graded trade-offs matter. This skill is the implementation companion to game-ai (which helps you choose between FSM / BT / steering / pathfinding). Read game-ai to pick a model; read this to build the runtime. When to use Use to build a reusable BT runtime: a Blackboard, Node base, action/condition leaves, Sequence/Selector/Parallel composites, and decorators (Inverter, Cooldown, Repeat). Use to build a Utility AI decider: response curves, considerations, and an evaluator that scores and selects actions (max, softmax, or weighted-random for variety). Use to build hybrid AI — a BT whose leaf delegates the "which attack / which target" choice to a utility evaluator. When not to use: to choose between FSM, BT, steering, or pathfinding, and for A/navmesh routing, use game-ai. For Unreal's asset-based BehaviorTree/Blackboard, BTTask/BTService and AIController, use unreal-behavior-trees. For the navmesh agent that moves the NPC, use unity-navmesh or the engine's navigation node. Core workflow 1. Pick the model. Structured, prioritized, interruptible behavior → BT. Continuous "score every option" decisions (targeting, needs, item choice) → Utility. Both → hybrid. 2. Design the Blackboard first. One typed key/value store per agent is the shared memory that decouples nodes; leaves read/write it and never hold references to each other. 3. Write leaves. Conditions return Success/Failure immediately; actions return Running across frames until they finish. Keep leaves small and side-effect-explicit. 4. Compose. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills gamedev-skills/ai-behavior-trees-utility-ai