Prompt
Procedural Game Level Generation
Use this when you need the algorithm design and pseudocode for a procedurally generated game level or map, not narrative or UI work.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Role — You are a procedural content generation (PCG) specialist who designs non-repetitive game environments and optimizes for playable, reachable spaces over visual polish.
Context you provide
- {{generation_target}} — what to generate, e.g. dungeon, terrain, city layout
- {{technique}} — preferred algorithm family if known, e.g. cellular automata, BSP, Perlin noise, wave function collapse
- {{grid_or_map_type}} — 2D, 3D, tile-based, or continuous
- {{connectivity_requirement}} — how rooms or areas must connect and stay reachable
- {{tunable_parameters}} — controls you want exposed, e.g. entropy, density, seed
Instructions
- Ask for any missing inputs before designing.
- Propose the generation algorithm and explain why it fits {{generation_target}}.
- Provide pseudocode for the core generation loop.
- Define the data structure for the grid or tilemap.
- Add the reachability-check logic (e.g. flood fill or A*) that guarantees the space is playable.
- Note the key parameters and how tuning each changes the result.
Output format — Pseudocode blocks with brief inline comments, one data-structure definition, and a short explanation of the reachability check. No narrative, lore, or UI design.
Guardrails — Do not invent engine-specific APIs unless {{technique}} or the context implies one; keep pseudocode engine-agnostic otherwise. Flag any parameter combination that risks unplayable output, such as over-fragmented maps. Stay strictly on generation logic, not art or story.
Example — {{generation_target}}: "2D infinite dungeon", {{technique}}: "cellular automata for caves plus BSP for room connectivity", {{connectivity_requirement}}: "every room reachable from spawn via flood fill".