diff --git a/Cargo.lock b/Cargo.lock index fb9dc22..a8e57fe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2432,6 +2432,7 @@ name = "dorf" version = "0.1.0" dependencies = [ "ahash", + "arrayvec", "bevy", "bevy_platform", "bevy_rand", diff --git a/Cargo.toml b/Cargo.toml index 1f33281..19ee719 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,6 +17,7 @@ rustc-hash = "2.1.1" ahash = "0.8.12" nohash-hasher = "0.2.0" futures-lite = "2.6.1" +arrayvec = "0.7.6" [build-dependencies] image = "0.25.10" diff --git a/assets/tileset.png b/assets/tileset.png index 6130ddc..36274f6 100644 Binary files a/assets/tileset.png and b/assets/tileset.png differ diff --git a/config.toml b/config.toml index 419b4cd..da69d4f 100644 --- a/config.toml +++ b/config.toml @@ -1,9 +1,9 @@ -initial_chunk_radius = 15 +initial_chunk_radius = 8 [display] vsync = "mailbox" [spawn_counts] -dorfs = 5 +dorfs = 50 pigs = 5 rabbits = 5 \ No newline at end of file diff --git a/full.patch b/full.patch new file mode 100644 index 0000000..e69de29 diff --git a/src/constants.rs b/src/constants.rs index 5025d11..83a29b1 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -5,16 +5,11 @@ pub const ITILE_SIZE: i32 = TILE_SIZE as i32; pub const SEED: u32 = 420; pub const PATHFINDER_SHORT_PATH_MAX_TILES: i32 = 64; -pub const PATHFINDER_MAX_NODES: usize = 5000; -pub const PATHFINDER_WAYPOINT_THRESHOLD_TILES: i32 = 100; -pub const PATHFINDER_PROVISIONAL_NODE_LIMIT: usize = 64; +pub const PATHFINDER_MAX_NODES: usize = 15000; +pub const PATHFINDER_PROVISIONAL_NODE_LIMIT: usize = 256; // Hierarchical pathfinding thresholds // Tier 1: Same/adjacent chunk -> sync A* (fast, ~87µs) // Tier 2: 2-4 chunks away -> Provisional + full path via queue // Tier 3: >4 chunks away -> Hierarchical chunk-path + async segmented A* pub const PATHFINDER_HIERARCHICAL_THRESHOLD_CHUNKS: i32 = 4; -pub const PATHFINDER_ASYNC_NODE_BUDGET_PER_FRAME: usize = 2000; - -// Snapshot bounds for async pathfinding (in chunks) -pub const PATHFINDER_SNAPSHOT_CHUNK_RADIUS: i32 = 2; diff --git a/src/debug/entity_dump.rs b/src/debug/entity_dump.rs new file mode 100644 index 0000000..b79403a --- /dev/null +++ b/src/debug/entity_dump.rs @@ -0,0 +1,74 @@ +use bevy::prelude::*; +use std::fs::OpenOptions; +use std::io::Write; + +use crate::entities::shared_components::Ambulatory; + +pub fn dump_entity_positions( + keys: Res>, + time: Res