Mission Control
Procedural Generation: From Noise to Navigable Terrain.
Project Synopsis
Proc-Gen Arena deals with Algorithmic Design. The goal is to create a layout generator that takes modular 3D assets and assembles them into a cohesive, randomized level.
This moves beyond manual level design, introducing concepts like Wave Function Collapse, Seeds (Deterministic Chaos), and Runtime NavMesh Baking to ensure that random layouts are actually playable by AI agents.
Why This Matters
Manual level design doesn't scale. PCG (Procedural Content Generation) allows for infinite replayability and is crucial for modern roguelikes. It also forces strict discipline in 3D modeling (standardized pivots).
Tech Stack
Project Checkpoints
- Phase 1: The Modular Kit (Blender Assets)
- Phase 2: The Generator Algorithm (Logic)
- Phase 3: Dynamic NavMesh (AI Pathing)
- Phase 4: Polish & Performance (Atmosphere)
Field Notes & Learnings
Key engineering concepts for Procedural Generation.
1. Pivot Point Discipline
Concept: If a wall model has its pivot in the center, but the floor pivot is at the corner, they won't snap together correctly in code.
Solution: Establish a strict Zero-Point Rule. All modular assets must have their pivot at (0,0,0) (usually the bottom-left corner) to allow for simple grid math: pos = new Vector3(x * tileSize, 0, z * tileSize).
2. Deterministic Chaos (Seeds)
Concept: True randomness makes debugging impossible. You can't fix a bug if the map layout changes every time you hit Play.
Solution: Use a Seed (Integer). Initialize logic with Random.InitState(seed). Seed "12345" will always generate the exact same dungeon.
3. Runtime NavMesh
Concept: Unity's standard NavMesh is baked in the Editor. It doesn't know about walls you spawned 5 seconds ago.
Solution: Use the NavMeshComponents package. We attach a NavMeshSurface component to the parent object and call surface.BuildNavMesh() in code immediately after the level generates.
4. The "Island" Problem
Concept: Random algorithms often create unreachable rooms surrounded by walls.
Solution: Implement a Flood Fill algorithm. Start at the player spawn, "fill" all accessible tiles. If the number of filled tiles < total tiles, the map is broken and must be regenerated.
Implementation
Step-by-step Execution Plan.
Phase 1: The Modular Kit (Week 1)
- Modeling: Create 5-10 tiles (Floor, Wall, Corner, Pillar).
- Pivots: Standardize pivots to (0,0,0) in Blender.
- Export: Verify .fbx import settings (Scale Factor 1).
Phase 2: The Generator (Week 2)
- Grid Logic: Script a 2D Array `int[,] map`.
- Algorithm: Implement Random Walk or WFC for placement.
- Seeding: Add `public int seed` field to control randomness.
Phase 3: Dynamic NavMesh (Week 3)
- Baking: Script `surface.BuildNavMesh()` on Start.
- Testing: Spawn Project 02 Bot to verify pathfinding.
- Analysis: Stream "Map Complexity" stats to Python.
Phase 4: Polish (Week 4)
- Atmosphere: Add random lighting/fog parameters.
- DevLog: Create a Generator Timelapse video.
Dev Logs
Engineering notes & daily updates.
Entry 000 Planning
Date: Feb 3, 2026
Project 03 queued for April. Focusing on Algorithmic Design and Runtime AI integration.