game-ai
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.
npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill game-ai --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Game AI: decisions, steering, and pathfinding Build believable NPC behavior from three separable layers: **decide** (what to do), **steer** (how to move there), and **path** (how to route around the map). Keep them decoupled — a behavior tree picks a target, the pathfinder produces waypoints, steering follows them. This skill teaches the engine-neutral algorithms; bind them to your engine via the related skills below. ## When to use - Use when implementing enemy/NPC logic: patrols, chase/flee, guard states, group movement, or "find a path to the player". - Use to choose between an **FSM** (few clear states), a **behavior tree** (many reactive behaviors with priorities), or **steering** (smooth local movement). - Use when integrating pathfinding: A* on a grid/graph, or driving an engine navmesh agent. **When *not* to use:** for the engine's concrete navmesh/agent API and baking, use `unity-navmesh`, `unreal-behavior-trees`, or Godot's `NavigationAgent2D/3D` (see that engine skill). For movement/collision feel, use `physics-tuning`. For spawning waves along lanes, see the `tower-defense` genre skill. ## Core workflow 1. **Pick the decision model by complexity.** 2–5 states with obv
- When to use
- Core workflow
- Patterns
- 1. Finite state machine (one state object, explicit transitions)
- 2. Behavior tree tick (composite nodes return a status)
- 3. Steering: seek and arrive (smooth, frame-rate independent)
- 4. A heuristic must not overestimate (or paths stop being shortest)
- Pitfalls
- References
- Related skills
What does the game-ai skill do?
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.
How do I install it?
Run `npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill game-ai --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From gamedev-skills/awesome-gamedev-agent-skills, a repository with 406 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
