Type
- feature (architecture / worldgen)
Problem
World size is currently capped by a menu slider (8K-64K pixels). Players who want Factorio-style exploration are limited to a fixed boundary. The world should grow as the player explores, limited only by available RAM.
Design Direction
Replace the fixed-size world grid with a chunk-based system where terrain is generated on demand as entities or the camera move into unloaded regions.
Key Challenges
- WorldGrid: currently a flat
Vec<WorldCell> sized at init. Needs chunk-based storage (HashMap<ChunkCoord, Chunk>) with lazy generation.
- GPU compute: spatial grid is a fixed 256x256 grid uploaded each frame. Needs viewport-relative or hierarchical approach.
- Pathfinding: HPA* cache assumes a fixed grid. Needs incremental chunk loading/unloading for the abstract graph.
- Tilemap rendering: Bevy tilemap chunks need dynamic load/unload based on camera position.
- EntityMap spatial buckets: currently sized for fixed world bounds. Needs dynamic resizing or chunk-aligned buckets.
- Save/load: must serialize only loaded chunks + entity positions. Unvisited chunks regenerate from seed.
- Town placement: raider towns need to spawn at appropriate distances as the player expands, not all at world init.
Factorio Parallels
- Chunks generated on demand (16x16 tile chunks in Factorio)
- Deterministic generation from world seed -- same seed = same terrain
- Only active chunks (near players/entities) are simulated
- Inactive chunks are frozen or unloaded
Scope Estimate
This is a multi-week architectural change touching nearly every system. Recommend breaking into slices:
- Chunk storage format + lazy terrain generation
- Camera-driven chunk loading/unloading
- Pathfinding adaptation (incremental HPA* rebuild)
- GPU buffer adaptation (viewport-relative spatial grid)
- Dynamic town/raider spawning at world edges
- Save/load for chunk-based worlds
- Remove world size slider, add seed input
Acceptance Criteria
Status
Waiting -- needs design discussion and slice planning before implementation begins.
This is a foundational architecture change, not a simple feature add.
Type
Problem
World size is currently capped by a menu slider (8K-64K pixels). Players who want Factorio-style exploration are limited to a fixed boundary. The world should grow as the player explores, limited only by available RAM.
Design Direction
Replace the fixed-size world grid with a chunk-based system where terrain is generated on demand as entities or the camera move into unloaded regions.
Key Challenges
Vec<WorldCell>sized at init. Needs chunk-based storage (HashMap<ChunkCoord, Chunk>) with lazy generation.Factorio Parallels
Scope Estimate
This is a multi-week architectural change touching nearly every system. Recommend breaking into slices:
Acceptance Criteria
Status
Waiting -- needs design discussion and slice planning before implementation begins.
This is a foundational architecture change, not a simple feature add.