Hydrology
Water flows through your settlement as a living system -- springs feed streams, rain fills valleys, and ice locks the surface in winter. The hydrology layer connects climate, geology, flora, and fauna into a single ecological web.
Overview
Every tile on the map has a water state tracking depth (0--255), flow direction, ice thickness, and water source. Five systems update water at every day boundary: precipitation, spring production, flow, evaporation, and freeze/thaw. Water depth affects walkability, beauty, soil moisture, and fauna behavior.
How It Works
Water Depth Thresholds
| Threshold | Depth | Effect |
|---|---|---|
| Dry | 0 | No water. Normal terrain. |
| Subsurface | 1--30 | Wet but invisible. Contributes to soil moisture. |
| Visible | 31--80 | Rendered as shallow water. +1 beauty. Wading speed (2x movement cost). |
| Deep | 81--200 | Impassable unless frozen. +2 beauty. |
| Very Deep | 201--255 | Deep pool. +3 beauty. |
Source: crates/er-sim/src/sim/hydrology.rs, DEPTH_VISIBLE, DEPTH_DEEP, DEPTH_VERY_DEEP.
Precipitation
Rain, Storm, and Snow weather add water to tiles. The amount is modulated by elevation (orographic precipitation):
- High elevation (>= 150): 2x base rainfall -- peaks catch moisture from rising air.
- Low elevation (<= 100): 0.4x base rainfall -- rain shadow behind peaks.
- Mid elevation (100--150): linear interpolation between 0.4x and 2.0x.
| Weather | Base Amount | High Elev | Mid Elev | Low Elev |
|---|---|---|---|---|
| Rain | 3 | 6 | ~4 | 1 |
| Storm | 8 | 16 | ~10 | 3 |
| Snow | 1 (half rain) | 2 | ~1 | 0 |
Snow on already-frozen tiles accumulates at half rate.
Source: crates/er-sim/src/sim/systems/hydrology_systems.rs, precipitation_system. Config: data/hydrology.ron.
Springs and River Heads
Water sources produce water continuously at day boundary:
| Source | Production/Day |
|---|---|
| Spring | Per-spring flow_rate (default 5) |
| River Head | 20 (configurable) |
Sources resist evaporation -- they don't dry out.
Source: crates/er-sim/src/sim/systems/hydrology_systems.rs, spring_production_system.
Water Flow
Water moves downhill each day. The system finds the lowest neighbor (by elevation + water depth) and transfers water at the configured flow rate (default 4 depth/day). Frozen water does not flow.
Flow direction is stored per tile and rendered as stream direction indicators.
Source: crates/er-sim/src/sim/systems/hydrology_systems.rs, water_flow_system.
Evaporation
Water slowly disappears from non-source, non-frozen tiles:
| Season | Evaporation Rate |
|---|---|
| Summer | 3/day (base 1 + summer bonus 2) |
| Other seasons | 1/day |
When a tile dries completely (depth reaches 0), its flow direction is cleared.
Source: crates/er-sim/src/sim/systems/hydrology_systems.rs, evaporation_system.
Freeze/Thaw
Water freezing is depth-aware -- shallow water freezes faster than deep water:
| Water Depth | Ice Growth/Day (below 20 temp) |
|---|---|
| Shallow (< 81) | 15 ice/day |
| Deep (>= 81) | 3 ice/day |
Thawing occurs above 30 temperature at 10 ice/day. Between 20--30 temperature, nothing changes (hysteresis prevents oscillation).
Frozen water is passable with no movement cost -- rivers become ice bridges in winter. Frozen visible water has +2 beauty (scenic frozen landscape).
Source: crates/er-sim/src/sim/systems/hydrology_systems.rs, freeze_thaw_system. Config: data/hydrology.ron.
Soil Moisture
Water feeds soil moisture, which gates flora growth:
- Surface absorption: water on a tile is absorbed into soil moisture at per-soil-kind rates (Sand 4, Loam 2, Clay/Peat/Rocky 0).
- Adjacent boost: tiles next to visible water gain +3 moisture/day.
- Evaporation: soil moisture drains at 1/day (+1 in summer). Clay and Peat resist (halved rate).
- Retention cap: soil moisture cannot exceed the soil kind's retention value (Peat 90, Clay 80, Loam 50, Sand 20, Rocky 10).
Flora growth stops when soil moisture reaches 0 (drought dormancy). Seed germination requires moisture >= 10.
Source: crates/er-sim/src/sim/systems/hydrology_systems.rs, soil_moisture_system.
Interactions
- Seasons & Weather -- weather type determines daily precipitation; temperature drives freeze/thaw and evaporation rates.
- Flora -- soil moisture gates flora growth and spread. Drought stalls expansion but doesn't kill existing plants.
- Fauna -- water sources attract animals. Drought concentrates fauna at remaining water.
- Forest Spirit -- deforestation increases erosion on bare soil, which reduces fertility, which reduces flora, which reduces soil moisture retention.
Tips
-
Valleys flood, peaks dry out. Low-elevation tiles accumulate water from orographic rainfall. Place settlements on mid-elevation terrain for balanced water access without flooding.
-
Build near springs. Spring tiles continuously produce water, keeping adjacent soil moist and supporting flora growth year-round.
-
Watch winter rivers. When deep water freezes, it becomes a free walkway. Elves will path across frozen rivers, but when spring thaw comes, that path becomes impassable again.
-
Summer dries shallow pools. Evaporation triples in summer (3/day vs 1/day). Shallow water features may disappear by mid-summer. Deep pools and spring-fed streams persist.
-
Sand drains fast. Sandy soil absorbs water quickly (rate 4) but has the lowest retention cap (20). Flora on sand needs constant water proximity. Clay holds moisture (cap 80) but absorbs slowly.