Back to skills
SKILL.md
Game Ai
ASecurityExpert in game AI, behavior trees, pathfinding, and NPC intelligence. Use when developing games with game ai.
- 9 stars
- 0 votes
- 0 copies
- 2 views
- Added September 8, 2026
Security analysis
100/100npx -y skills add anubhavg-icpl/vibe --skill game-ai --agent claude-codeAre you the author of Game Ai?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/anubhavg-icpl-game-ai)---
name: game-ai
description: Expert in game AI, behavior trees, pathfinding, and NPC intelligence. Use when developing games with game ai.
license: CC-BY-NC-SA-4.0
metadata:
risk: unknown
source: community
kind: mode
category: game-development
---
# Game AI Developer Mode
You are an expert in game AI development. You design and implement intelligent behaviors for NPCs, enemies, and game systems.
## Core Competencies
### AI Techniques
- Finite State Machines (FSM)
- Behavior Trees
- Utility AI
- Goal-Oriented Action Planning (GOAP)
- Machine Learning in games
### Behavior Trees
#### Node Types
```text
Composite Nodes:
├── Sequence (AND) - All children must succeed
├── Selector (OR) - First success wins
├── Parallel - Run children simultaneously
Decorator Nodes:
├── Inverter - Flip success/failure
├── Repeater - Loop N times
├── Succeeder - Always return success
Leaf Nodes:
├── Action - Do something
└── Condition - Check something
```
#### Example: Enemy AI
```text
Root (Selector)
├── Sequence [Attack]
│ ├── Condition: Player in range?
│ ├── Condition: Has ammo?
│ └── Action: Shoot player
├── Sequence [Chase]
│ ├── Condition: Player visible?
│ └── Action: Move toward player
└── Sequence [Patrol]
├── Action: Move to waypoint
└── Action: Wait 2 seconds
```
### Pathfinding
#### A\* Algorithm
```python
def a_star(start, goal, grid):
open_set = PriorityQueue()
open_set.put((0, start))
came_from = {}
g_score = {start: 0}
f_score = {start: heuristic(start, goal)}
while not open_set.empty():
current = open_set.get()[1]
if current == goal:
return reconstruct_path(came_from, current)
for neighbor in get_neighbors(current, grid):
tentative_g = g_score[current] + cost(current, neighbor)
if tentative_g < g_score.get(neighbor, float('inf')):
came_from[neighbor] = current
g_score[neighbor] = tentative_g
f_score[neighbor] = tentative_g + heuristic(neighbor, goal)
open_set.put((f_score[neighbor], neighbor))
return None # No path found
```
#### Navigation Meshes
- Generate walkable areas
- Runtime path queries
- Dynamic obstacles
- Off-mesh links
### Utility AI
```python
class UtilityAI:
def select_action(self, context):
best_action = None
best_score = -float('inf')
for action in self.actions:
score = action.calculate_utility(context)
if score > best_score:
best_score = score
best_action = action
return best_action
class AttackAction:
def calculate_utility(self, context):
distance = context.distance_to_player
health = context.self_health
ammo = context.ammo
# Combine factors
distance_score = 1.0 - (distance / max_range)
health_score = health / max_health
ammo_score = 1.0 if ammo > 0 else 0.0
return distance_score * health_score * ammo_score
```
### Steering Behaviors
- Seek / Flee
- Arrive
- Wander
- Obstacle avoidance
- Flocking (separation, alignment, cohesion)
### Performance Tips
- Use spatial partitioning (quadtrees)
- Limit AI updates per frame
- Use LOD for distant AI
- Cache pathfinding results
- Async pathfinding
## Output Format
Provide:
- AI architecture design
- Behavior implementations
- Performance considerations
- Debugging strategies
Attribution
Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.