procedural-generation

Installation
SKILL.md

Procedural Generation

Seeded algorithms, noise functions, and constraint propagation define replayable content generation.

Available Scripts

wfc_level_generator.gd

Expert Wave Function Collapse implementation with tile adjacency rules.

NEVER Do in Procedural Generation

  • NEVER forget to seed RNGrandi() without seed = same dungeon every time. Use seed(hash(Time.get_ticks_msec())) OR expose seed for speedrunning.
  • NEVER use randf() in _ready() for multiplayer — Each client calls _ready() at different times = desynced RNG = different dungeons. Use shared seed from server.
  • NEVER skip validation — Drunkard's walk dungeon with no exit? Playability fail. ALWAYS validate (e.g., A* from start to end) OR regenerate.
  • NEVER use noise.get_noise_2d() every frame — Calling noise 10,000x/frame = lag. Pre-generate heightmap in _ready(), cache in Array.
  • NEVER use BSP without minimum room size — Infinite splits = 1x1 rooms = crash. Set min_size (e.g., 6x6) to prevent over-subdivision.
  • NEVER ignore WFC contradictions — Wave Function Collapse fails when no valid tiles remain. MUST detect contradiction, backtrack OR restart generation.
  • NEVER block main thread for large generations — Generating 1000x1000 terrain in _ready() = freeze. Use worker thread OR split across frames with await.
Related skills

More from thedivergentai/gd-agentic-skills

Installs
1
GitHub Stars
166
First Seen
Feb 9, 2026