feat: world scale ×5 — trees, pools, walls, rooms, corridors all 5× larger
- WORLD_SCALE=5 constant in worldgen.rs, adjustable via single constant - Trees: trunk 30 cells tall, canopy radius 10 (was 6/2) - Pools: radius 10-30 (was 3-6) - Walls: height 10-35, width 5 (was 3-7/2) - Sand dunes: width 20-80 (was 6-16) - BSP rooms: min 20×20, corridors width 5 (was 9×9/2) - Surface terrain: amplitude ×5 (±20 vs ±4) - Dirt layer depth: 40 cells (was 8) - Spawn offsets ×5 for goblins/slimes - Dirty rects cleared after world generation to avoid CA processing static terrain - Chunk activation by dirty rects only (not modified flag) - Dirty rect size limit 4096 cells to prevent CA spikes - CA fill_prob for caves reduced 0.45→0.38 for larger open spaces - All 185 tests + 14 scenarios pass - Benchmark: ~18 FPS (regression from 85 FPS due to larger world features) - Performance optimization deferred to separate pass
This commit is contained in:
@@ -180,7 +180,7 @@ Layer access via `grid.get_temp()`/`set_temp()`, `grid.get_gas()`/`set_gas()`, `
|
||||
- **Status effects** — `update_status_effects()` applies damage for poison/bleeding/fire and cancels movement for frozen; effects expire when their timer reaches zero.
|
||||
- **Random seeding** — `Game::new()` uses a fixed seed for tests/AI sessions; `Game::new_random()` seeds from system time and is used by terminal/ascii/graphics modes. Cached worlds are keyed by seed.
|
||||
- **Dirty rects** — `ChunkedGrid::mark_dirty(x, y)` expands the chunk's dirty rect to include (x,y) ±1 and propagates to neighbor chunks at boundaries. `cells_swap` and `set_cell_index` call `mark_dirty` automatically. `set` and `set_material` also call `mark_dirty`. The CA step clears each chunk's dirty rect at the start of processing and rebuilds it from cell modifications during processing.
|
||||
- **Activation radius** — Entity chunk activation radius is 1 (3x3 = 9 chunks). Chunks with dirty rects are also activated. This covers the viewport while minimizing active cell count.
|
||||
- **World scale**: `WORLD_SCALE = 5` in `worldgen.rs` — all world features (trees, pools, walls, dunes, rooms, corridors, terrain amplitude) are multiplied by this factor. Change this constant to adjust entity-to-world size ratio.
|
||||
|
||||
## Module Layout
|
||||
|
||||
|
||||
Reference in New Issue
Block a user