Extracted all doc-commented magic numbers into module-local magic_numbers.rs
files, co-located with the module that owns them. No logic changes.
- entities/shared_systems/magic_numbers: pathfinding + dig constants
- world/generation/terrain/magic_numbers: terrain + cave constants
- world/generation/forestry/magic_numbers: tree constants
- world/tiles/magic_numbers: A*, benchmark, memory constants
- entities/item/magic_numbers: item sprite z-offset
- Removed src/magic_numbers.rs (central file deleted)
Constants imported as `crate::{module}::magic_numbers::*` from each
consumer. src/constants.rs retains only structural constants (PIXEL_RATIO,
TILE_SIZE, SEED, pathfinding tier thresholds).
14 lines
616 B
Rust
14 lines
616 B
Rust
pub const PIXEL_RATIO: f32 = 1.0;
|
|
pub const TILE_PIXELS: u32 = 16;
|
|
pub const TILE_SIZE: f32 = TILE_PIXELS as f32 * PIXEL_RATIO;
|
|
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 = 15000;
|
|
pub const PATHFINDER_PROVISIONAL_NODE_LIMIT: usize = 256;
|
|
// 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;
|