Simulate any Battle for Wesnoth attack: exact chance to hit, damage per strike, full HP outcome distribution and chance to kill for both sides, with terrain defense, time of day, resistances and weapon specials. Then see what the exchange costs in gold — cost per HP, damage per gold and the gold-for-gold trade ratio. Mainline 1.18, Default era.
Táto kalkulačka zatiaľ nebola preložena do jazyka Slovenčina.
Zatiaľ zobrazujeme verzi v jazyce Angličtina, ako dokončíme preklad.
Pick two units, a terrain and a time of day. Get the exact chance to hit, damage per strike and chance to kill for both sides.
Attacker
Common matchups
Orcish Grunt
Elvish Fighter
Spearman
Dwarvish Fighter
Skeleton
Drake Fighter
Showing 80 of 193 matches — keep typing to narrow it down.
sword — 9×2 blade (melee)
Choosing a ranged attack forces the defender to answer at range, or not at all.
Flat — 40% defense
Only affects how likely the defender is to hit back. Your own terrain never changes your chance to hit.
/ 38
Full HP
%
Player-facing defense: higher is harder to hit. Use it for terrains or mods outside the fourteen above.
No adjacent leader
Halves this unit's damage from the first strike.
No effect inside the exchange; it shows up in the post-combat note.
/ 29
Used to work out whether this fight advances the unit.
Defender
Common matchups
Orcish Grunt
Elvish Fighter
Spearman
Dwarvish Fighter
Skeleton
Drake Fighter
Showing 80 of 193 matches — keep typing to narrow it down.
sword — 5×4 blade (melee)
Picked automatically as the defender's best answer at the attacker's range until you change it.
Flat — 40% defense
This is the one that drives your chance to hit.
/ 33
Full HP
Most attack decisions are about finishing a wounded unit. Set it to max for a fresh one.
%
Player-facing defense: higher is harder to hit. Use it for terrains or mods outside the fourteen above.
No adjacent leader
Halves this unit's damage from the first strike.
No effect inside the exchange; it shows up in the post-combat note.
/ 26
Used to work out whether this fight advances the unit.
Battlefield
First Watch (-25%)
Makes the hex behave one step brighter, never brighter than full day.
Lawful bonus in play: -25%
Multiplayer (70%)
Multiplayer scales the XP a unit needs down to 70%. This unit advances at 29 XP.
Chance to kill
36.0%
Expected damage 12.5 against 20 HP.
Chance the attacker dies
Cannot die
4 strikes × 5 max = 20 damage, against 38 HP.
Copy this exact matchup as a link.
Orcish Grunt attacking
Chance to hit
60%
Damage per strike
11
Strikes
2
Expected damage
12.5
Expected HP after
29.2 / 38
XP for the kill
8 XP per level of the unit killed, or 4 for a level-0 unit. A unit that dies in the exchange earns nothing.
8
XP for surviving
1 XP per level of the surviving opponent, so nothing at all against a level-0 opponent.
1
Elvish Fighter defending
Chance to hit
60%
Damage per strike
5
Strikes
4
Expected damage
8.8
Expected HP after
7.5 / 33
XP for the kill
8
XP for surviving
1
Chance neither dies
64.0%
Chance the attacker takes nothing
16.0%
Gold trade ratio
1.91
Every point of HP you remove is worth the target's cost per HP; every point you lose is worth yours. Above 1.00, the exchange makes you money.
Favourable
Strike order: A D A D D D
How Orcish Grunt's damage is worked out
Step
Value
Base damage
9 (sword, blade)
Time of day
chaotic at First Watch → +25%
Resistance
Elvish Fighter takes 100% → ×100
Combined multiplier
bonus = 12,500 / 10,000
Rounding
ties round toward the base damage → 4,999
Final damage per strike
11
Strikes
2
Chance to hit
60% (Elvish Fighter on Flat, 40% defense)
How Elvish Fighter's damage is worked out
Step
Value
Base damage
5 (sword, blade)
Time of day
neutral → no change
Resistance
Orcish Grunt takes 100% → ×100
Combined multiplier
bonus = 10,000 / 10,000
Rounding
ties round toward the base damage → 4,999
Final damage per strike
5
Strikes
4
Chance to hit
60% (Orcish Grunt on Flat, 40% defense)
HP outcome distribution
The average is not the outcome. This is every result the exchange can end on, and how likely each is.
Point at a bar to read its exact probability.
HP outcome distribution as a data table.
HP remaining
Attacker probability
Defender probability
dead
0.0%
36.0%
1
0.0%
0.0%
2
0.0%
0.0%
3
0.0%
0.0%
4
0.0%
0.0%
5
0.0%
0.0%
6
0.0%
0.0%
7
0.0%
0.0%
8
0.0%
0.0%
9
0.0%
48.0%
10
0.0%
0.0%
11
0.0%
0.0%
12
0.0%
0.0%
13
0.0%
0.0%
14
0.0%
0.0%
15
0.0%
0.0%
16
0.0%
0.0%
17
0.0%
0.0%
18
8.3%
0.0%
19
0.0%
0.0%
20
0.0%
16.0%
21
0.0%
0.0%
22
0.0%
0.0%
23
22.1%
0.0%
24
0.0%
0.0%
25
0.0%
0.0%
26
0.0%
0.0%
27
0.0%
0.0%
28
22.1%
0.0%
29
0.0%
0.0%
30
0.0%
0.0%
31
0.0%
0.0%
32
0.0%
0.0%
33
31.4%
0.0%
34
0.0%
0.0%
35
0.0%
0.0%
36
0.0%
0.0%
37
0.0%
0.0%
38
16.0%
0.0%
Terrain
Orcish Grunt defense
Elvish Fighter defense
Your chance to hit there
0%
0%
100%
20%
20%
80%
30%
30%
70%
30%
30%
70%
Current
40%
40%
60%
30%
30%
70%
50%
60%
40%
50%
50%
50%
60%
60%
40%
60%
60%
40%
60%
60%
40%
40%
30%
70%
20%
30%
70%
40%
50%
50%
Damage type
Orcish Grunt
Elvish Fighter
blade
In use
0% (takes 100%)
0% (takes 100%)
pierce
0% (takes 100%)
0% (takes 100%)
impact
0% (takes 100%)
0% (takes 100%)
fire
0% (takes 100%)
0% (takes 100%)
cold
0% (takes 100%)
0% (takes 100%)
arcane
0% (takes 100%)
-10% (takes 110%)
Wesnoth 1.18.7 · mainline · Default era
Unit stats, resistances and terrain defenses are extracted from the game's own data files at the tag below, not typed by hand. View the pinned data on GitHub
Wesnoth damage calculator. Chance to hit, chance to kill, and the gold value of the trade.
A Wesnoth damage calculator resolves one attack the way the engine does: exact chance to hit, damage per strike, and the odds each side dies. This one also prices the exchange in gold, so a profitable trade and an even one stop looking alike.
What this Wesnoth calculator answers that the attack dialog does not
Every unit in Wesnoth has a price, and the game never spends it on your behalf. A Wesnoth damage calculator resolves a single attack the way the engine does and prices the result in gold. An Orcish Grunt costs 12 gold, an Elvish Fighter 14, a Skeleton 15, a Horseman 24; recalling any veteran costs a flat 20 (`recall_cost` in `data/game_config.cfg`). Upkeep is one gold per unit level per turn — the UnitTypeWML reference defines the `level` key as "the amount of upkeep the unit costs". Gold is the unit of account for every decision you make outside combat. The moment you click attack, the game stops counting in it.
This calculator counts in it. Pick an attacking unit, a defending unit, both terrains and a time of day, and it returns the exact chance to hit, the damage per strike after the full modifier chain, the complete HP outcome distribution for both sides, the chance to kill, the chance to die, the XP each side stands to earn — and the gold trade ratio, which answers the question the game leaves entirely to you: whether the exchange was worth what it cost. The dataset is mainline Wesnoth 1.18.7, Default era: 192 units, 349 attacks, 7 factions, read out of the game's own data files at the pinned tag rather than typed in by hand.
The ratio is one line of reasoning. Every point of HP you remove from the target is worth the target's cost divided by its maximum HP; every point you lose is worth yours divided by yours. Above 1.00 the exchange destroys more gold than it costs you. A Skeleton attacking an Orcish Grunt on flat ground at dusk deals 12.6 expected damage and takes 6.0 back — and because a Grunt's HP is worth 0.316 gold a point while a Skeleton's is worth 0.441, that lopsided-looking damage trade comes out at 1.50, not the 2.1 the raw HP numbers suggest. The Skeleton is cheap and the Grunt is cheaper. Gold changes the answer, which is exactly why the answer should be computed in gold.
The in-game damage dialog covers the fight in front of you well: it shows chance to hit, damage, and the chance each side dies. What it cannot do is evaluate a fight you are not currently in — a unit you have not recruited, a hex you cannot reach this turn, a time of day three turns away — and it never expresses any of it in gold, nor ranks one recruit against another. Outside the game the picture thins out fast. Wesnoth-Bestiary describes itself as "a web site for browsing game and unit information" and computes no combat outcome at all; its last release, 0.5.2, is from November 2014. The community's NWP: Terrain Defence page carries no terrain table at all and warns in its own text that the percentages it does mention are examples rather than real values. NWP: Resistances offers a couple of illustrative units and no table, and its Spearman figure of 20 % arcane resistance is not the 1.18.7 value — a Spearman takes 90 % arcane, so it resists 10 %. DeepWiki's combat page names `round_damage()` and leaves the rounding rule out, documents no chance-to-hit overrides, and covers XP not at all. Every one of those is a gap this page fills with a number you can audit.
How Wesnoth resolves one attack, step by step
Wesnoth's combat is small enough to hold in your head, and it rounds once — towards the base damage — which is where reimplementations go wrong. Here is the whole of it.
Chance to hit comes from the defender's hex and nothing else. Your own terrain never changes your accuracy — it only changes how likely the counterattack is to land. The WML file stores the raw value as a chance to be hit: UnitsWML states that "the attribute terrain=defense means that the unit will be hit defense percent of the time in that terrain". The number the game shows you, and the number this page shows you, is `100 − value`. An Elvish Fighter's forest row reads `forest=40` in the data and displays as 60 % defense, which makes your chance to hit 40 %. A terrain a land unit cannot enter resolves to a raw 100, i.e. 0 % defense, and in the table further down that is deep water alone — it reads "cannot stand here", not "free hit". Shallow water and swamp are ordinary walkable hexes at 20 % and 30 %.
Three specials overrule the terrain. `magical` fixes the chance to hit at 70 % whichever way it is pointed, so a mage hits an Elvish Fighter in forest at 70 % where terrain alone would give 40 %. `marksman` raises an attacker's chance to at least 60 % and does nothing on defense, so an Elvish Marksman hits an Elvish Fighter in the mountains at 60 % instead of 40 %. The defender's `deflect` subtracts 10 points from the attacker: an Elvish Fighter attacking a Naga Sicarius at 50 % defense hits at 40 %, while the same elf attacking a Naga Warrior at 40 % defense hits at 60 %. In the Default era there is exactly one carrier of `deflect` — the level-3 Dunefolk Naga Sicarius, on its curved blade.
Damage is one multiplier, rounded once. The engine builds `damage_multiplier` as `100`, plus the time-of-day modifier, plus the leadership bonus, then multiplies the whole thing by the target's resistance value, and calls `round_damage(base_damage, damage_multiplier, 10000)` a single time. It does not apply the parts in sequence with a rounding after each one, and the distinction is not cosmetic: resistance first, then the night bonus, then leadership, with a rounding at each step, produces different integers from the same inputs.
Time of day is a percentage on the attacker's alignment. A `lawful` unit does `+lawful_bonus` % damage, a `chaotic` unit does `-lawful_bonus` %, and `neutral` is unaffected. The values in `schedules.cfg` are morning, midday and afternoon at +25, first watch and second watch at −25, underground at −25, deep underground at −30, and dawn, dusk and indoors with no bonus at all. Midday is not part of the default six-phase multiplayer cycle; it turns up in campaigns and custom schedules. The `fearless` trait clamps the modifier at zero, so it removes the penalty and keeps the bonus. An `illuminates` unit lifts its hex one step brighter and never past full day: `value=25 max_value=25`.
Liminal is a twilight bonus, not a penalty at both ends. `generic_combat_modifier` in `attack.cpp` gives a liminal unit `25 − abs(lawful_bonus)`, and the game's own in-game help describes it as a +25 % damage bonus during twilight. So a liminal unit does +25 % at dawn, dusk and indoors, 0 % in full day and full night, and −5 % only deep underground. In numbers, a Dune Rider's 5-2 impact attack lands 6 per strike at dawn and dusk and 5 in daylight, at night and deep underground. The `TimeWML` wiki page still documents the pre-1.14 form, `-abs(lawful_bonus)`, which would give 5 at twilight and 4 at night — understating a Dunefolk unit's best phase by a full 25 points of modifier. Ten units in the dataset are liminal, including the level-1 recruits Dune Rider and Dune Rover.
Leadership is `25 × (leader level − unit level)`, positive only. The macro is literally `value="(25 * (level - other.level))"`, and only the highest applicable leader applies, which is why the tool asks for one leader level rather than a list. A level-1 unit next to a level-3 leader gets +50 %; the same leader does nothing for a level-3 unit.
Resistance is the percentage of damage the target takes. UnitsWML again: a resistance attribute "makes the unit receive resistance percent of damage, or resist 100-resistance percent". So 60 means the target takes 60 % and resists 40 %; 120 means it takes 20 % extra. An Orcish Grunt is 100 across all six types and resists nothing. A Skeleton is blade 60, pierce 40, cold 40, impact 120, fire 120, arcane 120. A Dwarvish Fighter is 80/80/80/90/90/90. A Drake Fighter is fire 50 and cold 150. However high the resistance goes, the engine never reduces a landed hit below 1 damage — the only exception is a weapon whose base damage is 0, which deals 0.
Strikes alternate, and the surplus lands at the end. The attacker goes first unless the defender has `firststrike` and the attacker does not. After that the two sides alternate over `max(attackerStrikes, defenderStrikes)` rounds, so a 2-strike attacker against a 4-strike defender produces the order `A D A D D D` — the defender's extra strikes are not interleaved, they queue up at the back. `swarm` fixes the strike count from the HP the fight opens on, in proportion to maximum HP, and it does not change again mid-combat.
Kill XP has a level-0 special case and survival XP does not. `game_config.hpp` defines `kill_xp(level)` as `level ? kill_experience * level : kill_experience / 2` and `combat_xp(level)` as `combat_experience * level` with no zero case. So killing a level-0 unit is worth 4 XP, and merely surviving a fight against one is worth 0. UnitTypeWML says the same thing from the other side: "After this unit fights, its opponent gains level experience." A unit that dies in the exchange earns nothing at all.
Income is villages against unit levels. Gross income is the base income plus one gold per village in a campaign, two in a normal multiplayer game (`src/map_settings.cpp` returns 2 there and 1 otherwise, which is why both ship as presets). Each village also pays the upkeep of one unit level for free. Upkeep is `max(0, paying unit levels − villages × village support)`, where the paying levels are your units' levels less the loyal ones — a `loyal` unit pays nothing whatever its level, and because the panel is told how many units are loyal rather than which, it discounts them at the army's average level.
The damage formula, and how round_damage breaks a tie
b = Base damage per strike from the weapon, plus 1 if a trait applies — strong on a melee attack, dextrous on a ranged one. Undead, mechanical and elemental units take no traits at all.
t = Time-of-day modifier in percentage points: the lawful bonus for a lawful unit, its negative for a chaotic one, 0 for a neutral one, and 25 − abs(lawful bonus) for a liminal one, which peaks at +25 in twilight and bottoms out at −5 deep underground
ℓ = Leadership bonus: 25 times the level difference to the highest adjacent friendly leader, counted only when positive
r = The target's resistance value — the percentage of damage it TAKES. 100 is normal, 60 is resistant, 120 is vulnerable
s = Weapon-special multiplier — 2 for charge (which doubles what both sides deal), 2 for backstab, otherwise 1. It lands on the BASE damage and is truncated there, before the bonus is assembled; folding it into the bonus instead gives the same product and a different integer, because the rounding term flips once the bonus reaches the divisor
D = Divisor: 10000 normally, 20000 when the striking unit is slowed
ρ = The rounding term. It is half the divisor, minus 1 once the bonus reaches the divisor — which is what makes a tie fall toward the base damage instead of away from it
G = Gold trade ratio. c and h are cost in gold and maximum HP, for the target (t) and for your own unit (o). Above 1.00 the exchange makes you gold
The rounding rule is the part worth reading twice. `src/utils/math.hpp` carries its own comment — round "to the closest integer, but up or down towards base_damage" — and the code that does it is four lines:
Four consequences, all of them checkable. A base 9 at a 0.75 multiplier gives 7, and at 1.25 it gives 11. A base of 0 gives 0 — the minimum-1 floor is deliberately placed after the zero short-circuit, so a 0-damage weapon deals nothing while any weapon with damage 1 or more can never be pushed below 1 by resistance, night or slow. A base 1 at a 0.10 multiplier gives 1 because that floor binds. And `slow` re-rounds against a divisor of 20000 rather than halving an already-rounded number: a base 9 at bonus 12500 slowed comes out at 6, where halving the unslowed 11 would give you 5.
Where `charge` and `backstab` are applied matters for the same reason. Both multiply the base damage and are truncated there; the bonus only ever carries time of day, leadership and resistance. A charging Horseman is the clean demonstration: its 9-2 spear lands 18 per strike at dawn and 14 at first watch, while the Elvish Fighter's 5-4 sword answers at 8-4: charge doubles what both sides deal, taking the sword to 10, and the Horseman takes only 80 % blade. Fold that ×2 into the bonus instead of the base and first watch gives 13 — the same product, a different integer, because the rounding term flips once the bonus reaches the divisor.
The HP outcome distribution is an exact convolution, not a simulation. The engine's own `attack_prediction.cpp` chooses between `one_strike_fight`, `no_death_fight` and `complex_fight`, and its comment on the general path reads "Using exact probability calculations"; it falls back to Monte Carlo only above a complexity threshold this calculator's narrower scope never reaches. Every probability on the page is reproducible to the last digit, which matters for an audience whose main complaint about the game is the dice.
How to use the three modes
Three tabs, each keeping its own inputs when you switch away and back.
Attack — resolve one exchange
1. Choose the Attacking unit and its Attack. Searching accepts a name, a race or a faction, and ignores accents and capitals, and a Common matchups shortcut list is offered alongside it. Picking a ranged attack forces the defender to answer at range or not at all.
2. Choose the Defending unit. The Counterattack field auto-picks the defender's best answer at your range until you override it, and "No counterattack" is a legitimate value rather than an error.
3. Set both terrains. Defender's terrain is the one that drives your chance to hit; Attacker's terrain only affects the counterattack. Each option is labeled with that unit's defense on it, and an Override defense % toggle covers terrains and mods outside the fourteen listed.
4. Set Defender HP. The page opens with a wounded defender at 20 of 33 on purpose, because a full-HP level-1 pair renders 0.0 % on both cards and teaches you nothing. A Full HP button resets it.
5. Set Time of day. Each phase is labeled with its lawful bonus, and a chip reports the effective bonus once Illuminated hex is taken into account.
6. Open Advanced for the things that decide close fights: traits (strong, dextrous, resilient, fearless), Adjacent leader's level, Already slowed, Already poisoned, Backstab active, Current XP, and the XP needed to advance switch between campaign (100 %) and multiplayer (70 %) rules.
The result gives both sides a card — chance to kill, chance the attacker dies, chance neither dies, chance the attacker takes nothing, expected damage, expected HP after, XP for the kill, XP for surviving, and the gold trade ratio with a one-word verdict beside it. Below that sit the HP outcome distribution chart, a How this unit's damage is worked out table that prints base damage, time of day, leadership, resistance, specials, the combined multiplier, the rounding term and the final integer, a resistance table for the pair, and a terrain table you can click to move the defender. Copy this exact matchup as a link puts the whole state in the URL.
Unit efficiency — rank the recruits
Pick up to six Units to compare, filter by Faction and Level, choose what you are Measured against plus its terrain, and sort by gold trade ratio, damage per gold, gold per HP, effective HP per gold, expected damage dealt, cost or HP. Turns the unit stays alive feeds a True cost column, which is the recruit price plus one gold per level per turn of upkeep. Any row opens straight into the Attack tab. The time of day defaults to dusk deliberately: at a lawful bonus of 0 alignment cancels out, so the ranking is not secretly a ranking of chaotic units.
Income and upkeep — can you afford the next one
Enter Villages held, Base income per turn, Gold per village (campaign 1 or multiplayer 2), Unit levels supported per village, your unit counts by level, how many are Loyal, your Current gold and the Cost you are saving for — which defaults to 20, the recall cost. You get gross income, upkeep, net income, the levels your villages support for free, how many more levels you can field before upkeep starts, the level count you could sustain at zero net income, and the turns until you can afford the target.
The link is the point. The permalink is built against the calculator's static input contract, so it carries every field you changed and omits only the ones still at their default — and the recipient's own stored state for that tab is skipped whenever the URL names any field of it. A matchup you paste into a forum reply reopens as the matchup you were arguing about, not as their defaults.
Worked examples on the calculator's own numbers
The default matchup — Orcish Grunt into a wounded Elvish Fighter at first watch
An Orcish Grunt at 38 of 38 HP on flat attacks an Elvish Fighter at 20 of 33 HP on flat, at first watch. The Grunt is chaotic and first watch carries a lawful bonus of −25, so its sword gains 25 %: base 9 becomes 11 per strike, twice. The Fighter's flat defense is 40 %, so the chance to hit is 60 % and expected damage is 12.5 against 20 HP. Coming back, the Fighter's 5-4 sword lands 5 a strike at 60 % for 8.8 expected — the Grunt is at 40 % defense too.
The outcome: chance to kill 36.0 %, chance the attacker dies 0.0 %, chance neither dies 64.0 %, chance the attacker takes nothing 16.0 %. The 0.0 % is not a rounding artifact — four strikes of 5 is 20 damage against 38 HP, so this fight cannot kill the Grunt however the dice fall. Strike order is `A D A D D D`: the elf has four strikes to the orc's two, and the two spare ones land at the back. XP is 8 for the kill and 1 for surviving, against an advancement threshold of 29 under multiplayer rules. And the gold trade ratio is 1.91 — the Grunt is buying 14-gold elf HP with 12-gold orc HP, and buying it at nearly two to one.
Move the defender one hex into forest
Same two units, same time of day, defender in forest instead of on flat. The Elvish Fighter's forest defense is 60 %, so the Grunt's chance to hit falls from 60 % to 40 % — and the chance to kill falls from 36.0 % to 16.0 %.
One hex of terrain more than halves the kill chance. That is the entire terrain argument in a single line, and it is the number to reach for the next time somebody says the difference between flat and forest is marginal. Note what did not change: the damage per strike is still 11, because terrain never touches damage. Only accuracy moved.
Time of day, same matchup — when a fight stops being possible
The Grunt is chaotic, so the day hurts it and the night pays it. Holding everything else at the default matchup:
Time of day
Lawful bonus
Grunt damage
Chance to kill
Dawn
0
9 × 2
0.0 %
Morning
+25
7 × 2
0.0 %
Dusk
0
9 × 2
0.0 %
First watch
−25
11 × 2
36.0 %
Deep underground
−30
12 × 2
36.0 %
Midday and afternoon share morning's +25; second watch shares first watch's −25; underground is −25. Read the shape rather than the rows: between morning and first watch the Grunt's strike goes from 7 to 11, and that turns a fight it mathematically cannot win — 18 maximum damage against 20 HP at dawn, 14 at morning — into a better-than-one-in-three kill. Waiting one phase is often worth more than any positioning you could do instead.
Why the Skeleton wins the level-1 gold ranking, and why that is about the target
Rank all 50 level-1 units by gold trade ratio against an Orcish Grunt on flat at dusk and the Skeleton comes first at 1.50. The arithmetic, end to end: the Skeleton's axe is 7-3 blade, the Grunt takes 100 % blade and sits at 40 % defense, so 7 × 3 × 0.60 = 12.6 expected damage dealt. Coming back, the Grunt's 9-2 blade meets 60 % blade resistance — 9 × 0.60 = 5.4, which `round_damage` turns into 5 — and 5 × 2 × 0.60 = 6.0 taken. Now price it: Grunt HP is worth 12/38 = 0.316 gold a point and Skeleton HP is worth 15/34 = 0.441, so the Skeleton destroys 12.6 × 0.316 = 3.98 gold and loses 6.0 × 0.441 = 2.65. That is 1.50.
The top of the table: Skeleton 1.50, Dune Soldier 1.20, Heavy Infantryman 1.19, Drake Clasher 1.05, Orcish Grunt 1.00, Dwarvish Fighter 0.96, Spearman 0.95, Wose 0.89, Goblin Rouser 0.88, Troll Whelp 0.87, Goblin Impaler 0.84, Elvish Fighter 0.83.
Now find the Horseman, because it is the whole argument for reading the ratio at all. It deals 21.6 expected damage — the most of any level-1 unit in the pool, against the Skeleton's 12.6 — and it ranks 18th of 50, at 0.64. Two things sink it: at 24 gold it is the priciest recruit in the Loyalist list, so each of its own HP is expensive to lose, and its `charge` doubles what comes back at it as well as what it deals, so the Grunt hits it for 16.8. A unit can lead its tier on damage dealt and still lose gold on the exchange, which is why "how hard does it hit" is the wrong question to open with.
And here is the part that matters more than the ranking: the Skeleton is first because of the target. A Grunt's only attack is 9-2 blade, and the Skeleton takes only 60 % blade. Change the target to something that swings impact or throws fire and the Skeleton falls, because it takes 120 % of both. Reading that row off as "the Skeleton is the best level-1 unit" drops the half of the sentence that carries the meaning. Ranged-only units — Orcish Archer, Skeleton Archer, Poacher, Saurian Augur, Orcish Assassin — sort last here with no ratio at all, because a Grunt has no ranged attack to counter with and an unopposed exchange has no ratio rather than an infinite one.
Effective HP — why a Dwarvish Fighter's 38 HP is worth 48
The four units the efficiency tab opens with, measured against an Orcish Grunt on flat at dusk over ten turns:
Unit
Gold trade ratio
Effective HP
Effective HP per gold
True cost, 10 turns
Orcish Grunt
1.00
38
3.17
22
Elvish Fighter
0.83
33
2.36
24
Spearman
0.95
36
2.57
24
Dwarvish Fighter
0.96
48
3.00
26
The Dwarvish Fighter has 38 printed HP, the same as the Grunt, and 48 effective HP against this attacker — dwarves take 80 % blade, so every point of HP absorbs a quarter more blade damage than it looks like it should. That is the single most useful column in the mode, because it is the one the unit card in the game does not give you. Note also that the ratio and the effective HP disagree about who is best: the Grunt wins on effective HP per gold at 3.17 while the Dwarvish Fighter wins the durability column outright, and the Grunt only ties at 1.00 because it is being measured against itself.
Slow — the modifier that does not do what its description says
Slow "halves the damage caused by attacks", and if you halve the number on the screen you can land on the wrong integer. The engine re-runs the whole rounding with a divisor of 20000 instead of 10000, which is not the same operation as dividing the result by two.
Take the Grunt at first watch again: unslowed it deals 11. Halve that and you get 5.5, which rounds to 5. Run it the way the engine does — base 9, bonus 12500, divisor 20000 — and the answer is 6. One point, on a strike that lands twice, against a defender on 20 HP: that is the difference between a fight that can kill and one that cannot. The damage audit table prints the divisor it used, so you can always see which of the two is in play.
Income and upkeep — what the army costs before you swing at anything
Upkeep is `max(0, paying unit levels − villages × village support)` and net income is `base income + villages × gold per village − upkeep`. The page opens on the common campaign shape: 6 villages, base income 2, 1 gold per village, 1 level supported per village, six level-1 and two level-2 units, one of them loyal, 50 gold in hand, saving for 20 — the recall cost.
The gross is 2 + 6 = 8 gold a turn, and the six villages carry six unit levels free. The army's raw level total is 6 × 1 + 2 × 2 = 10, but the panel reports 9 paying levels, and the missing one is the loyal unit — deducted at the army's average level, because the input asks how many units are loyal and not which ones, so 1 × 1.25 rounds to 1. Nine paying levels against six free ones gives upkeep 3 and net income 5, with 0 free levels left over and 14 unit levels sustainable at zero net income. The 50 gold in hand already covers the 20 you are saving for, so the turns-to-afford line reads 0. Work upkeep as raw levels minus free levels and you get 4 here; the loyal deduction is the step that is missing.
A loyal unit pays no upkeep whatever its level, and a level-0 unit — a Walking Corpse, a Goblin Spearman — pays none either, because upkeep is the level. That is the real argument for a Walking Corpse screen: eight gold up front and nothing per turn after it. Switch the preset to multiplayer and one number moves — a normal multiplayer game pays 2 gold per village rather than 1, which doubles the village half of the income and makes the same six villages worth 12 a turn on top of the base 2.
Terrain defense in the default matchup — Orcish Grunt against Elvish Fighter
Terrain
Grunt defense
Elvish Fighter defense
Grunt's chance to hit
Deep water
0 %
0 %
100 %
Shallow water
20 %
20 %
80 %
Reef
30 %
30 %
70 %
Swamp
30 %
30 %
70 %
Flat
40 %
40 %
60 %
Sand
30 %
30 %
70 %
Forest
50 %
60 %
40 %
Hills
50 %
50 %
50 %
Mountains
60 %
60 %
40 %
Village
60 %
60 %
40 %
Castle
60 %
60 %
40 %
Cave
40 %
30 %
70 %
Frozen
20 %
30 %
70 %
Mushroom Grove
40 %
50 %
50 %
Eight places the data and the screen disagree
Reading a WML defense value as a defense. The data file stores the chance to be hit, and the game shows you `100 − value`. An Elvish Fighter's `forest=40` is 60 % defense on screen, not 40 %. Flip the polarity once and every terrain conclusion you draw after it is inverted.
Giving the Elvish Fighter 70 % in forest. The 70 % belongs to the `woodland` movement type, which the Elvish Archer and the Elvish Shaman carry. The Fighter and the Scout are overridden down to 60 %, and the official How to play Rebels page reflects that carefully — it gives 70 % to the Archer and the Shaman by name and says only "good defense in forest" for the Fighter and the Scout. The conflation survives because all four share a faction, a race and the same movement-type name, and on the Fighter only the forest row is overridden at all. Rebels sit at 60–70 % in forest depending on the unit, never a flat 70.
Expecting 1 XP for surviving a fight with a level-0 unit. You get 0. `kill_xp` has a level-0 special case worth 4 XP; `combat_xp` has none, so it is one XP per level of a surviving opponent and a level-0 opponent is worth nothing. Farming XP off Walking Corpses only works if you finish them.
Halving the displayed damage for slow. Slow re-rounds against a divisor of 20000; it does not divide the integer you can see. A base 9 that shows 11 becomes 6 when slowed, not 5. The audit table prints the divisor so you can tell which path ran.
Applying the modifiers one at a time, or putting the wrong ones together. The engine assembles `(100 + time of day + leadership) × resistance` and rounds once. Two ways to get this wrong: rounding after each step, or folding a weapon special into that bonus. `charge` and `backstab` multiply the base damage instead — a charging Horseman at first watch deals 14 the right way round and 13 the wrong one, from the same product, because the rounding term flips once the bonus reaches the divisor.
Assuming an Elvish Archer has marksman. It does not. `marksman` arrives at level 2, on the Elvish Marksman. The level-1 Archer hits at whatever the terrain says, which is exactly why an Archer struggles against a unit in the mountains and its promotion does not.
Treating 0 % defense as an easy target, or assuming water and swamp are 0 %. A 0 % row means the unit cannot be placed on that hex — the raw value is 100 and the row is there for reference. In the default matchup that is deep water alone. Shallow water and swamp are ordinary walkable hexes at 20 % and 30 %, and their rows are clickable like any other; reading them as 0 % turns two real defensive positions into imaginary free hits.
Assuming everything on an undead recruit list is immune to poison and drain. Only the units of the undead race are. The Dark Adept is human and the Vampire Bat is a bat, and both take poison and both feed a drain attack normally. The official How to play Undead page does not say which recruits are which, and the calculator flags the immunity per unit instead.
Getting an argument settled with the numbers
Read the ratio, not the damage. A trade that looks bad in HP can be good in gold, and the reverse is just as possible — cheap HP on the far side of a trade pulls every ratio down. The Skeleton's 12.6-for-6.0 damage trade against a Grunt looks like better than 2 to 1 and prices out at 1.50, because Grunt HP costs 0.316 gold a point against the Skeleton's 0.441. The Horseman is the same lesson from the other end: 21.6 damage dealt, the most in the tier, and an 0.64 ratio.
Above 1.00 you are making gold; below it you are spending gold to make progress. Both can be correct. Spending gold to hold a village, to protect a unit two XP from advancing, or to finish a wounded level-2 that would otherwise heal is a decision the ratio informs and does not make. What it stops is spending gold by accident.
Check the time of day before you check the positioning. A chaotic attacker swings 7 in the morning and 11 at first watch on the same weapon against the same target — and against a 20-HP defender that is the difference between 0.0 % and 36.0 % to kill. Waiting a phase is free; walking into a bad hex is not.
One terrain step moves the odds further than it looks like it should. Moving the same Elvish Fighter from flat to forest cuts the Grunt's kill chance from 36.0 % to 16.0 % without changing a single point of damage. When you are deciding between finishing a kill this turn and standing somewhere better, run both hexes through the terrain table.
Use effective HP when you are choosing who to put in front. A Dwarvish Fighter's 38 HP is worth 48 against blade because dwarves take 80 %. That column tells you which unit survives this attacker, which is a different question from which unit has the biggest number on its card.
Sort the ranking by damage per gold when you are behind on gold, and by effective HP per gold when you are behind on board position. They are different orderings and they answer different problems. Of the twelve units at the head of the level-1 ranking, the Goblin Impaler leads on damage per gold at 1.11 while sitting eleventh on the trade ratio at 0.84; a Wose costs 20, carries 52 HP and trades at 0.89.
Set the ranking's target before you trust the ranking. Every number in that mode is measured against one specific defender on one specific hex. Change the target and the order changes, which is the mode working correctly rather than a flaw in it.
Remember what upkeep does to a plan. Upkeep is the unit's level, every turn, forever, and villages cover one level each. A second level-2 unit on six villages costs two gold a turn out of an eight-gold income — over ten turns that is more than the recruit price of a Spearman. The true-cost column prices exactly that.
Paste the link, not the claim. The permalink carries every input you changed, and the recipient's saved state for that tab is skipped whenever the URL names one of its fields, so the matchup reopens as yours. A reply that links the exact exchange under discussion ends the argument; a reply that asserts a number restarts it.
What this calculator deliberately does not model
Being exact about one exchange means refusing to fold in things that belong to a different question. Each exclusion below is a decision.
One attacker against one defender. The distribution is an exact convolution over both units' HP, and it stays exact because the scope is bounded: no second attacker in the same turn, no level-up mid-combat, no healing between rounds. A turn in which three units hit the same target is three separate exchanges, and running them in sequence by hand is correct — the second one just starts from a distribution rather than from a number.
Petrify and plague are reported, not simulated. A weapon that turns the target to stone or raises a Walking Corpse on a kill gets a note saying so. Neither changes the HP arithmetic of the exchange itself, so neither enters the distribution.
Poison is a post-combat effect. It costs 8 HP on the following turn and never takes a unit below 1 HP, so it has no effect inside the exchange. What the page reports is the probability that the defender ends up poisoned, which is the number that should feed your next turn's plan.
Berserk is capped at 30 rounds, the engine's own limit, and the round cap is 1 for every other matchup.
Mainline 1.18.7, Default era. 192 units, 349 attacks, 7 factions, read from the game's data files at a pinned commit. Add-on eras, user-made campaigns and modded unit trees change the constants this page is built on; the formula still applies, the numbers do not. A Custom unit option exists for exactly that case — level, alignment, cost, HP, damage, strikes, damage type, range, weapon specials, all six resistances, defense and the traitless flag are all editable, and a custom unit rides in the permalink like any other.
The efficiency ranking is one exchange, not a battle. Each row picks the unit's highest-expected-damage weapon against the chosen target and prices the counterattack at the same range, on the defensive side — so a ranked unit's own `charge` doubles what comes back at it, which is what puts the Horseman 18th. It does not model zone of control, retreat, healing, terrain movement cost or the second turn. It answers "what does this recruit cost me per point of damage against that thing", which is the question the recruit menu cannot answer.
Leadership takes one level, because only one leader counts. The engine applies the highest applicable leadership and discards the rest, so a list of adjacent leaders would be a list with one entry that matters.
Damage per strike is the base damage times a single multiplier, rounded once. The engine builds (100 + time-of-day modifier + leadership bonus), multiplies that by the target's resistance value, and passes it to round_damage with a divisor of 10000 — or 20000 if the striker is slowed. The modifiers are never applied one at a time with a rounding in between. Weapon specials sit on the other side of the sum: charge and backstab double the base damage before the multiplier is assembled, not the multiplier itself.
What determines the chance to hit in Wesnoth?
Only the defender's terrain. Chance to hit is 100 minus the defender's displayed defense percentage, and your own hex never changes it. Three specials override the terrain: magical fixes it at 70 %, marksman raises an attacker to at least 60 %, and the defender's deflect subtracts 10 points.
Does an Elvish Fighter get 70 % defense in forest?
No — 60 %. The 70 % belongs to the woodland movement type, which the Elvish Archer and the Elvish Shaman carry; the Elvish Fighter and the Elvish Scout are overridden down to 60 %. The official How to play Rebels page gives 70 % to the Archer and the Shaman by name and says only "good defense in forest" for the Fighter. Rebels run 60–70 % in forest depending on the unit.
How much XP do I get for surviving a fight?
One XP per level of the surviving opponent — so nothing at all against a level-0 unit. Killing is different: 8 XP per level, and 4 for a level-0 kill. A unit that dies in the exchange earns nothing.
What is the gold trade ratio?
It prices an exchange in gold instead of hitpoints. Every point of HP you remove is worth the target's cost divided by its maximum HP; every point you lose is worth yours divided by yours. Divide the first by the second and above 1.00 the fight destroys more gold than it costs you. Nothing in the game shows this, which is why it is the headline number here.
Does slow just halve a unit's damage?
Not quite. Slow re-rounds the whole calculation against a divisor of 20000 rather than dividing the visible integer by two. A strike showing 11 becomes 6 when slowed, not 5 — and on a two-strike attack that one point can decide whether the fight can kill at all.
Does charge double the damage the defender deals back?
Yes. Charge doubles what both sides deal for that exchange, which is what makes it a gamble rather than a free upgrade. A Horseman's 9-2 spear lands 18 per strike at dawn and 14 at first watch, and the Elvish Fighter it charges answers with 8-4 instead of its usual 5-4 — doubled to 10, then cut to 8 by the Horseman taking 80 % blade. That is also why the Horseman ranks 18th of 50 on the gold trade ratio while dealing the most damage in the level-1 pool.
Which level-1 unit is the most gold-efficient?
It depends entirely on what it is fighting, and that is the point of the mode. Against an Orcish Grunt on flat at dusk the Skeleton leads at a 1.50 ratio, ahead of the Dune Soldier at 1.20 and the Heavy Infantryman at 1.19 — but the Skeleton only wins there because a Grunt's only attack is blade and a Skeleton takes 60 % blade. Point it at something with an impact or fire attack and the Skeleton, which takes 120 % of both, drops down the table. The Horseman is the warning at the other end: it deals 21.6, more than anything else at level 1, takes 16.8 back once its own charge is priced, and lands 18th of 50 at 0.64. Set your target first, then read the ranking.
My ratio came out at 0.85. Should I still attack?
Sometimes, and the ratio is what lets you decide on purpose. Below 1.00 you are spending gold to buy something else: a village, a hex you need next turn, the removal of an enemy unit two XP from advancing, or finishing a wounded level-2 before it heals to full. All of those can be worth more than the gold. What a ratio under 1.00 rules out is spending it by accident because the chance-to-kill number looked encouraging.
Is this calculator free to use?
Yes, and nothing is gated. The damage audit table, the HP distribution, the resistance table, the terrain table and the full 50-row level-1 ranking are all open from the first render — no account, no limits.
How accurate is it compared with the game?
It reproduces mainline 1.18.7 for the cases it covers. The rounding rule, the multiplier order, the chance-to-hit overrides, the strike alternation, the XP awards and the income and upkeep rules are ports of the engine's own code at a pinned commit, and the unit stats, resistances and terrain rows are extracted from the game's data files rather than transcribed. The HP distribution is an exact convolution, not a simulation, so the same inputs always give the same digits. Out of scope: several attackers hitting the same target in one turn, a level-up in the middle of a fight, and any era outside mainline Default.
Can I link a specific matchup in a forum reply?
Yes — that is what the URL is for. "Copy this exact matchup as a link" writes every non-default input into the address, including a fully custom unit, and the reader's own saved state for that tab is ignored whenever the link names any of its fields. The matchup reopens as yours rather than as their defaults.
Does it cover add-on eras, UMC campaigns or modded units?
Not as presets. The dataset is mainline 1.18.7 Default era only — 192 units and 349 attacks. For anything else use the Custom unit option, which takes level, alignment, cost, HP, damage, strikes, damage type, range, weapon specials, all six resistances and a defense percentage. The formula is the engine's either way; only the stat table changes.
Why do some terrains show 0 % defense?
Because the unit cannot be placed there. A terrain a land movetype cannot enter carries a raw WML value of 100, which displays as 0 % defense — in the default matchup that is deep water and nothing else. Shallow water and swamp are walkable and read 20 % and 30 %. A 0 % row means the hex is unavailable, not that the target is defenseless.
How does upkeep work, and how many units can I hold?
Upkeep is one gold per unit level per turn, and each village you hold pays for one level free. So upkeep is your units' paying levels — the total less any loyal ones — minus villages times village support, floored at zero, and net income is base income plus village gold minus that. A level-0 unit costs nothing because upkeep is the level, and a loyal unit costs nothing whatever its level.