Skip to content
Back to skills

Game Ai

ASecurity

Expert 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
developmentpythongonodedebuggingperformance

Security analysis

A100/100

Scanned September 8, 2026

npx -y skills add anubhavg-icpl/vibe --skill game-ai --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Game Ai?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Game Ai
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/anubhavg-icpl-game-ai/badge)](https://www.skillsdirectory.com/skills/anubhavg-icpl-game-ai)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.