---
id: wiki-2026-0508-automated-map-generation
title: Automated Map Generation
category: 10_Wiki/Topics
status: verified
canonical_id: self
aliases: [Procedural Map Generation, PCG, Auto-Cartography]
duplicate_of: none
source_trust_level: A
confidence_score: 0.9
verification_status: applied
tags: [pcg, gamedev, cartography, gis, generative]
raw_sources: []
last_reinforced: 2026-05-10
github_commit: pending
tech_stack:
  language: Python/C#
  framework: Unity/Godot/Houdini
---

# Automated Map Generation

## 매 한 줄
> **"매 noise + constraint + agent — 매 hand-craft 의 X, 매 procedure 의 grow."**. Automated map generation 의 PCG (procedural content generation) 의 spatial subset — 매 1980 Rogue dungeon → Minecraft (Perlin) → 2026 의 Houdini node + WaveFunctionCollapse + diffusion-based terrain (LumaWorld, Genie 2). GIS 측 의 OpenStreetMap auto-vectorize from satellite (SAM-2 + DETR).

## 매 핵심

### 매 Approaches
- **Noise-based**: Perlin / Simplex / fBm — terrain heightmap.
- **Cellular automata**: cave / organic terrain (Game of Life variant).
- **L-systems**: vegetation / road network.
- **Wave Function Collapse (WFC)**: tile-based, constraint propagation.
- **Agent-based**: drunken walk, BSP partition.
- **Graph grammar**: dungeon room layout.
- **Diffusion / GAN**: 2024+ heightmap / texture from prompt.
- **Satellite → vector** (GIS): SAM-2 + OSM tagging.

### 매 Properties
- Determinism (seed reproducibility).
- Controllability (parameter / prompt steering).
- Coherence (no impossible tiles).
- Aesthetic / playability metric.

### 매 응용
1. Game level (Minecraft, NMS, Diablo).
2. Open-world terrain (UE5 PCG, Houdini).
3. GIS map auto-extraction.
4. Simulation environments (CARLA, Habitat).
5. Tabletop RPG (Watabou, Dungeon Alchemist).

## 💻 패턴

### Pattern 1 — Perlin heightmap

```python
import numpy as np
from noise import pnoise2

def heightmap(w, h, scale=80, octaves=5, seed=0):
    arr = np.zeros((h, w))
    for y in range(h):
        for x in range(w):
            arr[y, x] = pnoise2(x/scale, y/scale, octaves=octaves, base=seed)
    return (arr - arr.min()) / (arr.max() - arr.min())
```

### Pattern 2 — Cellular automaton cave

```python
def step(grid):
    h, w = grid.shape
    out = grid.copy()
    for y in range(1, h-1):
        for x in range(1, w-1):
            n = grid[y-1:y+2, x-1:x+2].sum() - grid[y, x]
            out[y, x] = 1 if n > 4 else 0
    return out

# init random 45% wall, run 5 steps → cave
```

### Pattern 3 — Wave Function Collapse (sketch)

```python
# tiles: list of (id, neighbor constraint dict)
def wfc(grid_size, tiles):
    grid = [[set(t.id for t in tiles) for _ in range(grid_size)] for _ in range(grid_size)]
    while not all_collapsed(grid):
        c = lowest_entropy_cell(grid)
        grid[c.y][c.x] = {random.choice(list(grid[c.y][c.x]))}
        propagate(grid, c, tiles)
    return grid
```

### Pattern 4 — BSP dungeon partition

```python
def split(rect, depth=4):
    if depth == 0 or min(rect.w, rect.h) < 12: return [rect]
    if rect.w > rect.h:
        x = random.randint(rect.x + 4, rect.x + rect.w - 4)
        return split(Rect(rect.x, rect.y, x - rect.x, rect.h), depth-1) + \
               split(Rect(x, rect.y, rect.x + rect.w - x, rect.h), depth-1)
    # similar for vertical
```

### Pattern 5 — Diffusion terrain (2026)

```python
# Pseudo: Stable Diffusion XL fine-tuned on heightmap atlas
heightmap = sd_terrain.generate(prompt="alpine valley with river, top-down heightmap, 16-bit grayscale")
mesh = heightmap_to_mesh(heightmap, vertical_scale=200.0)
```

### Pattern 6 — Satellite → OSM (SAM-2)

```python
# Mask building footprints from satellite tile, convert to OSM polygons
masks = sam2.predict(satellite_tile)
polygons = [mask_to_polygon(m) for m in masks if m.score > 0.8]
osm_xml = polygons_to_osm(polygons, tag={"building": "yes"})
```

## 매 결정 기준

| 상황 | Approach |
|---|---|
| Continuous terrain | Perlin / Simplex / fBm |
| Organic cave | Cellular automaton |
| Tile-based level (puzzle) | WFC |
| Dungeon rooms | BSP + corridor connect |
| Open-world AAA | Houdini + UE5 PCG |
| Prompted asset | Diffusion (SDXL terrain LoRA) |
| GIS extraction | SAM-2 + DETR + OSM tagging |

**기본값**: Perlin for terrain, WFC for tile-based, BSP for dungeons.

## 🔗 Graph
- 부모: [[Procedural-Content-Generation]] · [[Computational-Geometry]]
- 변형: [[Cellular-Automata]]
- 응용: [[GIS]]
- Adjacent: [[Perlin-Noise]] · [[Diffusion-Models]] · [[Geographic-Information-Systems]]

## 🤖 LLM 활용
**언제**: parameter tuning suggestions, prompt-to-terrain via diffusion, level metric scoring (playability / aesthetic), debug seed reproduction.
**언제 X**: hand-crafted narrative levels, regulatory cartography (use authoritative source).

## ❌ 안티패턴
- **No seed log**: bug 의 reproduce 불가.
- **Pure noise = boring**: 매 noise 의 only 의 no landmark — overlay POI / agent 추가.
- **Unconstrained WFC**: contradictory tile set → infinite backtrack.
- **Diffusion without metric guard**: visual nice but topologically broken (impassable cliff).

## 🧪 검증 / 중복
- Verified (Shaker et al. "Procedural Content Generation in Games", Houdini docs, WFC Maxim Gumin).
- 신뢰도 A.

## 🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — FULL content (Perlin, WFC, BSP, diffusion, SAM-2) |
