Skip to main content
ANY
SkillFreeBy GameSkill · tuned

Game AI: FSM, Behavior Trees & Pathfinding

/game-ai

NPC and enemy decision-making with state machines, behavior trees, steering and A* pathfinding, paired with your engine's navigation API.

License
Apache-2.0
By
By GameSkill
Download ZIP

Part of

Awesome Gamedev Agent Skills

77 portable SKILL.md skills across 12 engines (Godot, Unity, Unreal, Phaser, PixiJS, three.js, Bevy, pygame, LÖVE, Roblox, Defold, Ebitengine), with a router.

Tested by GameSkill

34/34 checks passed on Godot 4.7.2 (2026-10-30): trigger, a runnable example, a screenshot and self-check, one job per skill, and English + Chinese docs. Trigger checks match prompts against skill descriptions; they are not a live agent run.

Test report

What this skill does

When it triggers

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. …

GameSkill's tested copy

GameSkill's tuned build of this skill: the skill files from commit 19d93f97c9c1, plus our runnable example, test report, self-check list and Chinese guide, put through our skill process.

Download tested ZIP (35 KB)Roadmap: Gameplay mechanics

License: based on gamedev-skills/awesome-gamedev-agent-skills by gamedev-skills, under Apache-2.0. The ZIP keeps the license files (LICENSE, NOTICE) and lists everything GameSkill added in CHANGES.md.

Game AI: FSM, Behavior Trees & Pathfinding

Self-check

  • 启发值要匹配移动方式:4 方向用曼哈顿,8 方向用 octile,不能高估 / Match the heuristic to allowed moves; never overestimate.
  • 转向要朝下一个路点,不是直接朝目标 / Steer to the next waypoint, not straight to the goal.
  • 路径按计时器或目标换格时重算,不要每帧算 / Repath on a timer or when the goal changes tile, not every frame.
  • 状态转换写在状态里,不要到处散 if state == / Keep transitions inside states, not scattered if checks.
  • 多帧动作的行为树叶子要返回 RUNNING,否则每帧重来 / Multi-frame BT leaves must return RUNNING.

Install

Tell your AI

Install the skill from https://gameskill.dev/skills/game-ai/install.md

GameSkill's tested copy

Tested copy into .claude/skills/
mkdir -p .claude/skills
curl -fsSL https://gameskill.dev/dl/skills/game-ai.zip -o /tmp/gameskill-game-ai.zip
unzip -oq /tmp/gameskill-game-ai.zip -d .claude/skills
rm /tmp/gameskill-game-ai.zip

What you get

  • Worked steps: Finite state machine; Behavior tree tick; Steering: seek and arrive; A* heuristic must not overestimate
  • A pitfalls section with the mistakes to avoid
  • Bundled 2 reference docs the agent reads when needed

Good fit

  • Building enemy AI, an FSM or behavior tree, steering/flocking, or pathfinding

Try this prompt

Prompt
Make my enemies patrol, spot the player and chase them with A* pathfinding.

About this skill

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 pathfinding, or when the user mentions state machine, behavior tree, blackboard, A*, navmesh, seek, or patrol/chase.

From the game-ai SKILL.md in gamedev-skills/awesome-gamedev-agent-skills.

What's inside

  • Finite state machine (one state object, explicit transitions)
  • Behavior tree tick (composite nodes return a status)
  • Steering: seek and arrive (smooth, frame-rate independent)
  • A* heuristic must not overestimate (or paths stop being shortest)

FAQ

MATCHED PRO KIT$8.25/mo

Roguelike Combat & Boss Kit

6 production combat engines extracted from Zhaoshi Wulin in JS/TS, Godot 4 (.gd) & Unity (.cs): Boss Half-HP Hard Lock (100-70 -> 45 HP, shield never heal), Defense-Graded Rage, Dual-Channel Deterministic Crit, Clutch 1-HP Curve, Stagger AI & Priority Relic Bus.

  • EP28 Boss Phase Lock: one-shot gate, 45 HP hard clamp, Shield-only (0 heal) + moveset upgrade
  • EP27 Graded Rage + EP26 Deterministic Crit (17x1.5=25, zero 5-miss dry streaks)

Based on gamedev-skills/awesome-gamedev-agent-skills by gamedev-skills (Apache-2.0). The author's LICENSE and NOTICE files ship in the ZIP; ATTRIBUTION.md and CHANGES.md list the source commit and what GameSkill added.

Works well with

Skills the author points to as related or as the better fit for neighbouring tasks.

More from Awesome Gamedev Agent Skills

See all 44

Similar skills

Agent Sprite Forge
GDT
Skill
4.9k

Agent Sprite Forge

Five agent skills that turn one approved character still into a game-ready sprite set: one image-to-video clip per action, then deterministic Python tools key, register, loop, retime, palette-lock and export it for Godot, Aseprite and the web. Also maps, tiles and code-drawn art.

GodotWeb (Phaser / Three.js)Engine-agnosticClaude Code · Codex
earshot
ANY
Skill
By GameSkill

earshot: ears for coding agents (judge, find, time-align and make game sound on CPU)

Let an agent hear: rank sound-effect candidates against a description, find the clean trim in a long recording, tell real recordings from code-synthesised sound, check that every hit lands on its picture cut, and render effects from a bank of 252 code-made sounds. Runs locally on CPU with two open audio models (~1.1 GB, downloaded once); no API key needed.

Engine-agnosticClaude Code · Codex +3
One Sentence to Game
WEB
Skill
By GameSkill

One Sentence to Game (prompt, iterate, check)

A GameSkill original for any model: a round-1 prompt that turns one sentence into a small finished browser game, a one-change-per-round loop with a creation log, a reusable spec template, and a headless checker that reports console errors, blank frames and dead controls as PASS or FAIL. It does not promise one-shot.

Web (Phaser / Three.js)Engine-agnosticClaude Code · Codex +2
Playtest Report
ANY
Skill
By GameSkill

Playtest Report (Claude Code Game Studios)

Structured playtest report template, or turn existing playtest notes into structured feedback.

Engine-agnosticin Claude Code Game Studios