magicciv/public/games/age-of-dwarves/docs/terrain/TERRAIN_SYSTEM.md
Natalie 0bfc993545 feat(@projects/@magic-civilization): add age-of-dwarves units & audio system
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-26 19:42:00 -07:00

6.6 KiB
Raw Permalink Blame History

Terrain System

Tile structure

Each hex tile carries one terrain (plains, forest, hill, …) at the data level — terrain fills the tile uniformly. The perceived boundary between two adjacent terrains is the shared hex edge, which is the edge slot between the two tiles' centres. This is the biome contact membrane: a unit deployed to its own edge keeps its parent tile's terrain bonuses (forest cover on the attack), and combat between two centres resolves at the shared edge.

For the centre + 6 edge slots model itself and how it governs combat, flanking, and ZOC, see ../HEX_GEOMETRY.md.


Terrain Types and Base Yields

Terrain Food Production Gold Cultural resistance Notes
Grassland 3 1 0 1 Best farming, flat
Plains 2 2 0 1 Balanced, easy to traverse
Hills 1 3 0 2 Good production, defensible
Mountains 0 4 1 5 Best production, near-impassable
Forest 2 2 0 2 Cover, lumber
Jungle 3 1 0 3 Rich food, hard to traverse
Boreal Forest 1 2 0 2 Timber, cold
Enchanted Forest 1 1 2 4 Supernatural resistance
Desert 0 1 2 3 Harsh, trade routes
Tundra 1 1 0 3 Marginal land
Swamp 2 0 0 4 Dangerous, hard to build
Volcano 0 5 0 6 Extreme production, almost uncrossable
Snow 1 0 0 3 Harsh
Ocean 0 0 2 Naval only
Coastal Waters 1 1 2 Fishing, trade
Lake 2 0 1 Food, inland
Inland Sea 1 1 2 Naval, trade

Cultural Resistance

Culture spreads along the path of least resistance. Expansion weight formula:

Weight = (Culture pressure) / (Resistance × Distance)

The city expands toward wherever pressure-to-resistance ratio is highest. Plains and grassland fill in naturally. Mountains require deliberate investment — either gold (tile purchase) or Pioneer preparation (reduces resistance).

Pioneer preparation reduces resistance, not adds weight. A Pioneer working an unclaimed Mountain tile for 3 turns reduces its resistance from 5 toward 2. The tile becomes reachable rather than more desirable.


Tile HP System

All tiles — surface and underground — have structural integrity that can be degraded by siege bombardment, geological events, or deliberate demolition.

Surface Tile States

State Description Effects
Normal Full HP, undamaged Standard yields and movement
Damaged HP reduced Buildings take structural damage, -10% yields
Cratered Heavily damaged Impassable to Cavalry and Siege; infantry -50% movement; -25% yields
Sunken Surface dropped in elevation Terrain type changes (Mountain → Ravine, Plains → Depression/Bog)
Ruins Fully degraded All buildings destroyed, uncapturable, uninhabitable

Terrain Failure Modes

Terrain Sunken result
Mountain Ravine (impassable, no building)
Hills Damaged Plains (flat but rough)
Plains Depression / Bog (waterlogged, movement penalty)
Forest Scorched Earth (no cover, no yields until recovery)
City tile Buildings lean/collapse, underground may be exposed

Cross-Layer Interaction

Surface and underground damage feed each other:

  • Heavy surface bombardment weakens underground hollow spaces below
  • Underground collapse causes the surface above to crack and sink
  • When both layers fail simultaneously, a breach forms — a hole from surface to underground that attackers can descend through

Siege Environmental Effects

Siege weapons can be used against terrain, not just units and buildings.

Target terrain Siege effect Turns required Result
Dense Forest Burns/clears 3 Dense Forest → Sparse Forest → Cleared Land
Sparse Forest Partial clearing 2 Sparse Forest → Cleared Land
Swamp Disruption 4 Swamp → Mudflat (worse movement, less food)
Hills Erosion 6 Hills → Damaged Plains (reduced defense bonus)
Mountain Rockfall 10+ Mountain → Rocky Rubble (impassable patches)

Scorched Earth consequence: Cleared land via siege does not immediately become farmland. It passes through a Scorched Earth state with unhappiness and local climate penalties before recovering. A player who carpet-bombs forests degrades their own agricultural base.

Dense Forest → Scorched Earth (0 yields, -happiness nearby)
  → Cleared Land (base yields only)
  → Engineer improves → Farmable Plains
  
Without Engineer:
  Cleared Land → Scrubland (low yield, slow recovery)
  Scrubland → decades → recovering sparse forest

Terrain Modification

Engineers and Demolitions Experts can reshape terrain permanently.

Action Who Tech required Time Cost Result
Flatten Hill Demolitions Expert Explosives 6-8 turns High materials Hill → Plains
Level Cratered Terrain Engineer Masonry 4-5 turns Medium materials Cratered → stable
Mountain Pass Demolitions Expert Deep Boring 10-15 turns Very high Mountain → Pass tile (slow movement, reduced defense)
Mountain Tunnel Demolitions Expert Deep Boring + Tunnel Engineering 12-18 turns Extreme Underground corridor through mountain range
Canal Engineer Hydraulics 8-10 turns High Converts tile to navigable waterway
Levee Engineer Hydraulics 4-6 turns Medium Raises low terrain, flood protection
Quarry Expansion Engineer Masonry 3-4 turns Low Deepens quarry, +stone yield
Forest Clearance Demolitions Expert Explosives 2 turns Low materials Forest → Cleared Land (controlled, minimal scorching)

All terrain modifications are permanent. Flattening a hill cannot be undone. Mountain tunnels cannot be collapsed except by siege (see UNDERGROUND.md).


Tile Repair

Repair method Who Cost Time Limit
Engineer on tile Engineer unit Materials Slow Up to Cratered
Mason Lodge queue City production Production Medium Up to Cratered
Natural recovery Passive Free Very slow Up to Damaged
Reinforcement Engineer underground Materials++ Slow Underground only

Cannot be repaired: Full Sinkhole, Ruins. These are permanent terrain changes. A tile that has fully subsided remains a depression or void. Plan accordingly.