procedural-generation
Skill870 starsChanged 21 days agoMITView on GitHub
Use when implementing procedural generation — noise-based terrain, BSP dungeons, cellular automata caves, wave function collapse, and seeded randomness in Godot 4.3+
2 other projects use a version of this.
Adopted by
Most recently taken up by
- jammyfu/open-game-skillstheir own version, first seen Oct 11, 2026
- ismael-joffroy-chandoutis/claude-skills-publictheir own version, first seen Mar 30, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- jammyfu/open-game-skills★ 12same name
- ismael-joffroy-chandoutis/claude-skills-public★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository62 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- authoring-godot-prompter-skillsSkill
- releasing-godot-prompterSkill
- 2d-essentialsSkill
- 3d-essentialsSkill
- ability-systemSkill
- addon-developmentSkill
- ai-navigationSkill
- animation-systemSkill
- assets-pipelineSkill
- audio-systemSkill
- beehaveSkill
- camera-systemSkill
- component-systemSkill
- csharp-godotSkill
- csharp-signalsSkill
- dedicated-serverSkill
- dependency-injectionSkill
- dialogue-managerSkill
- dialogue-systemSkill
- event-busSkill
- export-pipelineSkill
- gdextensionSkill
- gdscript-advancedSkill
- gdscript-patternsSkill
- godot-brainstormingSkill
- godot-code-reviewSkill
- godot-debuggingSkill
- godot-grillSkill
- godot-mentorSkill
- godot-optimizationSkill
- godot-project-setupSkill
- godot-testingSkill
- godot-uiSkill
- hud-systemSkill
- input-handlingSkill
- inventory-systemSkill
- limboaiSkill
- localizationSkill
- math-essentialsSkill
- mobile-developmentSkill
- multiplayer-basicsSkill
- multiplayer-syncSkill
- multithreadingSkill
- particles-vfxSkill
- phantom-cameraSkill
- physics-systemSkill
- player-controllerSkill
- popochiuSkill
- rendering-pipelineSkill
- resource-patternSkill
- responsive-uiSkill
- save-loadSkill
- scene-organizationSkill
- shader-basicsSkill
- state-machineSkill
- tween-animationSkill
- using-godot-prompterSkill
- web-exportSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
All examples target Godot 4.3+ with no deprecated APIs.
- Distinctive: line 16
Always use seeds for reproducible generation.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Procedural Generation in Godot 4.3+
All examples target Godot 4.3+ with no deprecated APIs. GDScript is shown first, then C#.
Related skills: 2d-essentials for TileMapLayer usage, 3d-essentials for 3D terrain meshes, math-essentials for vectors and transforms, godot-optimization for chunk loading and performance.
1. Seeded Randomness
Always use seeds for reproducible generation. This enables shareable seeds, replay, and deterministic testing.
GDScript
# RandomNumberGenerator — per-instance, seedable
var rng := RandomNumberGenerator.new()
func generate_level(level_seed: int) -> void:
rng.seed = level_seed
var width: int = rng.randi_range(20, 40)
var height: int = rng.randi_range(15, 30)
var enemy_count: int = rng.randi_range(3, 8)
var treasure_chance: float = rng.randf_range(0.05, 0.15)
# AVOID: Global randf()/randi() — one shared generator, randomized at startup
# and advanced by every other caller, so a sequence is hard to reproduce
# USE: rng.randf(), rng.randi(), rng.randf_range(), rng.randi_range()C#
private RandomNumberGenerator _rng = new();
public void GenerateLevel(ulong levelSeed)
{
_rng.Seed = levelSeed;
int width = _rng.RandiRange(20, 40);
int height = _rng.RandiRange(15, 30);
int enemyCount = _rng.RandiRange(3, 8);
float treasureChance = _rng.RandfRange(0.05f, 0.15f);
}Tip: Generate a seed from a string for shareable level codes:
var level_seed: int = "MyLevel".hash()(C#:GD.Hash("MyLevel"))
2. Noise-Based Generation (FastNoiseLite)
FastNoiseLite for height maps, biome distribution, 2D terrain. Key params: noise_type (Perlin / Simplex / Cellular / Value), frequency (lower = larger features), seed. For terrain, sample noise at each tile coord, threshold the value to pick a tile.
See references/noise-generation.md for the basic noise-map recipe, noise-type reference table, and 2D terrain + TileMapLayer walkthrough.
3. BSP Dungeon Generation
Binary Space Partitioning recursively splits a rectangle into smaller rectangles, carves a room inside each leaf, connects siblings with corridors. Produces grid-aligned room-based dungeons (think roguelike).
See references/bsp-dungeons.md for the full recursive partition + room placement + corridor connection algorithm in GDScript + C#.
4. Cellular Automata (Cave Generation)
Fill a grid with random walls/floors at ~45% density, then iterate "a cell becomes a wall if ≥ 5 of 8 neighbors are walls" 4-5 times. The result is organic cave shapes — no straight corridors.
See references/cellular-automata.md for the full GDScript + C# implementation with TileMapLayer integration.
5. Wave Function Collapse (WFC)
WFC is a constraint solver: given a tile set with adjacency rules, pick the lowest-entropy cell, collapse it to a valid tile, propagate constraints, repeat. Produces tile-rule-respecting output but is non-trivial to implement.
See references/wave-function-collapse.md for concept overview and a simplified GDScript + C# implementation.
6. Common Pitfalls
| Symptom | Cause | Fix |
| Same level every time | Not seeding the RNG | Set rng.seed before generation |
| Same seed gives a different level | Global randf() / randi() — randomized at startup and shared with any other code that calls them | Use a dedicated RandomNumberGenerator instance |
| Noise looks blocky | Frequency too high | Lower frequency (try 0.01–0.05) |
| Caves are all wall or all floor | fill_chance too extreme or too few iterations | Use fill_chance 0.40–0.50 and 4–6 iterations |
| BSP rooms overlap | Split position too close to edge | Ensure min_room_size buffer in split calculation |
| WFC contradiction (no valid tile) | Adjacency rules too restrictive | Add more allowed neighbors or implement backtracking |
| Generation takes too long | Processing entire map in one frame | Use await get_tree().process_frame to spread across frames, or use a thread |
7. Implementation Checklist
- All generation uses a seedable
RandomNumberGenerator, never globalrandf()/randi() - Seeds are stored with save data so levels can be reproduced
FastNoiseLitefrequency and octaves are tuned for the game's tile/world scale- Large generation is spread across frames or run on a thread to avoid freezing
- Generated TileMapLayer content uses terrain autotiling when possible (not hardcoded tile coords)
- BSP dungeons verify all rooms are connected before finalizing
- Cave generation runs a flood-fill to ensure reachability between key points
- Player spawn point is validated to be on a floor tile, not inside a wall
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

