AI Agent Hub
Back to skills
🤖

Game AI Design

AI Agent Updated 2026.08.30

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

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

About this skill

Problem

NPC logic is often written as “see the target, move straight there,” which causes agents to jitter against walls, get stuck on corners, or overwrite each other’s state. The harder part is decoupling decision, routing, and motion: what to do, where to route, and how to move should not be tangled together.

How It Works

  • Decision model: use an FSM for a small number of clear states, a behavior tree for priorities and interruption, or utility scoring for continuous preferences.
  • Pathfinding: choose a grid, waypoint graph, or navmesh that fits the level; generate a path with A*, and avoid recomputing every frame.
  • Steering: follow the next waypoint with seek / arrive, rather than aiming directly at the goal, so agents round corners correctly.
  • Verification: check whether the agent reaches the goal, sticks to corners, or oscillates between states; draw the path and current state while tuning.

Boundaries

This fits engine-neutral NPC behavior architecture. Use the relevant Unity, Unreal, or Godot skill for concrete navmesh and agent APIs. Movement feel, collision radius, and tower-defense spawn lanes are out of scope.

Use Cases

  • Add patrol, chase, and retreat states to an enemy NPC and switch behavior when the player is seen.
  • Implement grid pathfinding so a unit can reach a target around obstacles from a spawn point.
  • Steer AI along waypoints so agents round corners instead of moving straight into walls.
  • Debug stuck, oscillating, or unreachable agents by drawing the path and current state while tuning.

Best For

  • Gameplay engineer owning enemy/NPC logic who needs to separate patrol, chase, and guard states.
  • Level or AI programmer working with grid or waypoint maps who needs to choose a graph and implement A*.
  • Movement engineer needing smooth agent motion who wants waypoint steering without wall-hugging.
  • Systems engineer maintaining multi-unit tactics who needs reusable FSM, behavior tree, and pathfinding patterns.