Terrain
Overview
The map is a 2D grid of terrain tiles that determine movement, beauty, foraging yields, and resource placement. Six terrain types form three functional zones: the settlement clearing (Meadow), the surrounding forest ring (Ancient and Young Forest), and the outer wilderness (mixed, with obstacles).
How It Works
Terrain Types
| Terrain | Glyph | Walkable | Is Forest | Beauty Value |
|---|---|---|---|---|
| Meadow | . | Yes | No | 0 |
| Stone | # | Yes | No | 0 |
| Water | ~ | No | No | 0 |
| AncientForest | T | Yes | Yes | 2 |
| YoungForest | t | Yes | Yes | 1 |
| Wall | X | No | No | 0 |
(Source: src/sim/components.rs, enum Terrain, walkable(), is_forest(),
beauty_value())
Walkability
Elves can move on any tile except Water and Wall. The pathfinding system uses walkability to compute valid routes.
walkable = !matches!(terrain, Water | Wall)
(Source: src/sim/components.rs, Terrain::walkable())
Beauty Restoration
Each tick, the terrain_effect_system checks the elf's current tile and all
four adjacent tiles (N, S, E, W). The highest beauty value among these
five tiles is added to the elf's Beauty need.
beauty_gain = max(current_tile.beauty_value, adjacent_tiles.beauty_value)
Seasonal overrides:
| Terrain | Season | Effective Beauty |
|---|---|---|
| AncientForest | Autumn | 3 (base 2 + autumn color bonus) |
| YoungForest | Winter | 0 (bare branches, normally 1) |
| All others | Any | Base value |
(Source: src/sim/systems.rs, terrain_effect_system())
Stream Adjacency
If any adjacent tile is Water, the elf gains a solitude inspiration bonus (+1 every 10 ticks).
(Source: src/sim/systems.rs, terrain_effect_system())
Inspiration from Terrain
Every 10 ticks:
| Terrain | Inspiration Gain |
|---|---|
| AncientForest | +1 Nature inspiration |
| YoungForest | +1 Nature inspiration (every 20 ticks only) |
| Adjacent Water | +1 Solitude inspiration |
(Source: src/sim/systems.rs, terrain_effect_system())
First-Visit Mood
The first time an elf enters an AncientForest tile, they receive:
- Mood modifier: "Awed by ancient grove" +2 for 200 ticks
This is tracked per-elf via VisitedTerrains and only fires once.
(Source: src/sim/systems.rs, terrain_effect_system();
src/sim/components.rs, VisitedTerrains)
Values & Formulas
Foraging Yields by Terrain
| Terrain | Forage Amount | Condition |
|---|---|---|
| Forest (Ancient or Young) | +8 Sustenance | Sustenance < 40, every 10th tick |
| Other walkable (Meadow, Stone) | +5 Sustenance | Sustenance < 40, every 10th tick |
| Water, Wall | 0 (not walkable) | -- |
Foraging caps at 60 Sustenance (elves cannot reach "Fulfilled" from foraging). Stone is explicitly excluded from foraging despite being walkable.
Wait -- re-reading the source: Stone is excluded in foraging_system() by the
check !matches!(terrain, Terrain::Stone | Terrain::Wall).
| Terrain | Forageable |
|---|---|
| Meadow | Yes (+5) |
| AncientForest | Yes (+8) |
| YoungForest | Yes (+8) |
| Stone | No |
| Water | No |
| Wall | No |
(Source: src/sim/systems.rs, foraging_system())
Resource Sources
Resource sources are separate entities placed on map tiles. Their type determines what can be gathered there. Sources regenerate +1 per dawn, up to a cap of 10 (5 for FineWood).
(Source: src/sim/systems.rs, regeneration_system())
Map Generation
Maps are generated with three concentric zones:
Zone 1: Settlement Clearing (center)
- Radius:
max(min(width, height) * 0.15, 5.0)tiles from center - Mostly Meadow
- A narrow stream (Water) runs through the center
Zone 2: Forest Ring
- Extends 3 tiles beyond the clearing radius
- 65% forest (inner half = AncientForest, outer half = YoungForest)
- 10% Stone
- 25% Meadow
Zone 3: Outer Wilderness
- Everything beyond the forest ring
- Distribution:
| Terrain | Probability |
|---|---|
| Wall | 2% |
| Water | 5% |
| Stone | 8% |
| YoungForest | 15% |
| Meadow | 70% |
(Source: src/sim/map.rs, generate_map())
Default map size: 40 x 30.
Interactions
- Needs & Mood -- terrain beauty restores the Beauty need; first-visit moods add to the mood stack.
- Resources -- foraging yields vary by terrain; resource sources are placed on specific tiles.
- Buildings -- buildings are placed on walkable tiles; the settlement clearing provides the main building area.
- Skills -- terrain does not directly affect skill gains, but proximity to forest tiles enables passive beauty restoration that keeps elves happy and productive.
Tips
- AncientForest is the most valuable terrain. Beauty 2, +1 Nature inspiration every 10 ticks, first-visit mood bonus, and best foraging yield. Build paths (or settle) near AncientForest tiles.
- Autumn is peak beauty season. AncientForest beauty jumps to 3 in Autumn. Plan revels and creative work for this season.
- Winter kills YoungForest beauty. Bare branches mean 0 beauty value. Make sure you have a Garden or AncientForest access to compensate.
- The center stream is a double-edged tile. Water blocks movement but gives adjacent elves solitude inspiration. Build near it, not on it.
- Stone terrain is walkable but not forageable. Elves can cross Stone tiles freely but will not passively forage there.
- Wall tiles (2% of outer wilderness) are impassable obstacles. They can block pathfinding to outer resource sources. Scout the map for bottlenecks.