ai-behavior-trees-util…
Build a production behavior-tree runtime (Blackboard, action/condition leaves, sequence/selector/parallel composites, decorators)…
Design NPC and enemy decision-making with finite state machines, behavior trees, steering behaviors, and A* pathfinding — engine-neutral algorithms that pair with the detected engine's navigation API. Use when building enemy AI, an FSM or behavior tree, steering/flocking, or
Claude Code
$ npx -y skills add gamedev-skills/awesome-gamedev-agent-skills --skill game-ai --agent claude-code
Codex
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill game-ai -a codex -y
Cursor
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill game-ai -a cursor -y
Gemini CLI
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill game-ai -a gemini-cli -y
GitHub Copilot
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill game-ai -a github-copilot -y
OpenCode
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill game-ai -a opencode -y
Windsurf
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill game-ai -a windsurf -y
name: game-ai description: > Designs engine-neutral enemy and NPC AI: picks FSM, behavior tree, utility or GOAP, and builds perception, steering and A* pathfinding. Use for patrol and chase, "find a path to the player", agents stuck on corners or AI that sees through walls. Not for BT or utility code (`ai-behavior-trees-utility-ai`), Unreal AI (`unreal-behavior-trees`) or Unity NavMesh (`unity-navmesh`).
Split every agent into layers that pass one small value to the next: **perceive** (facts on a Blackboard) → **decide** (an intent such as "go to X", "attack Y") → **path** (waypoints) → **steer** (a velocity) → **animate**. Most "dumb AI" bugs are a layer doing another layer's job: a state that raycasts, a pathfinder called every frame, steering that ignores the path.
**Not this skill:** BT and utility runtimes go to `ai-behavior-trees-utility-ai`; Unreal `BehaviorTree`, EQS and StateTree go to `unreal-behavior-trees`; Unity `NavMeshSurface` and `NavMeshAgent` go to `unity-navmesh`. Movement and collision feel go to `physics-tuning`.
| Situation | Default | |---|---| | 2-6 states, transitions obvious (door, turret, simple guard) | FSM | | Several states share exits (stunned, dead, alerted from anywhere) | Hierarchical FSM: a parent state owns the shared exits | | Many prioritized, interruptible behaviors, reused across enemy types | Behavior tree, built with `ai-behavior-trees-utility-ai` | | Graded trade-offs (which target, heal or attack, needs) | Utility scoring, same skill; usually inside a BT branch | | Multi-step plans with preconditions the designers want to emerge | GOAP; only if a BT cannot express it, because plans are hard to debug |
Common shipping mix: an FSM for the top mode (Idle, Combat, Dead) with a BT inside Combat. Start with the FSM; promote a state to a BT when its transitions stop fitting on one screen.
1. **Read the project first.** Engine, existing AI code, navigation (navmesh, `AStarGrid2D`, a tile grid), and how enemies find the player today. Extend what exists. 2. **Write perception once.** One sensor per agent writes `target`, `last_known_pos`, `can_see`, `heard_at` to a Blackboard on a timer (5-10 Hz). Decisions read those facts; they never raycast. 3. **Pick the model** from the table and keep transitions inside states (or a table), not in scattered `if state == ...` checks. 4. **Path on the coarsest graph that works** (waypoints or a nav grid beats a dense pixel grid), cache the path, and follow the next waypoint with steering. 5. **Add stuck and fairness guards** (see Gotchas) before tuning numbers. 6. **Verify with runnable checks**, not just by watching:
cost. Any mismatch means the heuristic or step costs are wrong.
transitions per second for one agent means missing hysteresis.
progress toward its waypoint in 2 s. Then watch it with the path, current state and sight cone drawn on screen.
**FSM**
without calling it. Route the first state through the same `change_state()` as every other.
Queue the next state and apply it after `update()` returns.
at the boundary. Use separate enter and exit thresholds (chase at 10, give up at 14) and a minimum time in state of about 0.3-0.5 s.
**Perception**
cos(half_angle)`), then one raycast. Only survivors pay for the ray; stagger rays across frames.
a gap at the waist. Cast to two or three points (head, chest) and accept any hit.
reading the player's live position after sight is lost. Delay the first reaction by roughly 0.2-0.5 s, or fill an awareness meter faster at close range, so players can react.
**Steering**
freezes at the wall. Use priority truncation: apply avoidance first and spend the remaining force budget on lower behaviors.
orbit the point. Advance when within `max(radius, speed * dt)`.
neighbor radius.
path and feed its desired velocity into your steering (Godot: `NavigationAgent2D/3D` `velocity` and `velocity_computed` when avoidance is on; Unity: see `unity-navmesh`).
**Pathfinding**
√2; if diagonals cost 1 use Chebyshev; terrain weights below 1 break every grid heuristic.
neighbors are open. Godot `AStarGrid2D` defaults to `DIAGONAL_MODE_ALWAYS`, which cuts corners; set `DIAGONAL_MODE
<img src="docs/assets/awesome-gamedev-agent-skills-banner.png" width="820" alt="awesome-gamedev-agent-skills — game-dev skills for AI coding agents.
Build a production behavior-tree runtime (Blackboard, action/condition leaves, sequence/selector/parallel composites, decorators)…
Implement game audio practice — bus/mixer architecture and gain in decibels, ducking (sidechain), adaptive/dynamic music via…
Build game cameras that feel good — 2D follow with a deadzone, look-ahead, smoothing, and level-bounds clamping; 3D third-person…
Plan, generate, source, normalize, and validate cohesive visual game assets. Use for art direction, style bibles, sprites,…
Build branching dialogue and narrative — a node/choice graph with conditions, variables, and localization hooks — and choose…
Add "juice" and game feel that makes actions satisfying — screen shake, hit-stop/freeze frames, tweened/eased motion, squash &…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.