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

TerrainGlyphWalkableIs ForestBeauty Value
Meadow.YesNo0
Stone#YesNo0
Water~NoNo0
AncientForestTYesYes2
YoungForesttYesYes1
WallXNoNo0

(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:

TerrainSeasonEffective Beauty
AncientForestAutumn3 (base 2 + autumn color bonus)
YoungForestWinter0 (bare branches, normally 1)
All othersAnyBase 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:

TerrainInspiration 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

TerrainForage AmountCondition
Forest (Ancient or Young)+8 SustenanceSustenance < 40, every 10th tick
Other walkable (Meadow, Stone)+5 SustenanceSustenance < 40, every 10th tick
Water, Wall0 (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).

TerrainForageable
MeadowYes (+5)
AncientForestYes (+8)
YoungForestYes (+8)
StoneNo
WaterNo
WallNo

(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:
TerrainProbability
Wall2%
Water5%
Stone8%
YoungForest15%
Meadow70%

(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.