docs: add session summary and 48h diff for handoff
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
# Last 48h Git Diff
|
||||
|
||||
## Commit: 9535d65 (HEAD)
|
||||
### Message: feat: data-oriented chunks optimization with tile registry
|
||||
|
||||
Files changed (14 files, +423 -84):
|
||||
|
||||
```
|
||||
tiles.toml | +186 (NEW)
|
||||
src/config.rs | +50
|
||||
src/entities/shared_systems/pathfinding.rs | +45 -4
|
||||
src/entities/shared_components/ambulatory.rs | +10 -10
|
||||
src/entities/livestock/pig.rs | +10 -2
|
||||
src/entities/livestock/rabbit.rs | +8
|
||||
src/entities/sentient/dorf.rs | +8
|
||||
src/game.rs | +12
|
||||
src/main.rs | +16 -16
|
||||
src/world/generation/terrain.rs | +123 -3
|
||||
src/world/mod.rs | +12
|
||||
src/world/tiles/chunk_data.rs | +21
|
||||
src/world/tiles/prefabs.rs | +85 -19
|
||||
src/world/tiles/tilemap.rs | +14
|
||||
```
|
||||
|
||||
### Key Changes:
|
||||
|
||||
#### 1. External Tile Registry (tiles.toml)
|
||||
- New `tiles.toml` for hot-reloadable tile definitions
|
||||
- Floor tiles: air, grass, dirt, rock, bedrock with weight/standability
|
||||
- Fixture tiles: walls, log, leaves
|
||||
- IDs, weights, can_stand_in, can_stand_on all configurable
|
||||
|
||||
#### 2. Config.rs additions
|
||||
- `TileRegistry` struct with `OnceLock` global singleton
|
||||
- `FloorTileDef` and `FixtureTileDef` structs
|
||||
- Loads from `tiles.toml` at first access
|
||||
- `global()` method for async-safe access
|
||||
|
||||
#### 3. Pathfinding.rs changes
|
||||
- `calculate_movement_cost(move_dir, tile_weight)` - now takes weight param
|
||||
- `get_tile_weight(tilemap, pos)` - retrieves weight from tile
|
||||
- Movement speed modifier: `threshold = walk_speed * (tile_weight / 50)`
|
||||
- `SpawnDelay` resource for delayed spawning
|
||||
|
||||
#### 4. Chunk data improvements
|
||||
- `ChunkData::is_standable()` bit-packed standability checks
|
||||
- `get_astar_weight()` method for pathfinding cost
|
||||
|
||||
#### 5. world_to_chunk fix
|
||||
- Changed from `CHUNK_SIZE` (8) to `CHUNK_SIZE_TILE` (128)
|
||||
|
||||
#### 6. Entity spawning fixes
|
||||
- `Local<bool>` state guards prevent infinite spawning
|
||||
- Grid-aligned spawn coordinates
|
||||
- Delayed spawning with `SpawnDelay` resource
|
||||
|
||||
---
|
||||
|
||||
## Commit: 50788af
|
||||
### Message: feat(optimization): implement data-oriented chunk architecture
|
||||
|
||||
Previous optimization phases:
|
||||
- ChunkData with bit-packed standability
|
||||
- Dirty chunk tracking for O(d) connectivity
|
||||
- Async terrain generation
|
||||
Reference in New Issue
Block a user