t1k:designer:systems:procedural-generation
| Field | Value |
|---|---|
| Module | systems |
| Version | 1.7.2 |
| Effort | medium |
| Tools | — |
Keywords: generation, PCG, procedural generation, random
How to invoke
Section titled “How to invoke”/t1k:designer:systems:procedural-generationGame Procedural Generation
Section titled “Game Procedural Generation”When This Skill Triggers
Section titled “When This Skill Triggers”- Generating maps, dungeons, or level layouts procedurally
- Rolling procedural item stats, affixes, or loot
- Implementing wave function collapse (WFC) or tile-based generation
- Designing roguelike run structure (floors, rooms, shops)
- Creating seed-based reproducible content
- Validating procedurally-generated content for playability
Core PCG Concepts
Section titled “Core PCG Concepts”Generation Algorithms
Section titled “Generation Algorithms”- BSP (Binary Space Partitioning): split rect recursively → rooms at leaves → corridors between
- Drunkard’s Walk: random walk carves passages → organic cave-like layouts
- Room-and-corridor: place N rooms (no overlap) → connect with L-shaped corridors
- Cellular automata: random fill → smooth passes (alive if 5+ neighbors) → natural caves
- WFC (Wave Function Collapse): tiles with adjacency rules → guaranteed valid layouts
- Prefab stitching: pre-designed rooms + procedural connections (Dead Cells approach)
- Validation: A* from start→exit, all rooms reachable, key items on longest path
→ See references/dungeon-generation.md for algorithm decision tree, BSP implementation, validation
Item Affix Generation
Section titled “Item Affix Generation”- Affix system: prefix + base + suffix (e.g. “Cruel Longsword of Fire”)
- Pool weighting: Common 60% / Rare 25% / Epic 10% / Legendary 5%
- Stat rolling:
base_value × (1 + random(0, tier_bonus)) × rarity_multiplier - Smart loot: 30% bias toward player’s equipped slot type, 70% random
- Seed formula:
item_seed = hash(entity_id, encounter_index, world_seed)→ reproducible
→ See references/item-generation.md for affix pools, stat ranges, anti-duplicate patterns
Roguelike Run Structure
Section titled “Roguelike Run Structure”- Floor template: 6-10 rooms → elite room → shop → 6-10 rooms → boss
- Room type mix: combat 60% / treasure 15% / event/choice 15% / shop 10%
- Difficulty scaling:
enemy_hp × (1 + floor × 0.4),enemy_atk × (1 + floor × 0.25) - Item pacing: 1 item per 2-3 rooms, guaranteed rare per floor, shop every 8-12 rooms
- Run length: 30-45 min (casual), 60-90 min (hardcore)
- Meta-progression: permanent unlocks between runs (new items in pool, starting bonuses)
→ See references/roguelike-structure.md for floor templates, meta-progression, risk/reward rooms
Quick Reference
Section titled “Quick Reference”| Use Case | Algorithm |
|---|---|
| Natural caves | Cellular automata |
| Structured dungeons | BSP or room-and-corridor |
| Organic passages | Drunkard’s Walk |
| Tile-based valid layouts | Wave Function Collapse |
| Handcrafted + procedural | Prefab stitching |
| Item stats | Weighted affix pool + seed hash |
Anti-Patterns
Section titled “Anti-Patterns”| # | Anti-Pattern | Problem | Fix |
|---|---|---|---|
| 1 | Pure random placement | Unsolvable maps, isolated rooms | Validate with A* after generation |
| 2 | No seed system | Non-reproducible bugs | hash(entity_id, encounter, world_seed) |
| 3 | Stat ranges too wide | Useless low-roll items | Floor = base_value × 0.8 minimum |
| 4 | Monotonous output | Feels generated, not designed | Mix prefab rooms with procedural connections |
| 5 | No pity in loot rolls | Legendary drought → quit | Guaranteed rare escalation per floor |
Cross-References
Section titled “Cross-References”rpg-game-design— Item rarity tiers, loot tables, power budgetsgame-economy-design— Loot drop rates as economy faucets- engine inventory skills (auto-activated via registry) — procedural item integration
puzzle-game-design— Procedural puzzle generation patterns- engine scene skills (auto-activated via registry) — arena tile/geometry generation
Reference Files
Section titled “Reference Files”| File | Coverage |
|---|---|
references/dungeon-generation.md | BSP, cellular automata, WFC, validation |
references/item-generation.md | Affix pools, stat rolling, smart loot, seeds |
references/roguelike-structure.md | Floor templates, room types, meta-progression |
Gotchas
Section titled “Gotchas”- Seeded reproducibility is a contract — if any RNG call is unseeded, replays diverge silently.
- Wave-function-collapse outputs need playability validators — beautiful unsolvable rooms are a worse failure than ugly playable ones.
- Affix rolling distributions need explicit min-quality floors — without one, the bottom 10% of items are de facto trash and feel like bugs.