A new `world` generation domain in reikhelm-core, sibling to the dungeon
passes. Builds continuous fields (elevation, temperature, moisture, flow)
and classifies them into biomes — a general-purpose world generator any
game can consume, the foundation for the "generate a world for any game"
app idea.
Stages (each forks its own RNG sub-stream, like the dungeon pipeline):
- noise: own Perlin + fBm + domain warp (no `noise` crate, same reason
we own range/shuffle — version drift would change every seed)
- elevation: domain-warped fBm shaped by edge falloff + redistribution
- hydrology: ocean/lake flood, priority-flood depression fill, D8 flow
accumulation → dendritic rivers that always reach the sea
- climate: latitude temperature w/ altitude lapse; prevailing-wind
moisture sweep with orographic rain + emergent rain shadows
- biome: Whittaker classifier over temperature × moisture
Determinism: same (config, seed) → byte-identical World on every machine.
The whole generator is transcendental-free (only + - * / and comparisons),
so even the f32 fields reproduce exactly cross-platform (spec §7 ethos).
Plus `examples/world_png.rs`: a zero-dependency PNG exporter (hand-rolled
stored-DEFLATE zlib) with biome palette, ocean-depth shading, and hillshade
— a viewer for eyeballing output, kept out of the pure core.
24 new tests (determinism, rain-shadow, depression-filling, river density,
Whittaker corners); full suite 169 passing, clippy clean.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
17 lines
384 B
Rust
17 lines
384 B
Rust
//! `reikhelm-core` — deterministic procedural 2D map generation.
|
|
//!
|
|
//! This crate holds the pure generation logic with no rendering or GUI
|
|
//! dependencies. Modules are added by later tasks.
|
|
|
|
pub mod ascii;
|
|
pub mod blackboard;
|
|
pub mod entity;
|
|
pub mod geometry;
|
|
pub mod grid;
|
|
pub mod map;
|
|
pub mod pass;
|
|
pub mod passes;
|
|
pub mod recipes;
|
|
pub mod region;
|
|
pub mod rng;
|
|
pub mod world;
|