ai-game-world-design
Complete mastery guide for designing and building AI-powered game worlds — procedural world generation, NPC behavior trees, LLM-driven dialogue systems…
by nirholas★ 289 GitHub stars
Install ai-game-world-design in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
About this skill
AI Game World Design — From First Principles
This skill teaches you to architect game worlds where AI doesn't just play — it narrates, adapts, economizes, and breathes life into every NPC, quest, and ecosystem. You'll learn to build worlds that feel alive because they actually are.
Core Philosophy
┌─────────────────────────────────────────────────────────┐
│ THE LIVING WORLD MANIFESTO │
├─────────────────────────────────────────────────────────┤
│ │
│ A great AI game world has three properties: │
│ │
│ 1. EMERGENT — behaviors arise that designers │
│ never explicitly programmed │
│ │
│ 2. REACTIVE — the world changes in response │
│ to player actions, not just scripted triggers │
│ │
│ 3. PERSISTENT — consequences compound over time, │
│ creating unique histories for every playthrough │
│ │
│ AI is the engine that makes all three possible. │
│ │
└─────────────────────────────────────────────────────────┘
World Generation
Procedural Terrain
The foundation of any game world is geography. Procedural generation creates infinite variety from algorithmic rules.
| Technique | Best For | Scale |
|---|---|---|
| Perlin/Simplex Noise | Terrain heightmaps, caves | Continental |
| Wave Function Collapse | Tiled environments, dungeons | Room/zone |
| L-Systems | Vegetation, branching structures | Object |
| Voronoi Diagrams | Biome boundaries, territories | Regional |
| Agent-Based | City layouts, road networks | City |
| Grammar-Based | Building interiors, quest structures | Structure |
Layered Noise for Terrain
import numpy as np
def generate_terrain(width, height, octaves=6):
"""Generate realistic terrain using layered Perlin noise."""
terrain = np.zeros((width, height))
for octave in range(octaves):
frequency = 2 ** octave
amplitude = 0.5 ** octave
# Each octave adds finer detail at lower amplitude
noise_layer = perlin_noise_2d(width, height, frequency)
terrain += noise_layer * amplitude
# Apply erosion simulation
terrain = simulate_hydraulic_erosion(terrain, iterations=50000)
# Place biomes based on elevation + moisture
biomes = classify_biomes(terrain, moisture_map(terrain))
return terrain, biomes
Biome Classification
Elevation ↑
│
│ 🏔️ Snow Peak (> 0.85)
│ 🪨 Rocky Alpine (0.70 - 0.85)
│ 🌲 Forest (0.40 - 0.70, moisture > 0.5)
│ 🌾 Grassland (0.40 - 0.70, moisture < 0.5)
│ 🏜️ Desert (0.20 - 0.40, moisture < 0.3)
│ 🌊 Ocean (< 0.20)
│
└──────────────────────── Moisture →
Wave Function Collapse for Dungeons
WFC uses constraint propagation to generate environments where every tile is compatible with its neighbors:
class WFCGenerator:
def __init__(self, tileset, grid_size):
self.grid = [[set(tileset.all_tiles) for _ in range(grid_size)]
for _ in range(grid_size)]
def collapse(self):
while not self.is_fully_collapsed():
# 1. Find cell with lowest entropy (fewest possibilities)
cell = self.lowest_entropy_cell()
# 2. Collapse it to a single tile (weighted random)
self.observe(cell)
# 3. Propagate constraints to neighbors
self.propagate(cell)
def propagate(self, cell):
"""Remove incompatible tiles from neighbors recursively."""
stack = [cell]
while stack:
current = stack.pop()
for neighbor in self.get_neighbors(current):
removed = self.constrain(neighbor, current)
if removed:
stack.append(neighbor)
NPC Intelligence
Behavior Trees
The industry standard for NPC decision-making:
[Selector]
/ | \
[Guard] [Patrol] [Idle]
/ \
[Detect [Attack
Enemy] Sequence]
/ \
[Move To] [Strike]
[Range]
class BehaviorTree:
"""Composable NPC decision system."""
@selector # Try children left-to-right, stop at first success
def root(self, npc, world):
return [
self.combat_branch,
self.social_branch,
self.economic_branch,
self.patrol_branch,
self.idle_branch
]
@sequence # All children must succeed
def combat_branch(self, npc, world):
return [
lamb
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
FAQ
What does the ai-game-world-design skill do?
Complete mastery guide for designing and building AI-powered game worlds — procedural world generation, NPC behavior trees, LLM-driven dialogue systems, emergent storytelling, economy simulation, player modeling, and real-time difficulty adaptation. Covers the full stack from world-building fundamentals to integrating large language models as game directors, with special focus on crypto-native economies (token rewards, NFT items, on-chain achievements) and agent-based game architectures.
How do I install the ai-game-world-design skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the ai-game-world-design skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
skill-creator
AnthropicCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…