- SmallVec<[DropEntry; 2]> replaces Vec in DropTable: zero heap allocation for
all current tiles (0 or 1 entries), spills to heap only at 3+
- DropEntry fields packed to u8 (chance_pct, min_count, max_count): ~12 bytes ->
4 bytes; derives Copy so no extra clones
- Replaced SystemTime pseudo-RNG with dig_rng(pos): PCG-style hash of world SEED
+ tile position. Deterministic per world, same dig = same roll every time
- TOML-driven drop tables: assets/drop_tables.toml (grass=5%/1-2, rock=10%/1,
dirt/air=none). TOML parsed at startup into DropTableRegistry resource
- OnceLock global map for async terrain generation tasks to access drop tables
without Bevy resource borrowing
- terrain.rs: DropTableRegistry::global_get("tile") replaces hardcoded drop_table_for
41 lines
845 B
TOML
41 lines
845 B
TOML
[package]
|
|
name = "dorf"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
|
|
[dependencies]
|
|
bevy = { version = "0.18.1", features = ["wayland"] }
|
|
noise = "0.9.0"
|
|
rand = "0.10.0"
|
|
bevy_rand = { version = "0.14.2", features = ["wyrand"] }
|
|
image = "0.25.10"
|
|
bevy_platform = "0.18.1"
|
|
serde = { version = "1.0", features = ["derive"] }
|
|
toml = "0.9.8"
|
|
rayon = "1.11.0"
|
|
rustc-hash = "2.1.1"
|
|
smallvec = { version = "1", features = ["union"] }
|
|
ahash = "0.8.12"
|
|
nohash-hasher = "0.2.0"
|
|
futures-lite = "2.6.1"
|
|
arrayvec = "0.7.6"
|
|
|
|
[build-dependencies]
|
|
image = "0.25.10"
|
|
|
|
# Enable max optimizations for dependencies, but not for our code:
|
|
[profile.dev.package."*"]
|
|
opt-level = 3
|
|
|
|
# Enable only a small amount of optimization in debug mode
|
|
[profile.dev]
|
|
opt-level = 1
|
|
debug = true
|
|
|
|
[profile.release]
|
|
lto = true
|
|
opt-level = 3
|
|
codegen-units = 1
|
|
incremental = false
|
|
debug = false
|