Game AI Design
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.
Related Skills
Turn vague requests into structured prompts with role, task, context, and constraints, outputting only usable prompts without executing the task.
Provides multi-turn emotional companion chat through a third-party Agent API and supports continuing sessions via session_id.
An evaluation-driven workflow for diagnosing, optimizing, validating, and logging Agent Skills based on design patterns and anti-patterns.
Analyzes web form structure in a headed browser, fills choice-based answers, verifies them against a docx file, and leaves personal fields for manual input.