game-ai
Skill4 starsChanged 3 months agoMITView on GitHub
Design NPC behaviour: behaviour trees, state machines, pathfinding, perception and difficulty tuning. Use when designing behavior trees, state machines, or enemy AI.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- gamedev-skills/awesome-gamedev-agent-skillstheir own version, first seen Oct 23, 2026
- ukanwat/aaabenchtheir own version, first seen Aug 15, 2026
- ukanwat/overtimetheir own version, first seen Aug 15, 2026
- ukanwat/selfstartertheir own version, first seen Aug 15, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- gamedev-skills/awesome-gamedev-agent-skills★ 6.4ksame name
- ukanwat/aaabench★ 399same name
- ukanwat/overtime★ 399same name
- ukanwat/selfstarter★ 399same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository47 other files it gives its agents.
- anti-cheatSkill
- blender-add-on-engineerSkill
- blender-animationSkill
- blender-modelingSkill
- blender-toolingSkill
- game-audio-engineerSkill
- game-audioSkill
- game-build-pipelineSkill
- game-designerSkill
- game-designSkill
- game-ideationSkill
- game-monetization-designerSkill
- game-monetizationSkill
- game-performanceSkill
- game-uiSkill
- game-version-controlSkill
- godot-gameplay-scripterSkill
- godot-multiplayer-engineerSkill
- godot-shader-developerSkill
- level-designerSkill
- level-designSkill
- narrative-designerSkill
- narrative-designSkill
- playtest-feedback-analyzerSkill
- playtestingSkill
- production-planningSkill
- roblox-avatar-creatorSkill
- roblox-experience-designerSkill
- roblox-systems-scripterSkill
- tech-artSkill
- technical-artistSkill
- unity-architectSkill
- unity-architectureSkill
- unity-editor-tool-developerSkill
- unity-multiplayer-engineerSkill
- unity-multiplayerSkill
- unity-shader-graph-artistSkill
- unity-shadersSkill
- unity-toolingSkill
- unreal-multiplayer-architectSkill
- unreal-multiplayerSkill
- unreal-systems-engineerSkill
- unreal-systemsSkill
- unreal-tech-artSkill
- unreal-technical-artistSkill
- unreal-world-builderSkill
- unreal-worldsSkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 49
Before executing a lethal attack, NPCs must telegraph intent through audio cues ("Flanking left!", "Grenade out!"), wind-up animations, or …
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
game-ai
Core Philosophy
Game Artificial Intelligence (AI) is not academic machine learning trying to predict the future or beat human chess grandmasters. Game AI is an entertainment and pacing illusion. An NPC that plays with superhuman accuracy, pixel-perfect aim, and zero hesitation is frustrating and un-fun to play against. Game AI must provide clear telegraphing, readable tactical decision-making, believable sensory perception, and dynamic difficulty calibration that gives players the thrilling sensation of outsmarting a competent opponent.
4-Step Game AI Architecture
Step 1: Decision-Making Architectures: Behavior Trees vs FSMs
- Behavior Trees (The Industry Standard for Combat AI):
- Built on hierarchical nodes evaluated from left-to-right:
- Composites:
- Sequence ($ o$): Executes children sequentially; fails if any child fails (e.g. Has Weapon $ o$ Reload $ o$ Aim).
- Selector ($?$): Executes children until one succeeds (e.g. Flee If Low Health $?$ Melee Attack $?$ Seek Cover).
- Decorators: Conditional gates (e.g. Invert, Time Limit, Cooldown).
- Leaves / Tasks: Concrete executable actions (e.g. MoveToPosition, PlayAnimation).
- Composites:
- Built on hierarchical nodes evaluated from left-to-right:
- Finite State Machines (FSMs):
- Best for simple ambient creatures or discrete bosses (States: Patrol, Investigate, Chase, Attack, Flee).
Step 2: Sensory Perception Systems (Sight & Sound)
- Vision Cones (Sight Perception):
- Evaluate target visibility using 3 gates:
- Distance Check: Is player within sight radius ($D \le R_{text{max}}$)?
- Field of View Angle: Is the dot product of enemy forward vector and direction-to-player $\ge \cos( heta / 2)$?
- Line of Sight (Raycast): Does a physics raycast from enemy eyes to player torso hit world geometry or the player?
- Evaluate target visibility using 3 gates:
- Acoustic Perception (Hearing):
- Propagate sound events through the game world (e.g. Gunshot = 40m radius; Footsteps = 8m radius).
- Alerted NPCs transition to an Investigate state directed toward the sound origin.
Step 3: NavMesh Pathfinding & Tactical Flanking
- A Pathfinding on Navigation Meshes*:
- NPCs query pre-baked NavMeshes for path traversal.
- Reciprocal Velocity Obstacles (RVO / ORCA): Implement local collision avoidance so groups of 5 enemies don't march in an identical single file or jam doorway entrances.
- Tactical Cover Finding & Flanking:
- Query Environmental Query Systems (EQS): Sample candidate points around the player, score points based on cover geometry angle, distance, and line-of-sight protection.
Step 4: Telegraphing & The Illusion of Competence
- Telegraphing Intent:
- Before executing a lethal attack, NPCs must telegraph intent through audio cues ("Flanking left!", "Grenade out!"), wind-up animations, or laser sight lines.
- The "Stormtrooper Effect" (Controlled Incompetence):
- First shot fired at an unaware player should intentionally miss by 1 meter to alert the player and create adrenaline before dealing real damage.
Deliverable Format: Enemy AI Behavior Tree Specification (ENEMY-AI-SPEC.md)
# Combat Enemy AI Behavior Tree Specification: [NPC Archetype]
## 1. Perception Parameters
- **Sight Distance**: 25 meters (Day) / 14 meters (Night)
- **Field of View Angle**: 110 degrees
- **Hearing Radius**: Gunfire = 50m | Running Footsteps = 12m | Crouch Walk = 0m (Silent)
- **Reaction Time Buffer**: 350ms delay between target acquisition and attack trigger
## 2. Master Behavior Tree HierarchyRoot (Selector) ├── [Decorator: Health < 20%] -> Sequence (Emergency Flee) │ ├── FindCoverAwayFromPlayer() │ ├── MoveToCover() │ └── PlayAnimation("Heal") ├── [Decorator: CanSeePlayer == True] -> Selector (Combat Branch) │ ├── [Decorator: InMeleeRange] -> Sequence (Melee Strike) │ │ ├── PlayAudioBark("Charge!") │ │ ├── TelegraphWindup(400ms) │ │ └── ExecuteMeleeDamage() │ └── Sequence (Ranged Engagement) │ ├── Selector (Take Cover or Flank) │ │ ├── [Decorator: InCover] -> AimAtPlayer() │ │ └── MoveToFlankPosition() │ └── FireBurst(3_rounds) └── Sequence (Patrol / Idle) ├── PickNextPatrolWaypoint() ├── MoveToWaypoint() └── WaitRandom(2s, 5s)
## 3. Audio Barks & Player Feedback
- **On Spotting Player**: *"Contact! Nine o'clock!"*
- **On Grenade Toss**: *"Frag out! Take cover!"*Worked Example: Fixing "Unfair" Sniper Enemy AI
- Problem: Playtesters hated a sniper enemy because it instantly killed players across the map without warning.
- Remediation: Added a visible red laser sight line sweeping across the ground for 2.0 seconds before firing, paired with a distinct audio charge-up whine.
- Outcome: Player deaths felt fair and avoidable; playtest satisfaction scores jumped from 32% to 88%.
Verification Checklist
- Perception system validates distance, FOV cone, and physics raycast line-of-sight.
- Behavior tree prioritizes survival/flee states before offensive actions.
- All lethal attacks include readable telegraphing animations or audio barks.
- NavMesh agents implement local avoidance (RVO) to prevent doorway crowding.
- Enemy reaction times include realistic human-like delay buffers (200–400ms).
Anti-Patterns
- Omniscient AI: Letting enemies know player coordinates through solid walls without perception checks.
- Frame-Zero Snapping: Enemies pivoting $180^\circ$ and firing with 100% accuracy in a single frame.
- The Single-File Lemmings: Having 8 enemies march in a straight line through a single hallway to be slaughtered one by one.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

