Skip to content
SkillModel-led2,435 tokens in use

AI Behavior Trees and Utility AI

Engine-neutral behavior tree and utility AI code in C# for NPCs: Blackboard, reactive composites, decorators and response-curve scoring, with a headless tick test.

9,682 stars on the repository Apache License 2.0gamedev-skills/awesome-gamedev-agent-skills · skills/disciplines/ai-behavior-trees-utility-ai
npx skills add gamedev-skills/awesome-gamedev-agent-skills
View source

Install command as written in the repository's README

Skill label

measured from its files

What installing AI Behavior Trees and Utility AI costs

94tokens idle
2,435tokens in use
12,379tokens, up to

Idle is what sits in context while the skill is installed. In use is its instructions, loaded when it runs. Up to adds the files its instructions link. Counts are approximate, made offline with cl100k_base.

Model dependence Model-led

Script-ledMixedModel-led

Mostly instructions, so how well it works depends on the model that follows them.

This describes the skill's structure, how much of it is scripts. It does not say how well it works.

Touches

Nothing detected: no shell, network, file writes, git or credentials in its files.

Declared tags come from the skill's frontmatter; detected ones from its scripts, its code blocks and the commands it names in inline code. This is detected, not audited.

How it scores

Quality

How well the skill is written, counted from its own files: its frontmatter, its steps, examples, stated output and constraints, its size and whether every file it ships is one it names.How we score it →
Excellent
  • Frontmatter12/15
  • Structure25/25
  • Examples12/15
  • Output15/15
  • Size15/15
  • Resources15/15

Security

Starts at 100 and loses points for each thing in the skill's files that a reader should look at first.How we score it →
Excellent

No findings.

Repository health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
Good
  • Development activity92
  • Maintenance96
  • Community60
  • Maturity24
  • Momentum40

This skill gives an agent a working method for NPC decision code that ports to any engine. It covers a reusable behavior tree runtime (Blackboard, leaves, composites, decorators), a utility scorer built from response curves, and the hybrid where a tree branch hands a graded choice to utility.

Its focus is the lifecycle contract, who resets what and when, since that is where most behavior tree bugs sit: enemies that keep chasing after losing sight, restart an action every frame or flip-flop between choices.

What You Get

  • A lifecycle contract for node status and Reset, with a Selector example that resumes a Running child
  • A utility scoring pattern that maps each fact to 0..1 through a curve and keeps a zero as a veto
  • A headless tick test shape that counts ticks and resets so lifecycle bugs show up as numbers
  • A gotcha list covering guards that are never re-checked, cooldown bypass, Parallel restarts, softmax overflow and GC spikes

Common Use Cases

  • Fixing an enemy that keeps chasing after the player is out of sight
  • Building a reusable behavior tree runtime with Blackboard, composites and decorators
  • Adding a utility decider that picks which attack or target to use
  • Cutting AI cost for many agents with a decision cadence of 5 to 15 Hz and staggered ticks

What Makes It Unique

It is written around bugs, not around a library. It names the exact failure for each symptom, such as a memory Sequence that never rechecks its guard, and it tells the agent to extend an existing behavior tree plugin when the project has one. It hands FSMs, steering and pathfinding to game-ai and Unreal assets to unreal-behavior-trees.

Under The Hood

The skill is instructions and reference markdown only, with no scripts. The agent reads the SKILL.md and, when needed, four reference files in its references folder covering the tree core, utility system, worked examples and scaling pitfalls. It tells the agent to read the existing AI code in the project and to run the project’s own test runner for the tick test. It does not fetch web pages, call APIs or write files on its own.

Join founders building with open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on SubstackJoin 750+ subscribers