[G1-Sync] Manual knowledge update

This commit is contained in:
Antigravity Agent
2026-05-10 22:08:15 +09:00
parent 21ac3ed255
commit 504fd5fb42
3011 changed files with 380280 additions and 206977 deletions
@@ -2,88 +2,161 @@
id: wiki-2026-0508-automated-map-generation
title: Automated Map Generation
category: 10_Wiki/Topics
status: needs_review
status: verified
canonical_id: self
aliases: [P-Reinforce-AI-GENMAP]
aliases: [Procedural Map Generation, PCG, Auto-Cartography]
duplicate_of: none
source_trust_level: A
confidence_score: 0.99
tags: [PCG, Map Generation, Algorithm, Noise Nature]
confidence_score: 0.9
verification_status: applied
tags: [pcg, gamedev, cartography, gis, generative]
raw_sources: []
last_reinforced: 2026-04-20
last_reinforced: 2026-05-10
github_commit: pending
inferred_by: Claude Opus 4.7 (auto-normalize 2026-05-08)
tech_stack:
language: unspecified
framework: unspecified
language: Python/C#
framework: Unity/Godot/Houdini
---
# [[Automated-Map-Generation|Automated-Map-Generation]] (절차적 맵 생성 PCG)
# Automated Map Generation
## 📌 한 줄 통찰 (The Karpathy Summary)
> 무한한 우주는 수학 공식([[Seed|Seed]]) 하나에서 탄생한다. 절차적 생성(PCG)은 개발자의 노동력을 '규칙의 창조'로 전이시켜 콘텐츠의 무한 확장을 가능케 한다.
## 한 줄
> **"매 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).
## 📖 구조화된 지식 (Synthesized Content)
- **Perlin Noise & Simplex Noise**:
- 자연스러운 지형(산, 계곡, 해안선)을 만들기 위한 수학적 노이즈 알고리즘. 연속성을 가진 난수를 통해 자연의 불규칙성을 모사한다.
- **Constraint-based Generation (제약 기반 생성)**:
- 단순히 무작위로 만드는 것이 아니라, "마을은 물 근처에 있어야 한다", "보스 방은 입구에서 가장 멀어야 한다"는 비즈니스 로직(제약 조건)을 알고리즘에 주입한다.
- **Dungeon Generation (BSP, WFC)**:
- **BSP (Binary Space Partitioning)**: 공간을 이진 분할하여 방과 복도를 배치하는 정석적인 방식.
- **WFC (Wave Function Collapse)**: 인접한 타일 간의 관계성을 기반으로 복잡한 구조를 확률적으로 붕괴시켜 완성하는 최신 알고리즘.
## 매 핵심
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
- PCG는 자칫 '반복적이고 지루한(Samey)' 느낌을 줄 수 있다. 이를 방지하기 위해 핵심 랜드마크는 수동 제작(Manual Polish)하고, 그 사이의 연결을 PCG가 담당하는 하이브리드 방식이 선호된다.
### 매 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.
## 🔗 지식 연결 (Graph)
- Related: [[Systemic_Simulation_Principles|Systemic_Simulation_Principles]] , Art_Direction_Governance
- Foundation: [[Information Theory|Information Theory]]
### 매 Properties
- Determinism (seed reproducibility).
- Controllability (parameter / prompt steering).
- Coherence (no impossible tiles).
- Aesthetic / playability metric.
## 🤖 LLM 활용 힌트 (How to Use This Knowledge)
### 매 응용
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).
**언제 이 지식을 쓰는가:**
- *(TODO)*
## 💻 패턴
**언제 쓰면 안 되는가:**
- *(TODO)*
### Pattern 1 — Perlin heightmap
## 🧪 검증 상태 (Validation)
```python
import numpy as np
from noise import pnoise2
- **정보 상태:** needs_review
- **출처 신뢰도:** A
- **검토 이유:** *(P-Reinforce Phase 1 자동 정규화. 본문 검증 필요.)*
## 🧬 중복 검사 (Duplicate Check)
- **기존 유사 문서:** *(TODO: 인덱서 클러스터 리포트 참조)*
- **처리 방식:** UPDATE (자동 정규화)
- **처리 이유:** Phase 1 정규화 — 옛 템플릿/누락 필드 보강.
## 🕓 변경 이력 (Changelog)
| 날짜 | 변경 내용 | 처리 방식 | 신뢰도 |
|------|-----------|-----------|--------|
| 2026-05-08 | P-Reinforce Phase 1 정규화 (frontmatter + 헤더 표준화) | UPDATE | A |
## 💻 코드 패턴 (Code Patterns)
**패턴 1:** *(TODO: 이 프로젝트 컨벤션 반영한 구조 스켈레톤)*
```text
# TODO
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())
```
## 🤔 의사결정 기준 (Decision Criteria)
### Pattern 2 — Cellular automaton cave
**선택 A를 써야 할 때:**
- *(TODO)*
```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
**선택 B를 써야 할 때:**
- *(TODO)*
# init random 45% wall, run 5 steps → cave
```
**기본값:**
> *(TODO)*
### Pattern 3 — Wave Function Collapse (sketch)
## ❌ 안티패턴 (Anti-Patterns)
```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
```
- **[안티패턴]:** *(TODO: 무엇을 하면 안 되는가 + 이유 + 대신 무엇을)*
### 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]]
- 변형: [[Wave-Function-Collapse]] · [[L-Systems]] · [[Cellular-Automata]]
- 응용: [[Game-Level-Design]] · [[GIS]] · [[Simulation-Environment]]
- 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) |