Source-first reverse engineering of a mainline Battle for Wesnoth campaign
17c — Troll Hole
A shrouded square dungeon where prestart randomization chooses two Troll leaders and replaces the other two corners with difficulty-traited Giant Spiders.
An elven guide leads Haldric into the Brown Hills and down a large cave mouth. Burin supplies the essential tactical warning: Trolls are strong, hostile, and regenerate rapidly. The elves have assigned a direct extermination task, and Haldric later recognizes that they delegated a particularly unpleasant job.
Map description
The 32 × 32 shrouded cave is broadly square and organized around four outer corner regions, a central underground-water complex, narrow cave passages, villages, fungus, rubble, and impassable walls. Four Troll sides are defined, but only two leaders remain after randomized prestart setup. The other two corners receive Giant Spider guardians named Fang.
Map system
Design role
Four potential corner keeps
Supports multiple randomized leader arrangements on one map.
Central water and Tentacles
Creates neutral-looking passage hazards assigned to Troll sides.
Shroud
Prevents the player from knowing which corners contain Troll leaders.
Four rubble images
Marks cave damage and helps differentiate approaches.
Randomized corner layout
A random value from 1 to 4 removes two adjacent Troll leaders and replaces their corners with Giant Spiders. The remaining two Troll Warriors are the scenario’s actual leaders.
Random result
Leaders removed
Surviving leaders
1
Erart and Raol
Rilg and Gulg
2
Raol and Rilg
Erart and Gulg
3
Rilg and Gulg
Erart and Raol
4
Gulg and Erart
Raol and Rilg
Each removed leader is replaced by a Giant Spider named Fang on another Troll side, retaining hostility without keeping all four recruitment centers active.
Difficulty-specific Spider trait
Difficulty
Fang receives
Easy
Aged
Normal
Slow
Hard
Resilient
The local SPIDER_TRAIT macro uses additive [+unit] and [+modifications] tags so it can append a trait immediately after each GUARD_UNIT expansion.
Sides and AI
Sides
Leaders
Gold / income
AI
2–3
Erart and Raol — Troll Warriors
90 / 120 / 150; income 0 / 2 / 4
No scouts; fighter-heavy pattern; aggression 0.69 / 0.72 / 0.75
4–5
Rilg and Gulg — Troll Warriors
80 / 140 / 200; income 2 / 5 / 8
Same pattern and aggression scaling
All four sides can recruit Troll Whelps, Trolls, and Troll Rocklobbers. Across the combined sides, simultaneous Troll and Rocklobber recruits are each limited to 1 / 2 / 3.
Fixed hazards and rewards
Difficulty
Tentacles of the Deep
Easy
2
Normal
4
Hard
6
Every Troll leader killed in play grants 70 / 60 / 50 gold. Because two leaders are removed before the battle, the practical maximum leader loot is two payments.