feat: data-oriented chunks optimization with tile registry
- Phase 1: Bit-packed standability (ChunkData with bitsets) - Phase 2: Reactive connectivity (dirty chunks) - Phase 3: Async terrain baking (AsyncComputeTaskPool) - Pathfinding weight system (rock=50 preferred, bedrock=150 avoided) - Movement speed affected by tile weight - External tiles.toml for hot-reloadable tile definitions - TileRegistry singleton for async-safe tile lookups - Fixed world_to_chunk to use CHUNK_SIZE_TILE (128) not CHUNK_SIZE (8) - Fixed infinite spawner with Local<bool> state guards - Fixed spawn coordinate grid alignment Note: Zigzag pathfinding bug introduced - needs investigation
This commit is contained in:
+6
-7
@@ -5,6 +5,7 @@ use crate::entities::{
|
||||
item::{initialize_item_rotation_state, item_tile_management_system, ItemRotationTimer},
|
||||
livestock::pig::pig_drop_system,
|
||||
};
|
||||
use crate::game::SpawnDelay;
|
||||
|
||||
mod camera;
|
||||
mod config;
|
||||
@@ -25,6 +26,7 @@ fn main() {
|
||||
})
|
||||
.insert_resource(camera::CameraMoved(false))
|
||||
.insert_resource(world::tiles::QuiltCache::default())
|
||||
.init_resource::<SpawnDelay>()
|
||||
.add_systems(PreStartup, world::textures::initialize_textures)
|
||||
.add_plugins(
|
||||
DefaultPlugins
|
||||
@@ -45,13 +47,7 @@ fn main() {
|
||||
.add_plugins(entities::pathfinding::PathfindingPlugin)
|
||||
.add_systems(
|
||||
Startup,
|
||||
(
|
||||
camera::spawn_panning_camera,
|
||||
cursor::setup_cursor,
|
||||
entities::sentient::dorf::spawn_dorfs,
|
||||
entities::livestock::pig::spawn_pigs,
|
||||
entities::livestock::rabbit::spawn_rabbits,
|
||||
),
|
||||
(camera::spawn_panning_camera, cursor::setup_cursor),
|
||||
)
|
||||
.add_systems(
|
||||
Update,
|
||||
@@ -60,6 +56,9 @@ fn main() {
|
||||
camera::camera_z_movement,
|
||||
camera::camera_movement,
|
||||
cursor::move_cursor,
|
||||
entities::sentient::dorf::spawn_dorfs,
|
||||
entities::livestock::pig::spawn_pigs,
|
||||
entities::livestock::rabbit::spawn_rabbits,
|
||||
),
|
||||
)
|
||||
.add_systems(Update, pig_drop_system)
|
||||
|
||||
Reference in New Issue
Block a user