AI Agent Hub
Back to skills
🤖

Game AI Design

AI Agent Updated 2026.08.29

Paste the following prompt into your AI chat to install this skill:

Please install @user_3c6cb52e/game-ai-2ock according to https://skillhub.cn/install/skillhub.md.

About this skill

Problem: NPC logic becomes tangled

In patrol, chase, guard, and group movement, a common failure is mixing state checks, movement smoothing, and path recomputation in one place. As behaviors grow, agents jitter, hug corners, oscillate states, and recompute paths every frame. The root issue is that decide, steer, and path are not separated.

How it works: layered game AI

The skill splits game AI into decide, steer, and path. The decision layer outputs intent, such as a target position or action; steering handles smooth local motion; pathfinding produces waypoints on a grid, graph, or navmesh. It guides model selection: use an FSM for 2–5 clear states, a behavior tree for many prioritized reusable behaviors, and utility scoring when options are continuously weighted. Key practices include choosing an admissible A* heuristic, following the next waypoint instead of the goal, caching paths, and recomputing only on a timer or when the target moves. For multi-frame actions, behavior tree leaves should return RUNNING so animations or movement do not restart every tick. Debugging should rely on observing the agent, drawing the path, and checking for stuck or oscillating states.

Boundaries

It is engine-neutral and does not replace concrete Unity, Unreal, or Godot navigation APIs. Collision feel, wave spawning, and genre-specific gameplay flows are better handled by related skills. Use this skill for the algorithmic structure behind believable NPC behavior.

Use Cases

  • Design patrol, chase, flee, and return-to-point logic for tower defense enemies, choosing between simple FSM states and priority-based behavior tree branches.
  • Implement grid A* pathfinding, cache the resulting waypoints, and recompute only on a timer or when the target changes tiles to avoid frame rate drops.
  • Debug behavior tree leaves that drive multi-frame actions, ensuring they return RUNNING until completion so walking or animation does not restart every tick.
  • Integrate a 3D character with an engine navmesh agent, separating high-level intent, waypoint following, and local steering so agents round corners cleanly.

Best For

  • Unity client engineer adding patrol, chase, and corner-stuck fixes to enemy units.
  • Level designer implementing guard, hit, and counterattack priorities and interruption logic in behavior trees.
  • Game systems engineer adding A* and waypoint caching to avoid per-frame pathfinding frame rate drops.
  • Indie game developer tuning NPC movement feel by separating steering, collision radius, and repath boundaries.