Skip to content

Combat Mechanics Reference

This page documents how combat actually resolves, turn by turn. It is meant for planning: given two forces, you can work out the result yourself before committing units. For the API calls, see Combat & Raiding.

Is combat deterministic?

Yes — combat is fully deterministic, with no randomness. The same attacker force against the same defender state always produces the same battle, turn for turn. There are no dice rolls and no luck. Unit groups are processed in a fixed (side, unit type id) order everywhere, so the same inputs always produce the same replay.

Does unit composition matter?

Yes — very much. Combat is not a comparison of two power numbers. Every unit type has a class (infantry, cavalry or machine), hit points, a range, and four separate attack values: against infantry, against cavalry, against machines, and against buildings. Damage is always read against the class of what is being hit, so the right counter matters more than the bigger total, and a force that cannot bring down a Wall cannot take a walled city no matter how large it is.

The battlefield

The field is a one-dimensional lane of whole paces, 0 to battlefield_length (20 on the shipped realms).

  • Attackers enter at 0. Defenders stand at battlefield_length.
  • If the defending town has any wall buildings, the Wall stands one pace in front of the defenders, at battlefield_length - 1, with sum(wall levels) * wall_hp_per_level * (1 + 0.1 * engineering_level) hit points (10,000 per level on the shipped realms; the defending town’s Engineering research hardens each level — 15,000 at Engineering 5, 20,000 at 10, the per-level figure rounded down to a whole point).
  • With the town’s gates closed (the default), defenders hold position while their own Wall stands. They only leave the wall line once it is breached. With the gates open they sortie: a defender group with nothing to attack advances toward the attackers by its speed, through its own gate, from the very first turn — the same movement rule attackers follow.

The turn loop

Each turn runs in four steps, and the battle runs for at most max_turns turns (50 on the shipped realms).

  1. Targeting, from the state at the start of the turn.
    • A ranged group (range > 0) fires at the nearest enemy group within its effective range (see Range — the unit’s range, lengthened by its own side’s Archery), ties broken by unit type id. An attacking machine with the standing Wall in effective range shells the Wall instead.
    • A melee group (range == 0) hits an enemy group standing on its own pace, preferring an enemy melee group. An attacking melee group standing at the Wall’s pace hits the Wall.
    • A group with nothing in reach does nothing this turn.
  2. Damage, applied simultaneously — nobody gets a first strike for being listed first.
    damage = group_count * attacker_unit.attack_vs_<target class> * (1 + bonus)
    bonus is the side’s own research + hero bonus (see below). A ranged shot aimed at a defender standing at or behind the Wall’s pace, while the Wall still stands, is divided by 1 + wall_bonus. A defender group that has sortied past the Wall’s pace (open gates) has left its cover and is hit at full strength. Melee damage is never divided — the Wall stops melee by standing in the way, not by softening it.
  3. Casualties. Each group pools the damage it took and converts it into whole kills:
    kills = floor(pooled_damage / ((unit.hp + unit.defense) * (1 + 0.05 * medicine_level)))
    medicine_level is the group’s own side’s Medicine research — the defending town’s for the garrison, the origin town’s for the attacking army. The remainder carries forward to later turns, so nothing is wasted and no unit dies twice. Damage aimed at the Wall is subtracted from its hit points; when they reach zero the Wall is breached.
  4. Movement. Only groups that had nothing to attack advance, by their speed, toward the nearest enemy — stopping at the first enemy group or standing Wall in the way. Defenders behind a standing Wall never move unless their gates are open, in which case they advance like anyone else (the Wall never blocks its own side).

Range

A ranged group’s reach this battle is

effective_range = floor(unit.range * (1 + 0.05 * archery_level))

archery_level is the group’s own side’s Archery research — the defending town’s for the garrison, the origin town’s for the attacking army — and it covers every unit with range > 0 whatever its class (archers, ballistae, rams and catapults alike; melee units have range 0 and are never affected). The field is whole paces, so the bonus is step-wise: a range-6 archer reaches 6 through Archery 3 (6.9 rounds down), 7 at level 4, 8 at level 7 and 9 at level 10; a range-7 ballista reaches 8 at level 3, 9 at 6 and 10 at 9; a range-8 catapult reaches 9 at level 3, 10 at 5, 11 at 8 and 12 at 10; a range-3 ram reaches 4 at level 7. Range decides when a group starts firing (and, for an attacking machine, how far out it shells the Wall) — never how hard it hits or how the Wall softens the shot.

How a battle ends

  • Attacker wins the turn the last defender group dies while an attacker group still stands.
  • Attack repelled the turn the last attacker group dies. A mutual wipe on the same turn counts as repelled.
  • Withdrawal if the turn limit runs out with both sides still standing. The attacker does not win, and marches home with whatever survived.

A repelled or withdrawn attacker loots nothing. Both can bring survivors home — losing a battle no longer means losing every unit.

Bonuses

  • attacker_bonus and defender_bonus are the additive sums of a town’s own completed research combat bonuses — research is per-town, not player-wide, permanently. attacker_bonus comes from the origin town’s completed attack-bonus techs (an army carries the research of the town it marched from); defender_bonus comes from the defending town’s own completed defense-bonus techs. Two completed techs of +0.1 give 0.2, i.e. *(1 + 0.2).
  • defender_bonus also includes the hero garrisoned in the defending town — the highest-level idle hero stationed there leads the defence (Evony Age 1: “your highest-level idle hero defends”; ties break on higher attack), contributing its attack stat as a percentage (a hero with attack 20 contributes 0.20). A hero away on a march does not defend. This mirrors the attacker’s hero, which contributes its own attack stat to attacker_bonus — Evony’s AttackModifier = 1 + HeroAttack/100 + … formula on both sides. (A hero’s politics and intelligence stats do not enter battle damage; Evony’s Intelligence-based damage soak has no hook in this engine yet.)
  • Bonuses scale the damage a side deals. They never change how much damage a unit soaks, which is hp + defense — scaled only by that side’s own town’s Medicine (× (1 + 0.05 × level), see Casualties) — nor how far it reaches, which is its range scaled only by that side’s own town’s Archery (see Range). Medicine, Archery, the Wall’s Engineering, wall_bonus and both side bonuses are all frozen into the battle’s stored inputs when it resolves, so a replay always reproduces the fight as fought even if research finishes afterwards.
  • Wall fortifications fire with the defender’s defender_bonus too — a volley is stock * attack * (1 + defender_bonus), never divided by wall_bonus.

The wall bonus

wall_bonus = sum(level * building.wall_defense_bonus
+ level**2 * building.wall_defense_bonus_quadratic
for each defender building instance)
  • It comes only from the defender’s buildings that declare either coefficient. Both are published per building type by GET /api/v1/buildings/types.
  • It buys exactly one thing: ranged fire aimed past a standing Wall is divided by 1 + wall_bonus. Melee and siege damage ignore it entirely.
  • The square is applied per building instance, so two level-5 Walls give 2 * 5² = 50 units of the quadratic coefficient while one level-10 Wall gives 10² = 100. Tall beats wide, deliberately.
  • On the shipped fast and free realms the Wall runs wall_defense_bonus 0.5 with wall_defense_bonus_quadratic 1.2 and caps at level 11. So a level-3 Wall reads 3*0.5 + 9*1.2 = 12.3, a level-8 Wall 4 + 76.8 = 80.8, and a maxed level-11 Wall 5.5 + 145.2 = 150.7. Every level is worth more than the one before it — which is why the last few levels are where a city stops being takeable, and why they are priced accordingly.
  • A building that omits wall_defense_bonus_quadratic defaults it to 0, giving a purely linear wall.

Wall fortifications

The defending town’s garrisoned wall fortifications fight as emplacements fixed at the Wall’s pace (battlefield_length - 1), whether or not a Wall is standing. Every type follows one rule, described by four facts from the realm’s catalog (GET /api/v1/fortifications/types): whom it fires at (target_classes — attacker unit classes; empty means everyone), from how far (range, in lane paces from the Wall — 0 is contact: the attacker must be standing at the Wall’s pace), whether it fires once (one_shot), and, for a type that can be shot back at, what stat attackers read against it (damage_class).

Each turn, from the start-of-turn snapshot, a type with any stock left looks for attacker groups whose class it targets and whose position is at least battlefield_length - 1 - range. If there are any, it deals

volley = stock * attack * (1 + defender_bonus)

split across those groups in proportion to their counts and pooled exactly like troop damage — every exposed soldier is equally exposed, so a one-unit decoy soaks one unit’s share, not half the volley. Fortification fire lands simultaneously with everything else, is never divided by wall_bonus, and does not care whether the Wall stands: a breached wall still carries its towers.

  • One-shot types (Trap, Abatis, Rolling Log, Defensive Trebuchet) fire their entire stock at once the first turn an eligible target is in reach, then are spent — the whole stock is reported as lost. They are never targets: nobody shoots a trap, you burn it with a cheap wave. A stock that is never triggered (abatis against an infantry-only raid, traps against archers that stop six paces short) survives the battle intact.
  • Persistent types (Archer’s Tower) fire every turn and are the only fortifications that stand on the field as a target. A tower soaks (hp + defense) * (1 + 0.1 * engineering_level) per unit — the same Engineering multiplier that hardens the Wall — and attackers read their attack_vs_<damage_class> against it (buildings for the tower: the stat that shells the Wall). Attacking ranged groups pick the nearest enemy as always, and since the Wall’s pace is nearer than the held line they shoot the towers before the garrison — at full damage, no wall_bonus. Attacking machines still shell the Wall first while it stands. Attacking melee hits the Wall while it stands; after the breach it hits defender troops on its own pace first and the towers only when no troop group is there. Towers never move; an army walking toward them stops on their pace, as it would at any enemy — so a cavalry charge over a breached (or absent) Wall pulls up at the towers rather than riding past them.
  • Winning against towers. The attacker wins only when every defender troop group and every persistent emplacement is gone — a town with no troops and one standing tower repels a lone worker. One-shot stocks are not defenders: a town whose only “garrison” is a trap field falls to the first unit that walks in without triggering it.

The shipped realms’ catalog (numbers derived from the canonical roster):

TypeFires atReach (paces)FiresAttackCan be shot at?
Trapinfantry0 (contact)once, the whole stock250 — one warrior’s soak, so 100 traps kill 100 warriorsno
Abatiscavalry0 (contact)once680 — one cavalry’s soakno
Archer’s Towereveryone6 (an archer’s reach)every turn300yes — soak 2,000 + 360, read against attack_vs_buildings
Rolling Logeveryone6once500no
Defensive Trebuchetmachines9 (one more than a catapult)once800no

The Defensive Trebuchet’s reach is deliberately one pace longer than the roster’s longest siege reach, so a trebuchet stock fires the turn before the first stone can land: 800 against a catapult’s 680 soak means a stock roughly equal to the siege train wipes it before it shells anything. Archer’s Towers reach exactly as far as archers, so archers trade volleys with them — while ballistae (reach 7) and catapults (8) out-range them and strip a tower-only town unhurt.

After the battle, the defender’s losses (spent stocks, destroyed towers) come off the garrison, minus the free repair: each type regenerates floor(lost * fortification_repair_rate * (1 + machinery_level)), capped at what it lost (0.03 base on the shipped realms; see Machinery). A persistent type wiped out to the last emplacement repairs nothing (Evony’s “reduced to zero” rule); a spent one-shot stock does repair its share — spending is not destruction. Later attacks in the same batch fight the reduced stock, exactly as they fight the damaged Wall. The report’s fortifications_lost_defender shows the losses per type to both sides, and the replay carries each turn’s standing tower stock plus the fortification_fired / fortification_spent / fortification_casualties events. The stock at the start of the battle is frozen into the stored inputs like the garrison, so a replay always reproduces the fight as fought; battles resolved before fortifications took part replay with none.

Worked example

A town defended by 60 pikemen behind a level-8 Wall on a shipped realm — wall_bonus 80.8, Wall hit points 8 * 10,000 = 80,000. The defender has all three defense technologies (+0.45) and a hero at attack 20, so defender_bonus is 0.65. Every attacker below has both attack technologies (+0.25) and a hero at attack 20, so attacker_bonus is 0.45. Five armies, same target, fought through the real engine:

ArmyResultTurnsWallSurvivors
200 archersrepelled (withdrawal)50untouchedall 200 archers; 26 pikemen
10 ramsrepelled47breached turn 39none; 27 pikemen
10 catapultsattacker wins26breached turn 21all 10 catapults
200 swordsmenattacker wins24breached turn 22176 swordsmen
200 swordsmen + 20 catapultsattacker wins19breached turn 16191 swordsmen, 20 catapults

Read the table as one lesson each:

  • Archers alone cannot take a walled city. Each shot is divided by 1 + 80.8, so 200 archers grind down 34 of 60 pikemen in fifty turns and run out of clock. They also lose nobody — a melee garrison behind its own Wall cannot reach them.
  • A wall-breaker is not an army. Ten rams grind the Wall down from three paces out, but it takes them until turn 39, and once the pikemen come out from behind it ten slow machines are chewed up.
  • Long-range siege can take a melee-only city on its own. Ten catapults shell the Wall from eight paces — further than anything in the garrison can answer — and when the pikemen finally come out they have to walk into eight turns of 600-damage volleys. This is Evony’s farming doctrine: out-range the defence and it never touches you. The counter is a garrison with reach of its own (archers, ballistae, an Archer’s Tower) or a Wall thick enough to run the clock.
  • Melee alone works, slowly. Swordsmen batter the Wall down with their attack_vs_buildings 100 and then fight — but they spend twenty-two of their twenty-four turns walking and hitting stone, and lose 24 doing it.
  • Combined arms is the fastest and the cheapest. Twenty catapults open the Wall on turn 16 — six turns earlier than the swordsmen manage alone — and the swordsmen walk through it, finishing on turn 19 with nine lost instead of twenty-four.

Balance: what the roster guarantees

The twelve unit types are Evony Age One’s, and the counters below are measured against the shipped realms rather than asserted — they are pinned as tests, so they cannot drift without someone deciding to move them.

Read every counter against a budget. Two of them matter, and most matchups depend on which one you are short of. Population (housing) caps the army you can keep standing; resources are what replacing losses costs. Of the three classic counters — pikes stop horse, horse rides down bows, bows shoot militia — two hold under both budgets and one reverses: pikemen beat cavalry and archers beat warriors whichever way you count, but cavalry beat archers only at equal population; buy the same two forces with resources and the archers win instead. The pikeman’s counter holds against cataphracts as well, because its 270 attack_vs_cavalry is a bonus against the class, not against one unit.

At equal population — the parity that decides what you can field at once — the line units rank straight down, each beating everything below it:

pikeman → swordsman → cavalry → archer → cataphract → warrior

At equal resource cost — what it costs to replace what you lost — the order is very nearly the reverse:

archer → warrior → pikeman → swordsman → cavalry → cataphract

Because the two ladders disagree, several matchups flip depending on which budget binds. This is not a quirk to plan around; it is what the canonical prices mean. The three worth memorising:

matchupat equal populationat equal resource costwhy
cavalry vs archerscavalry winarchers wina cavalryman costs 2,100 to an archer’s 950, so the same money buys more than twice as many bows
pikemen vs warriorspikemen winwarriors wina pikeman costs 750 to a warrior’s 230 — over three militiamen per pike
swordsmen vs archersswordsmen win, narrowlyarchers winthe swordsman soaks 600 for a single population, but costs 750 to the archer’s 950

Read it as: archers are the best value per resource spent and out-trade every foot line if your stockpile is the constraint; pikemen and swordsmen are the best value per unit of housing and win if space is. Cataphracts and cavalry are expensive on both counts and are bought for their speed — five and four paces a turn, enough to cross the lane through at most two volleys — rather than for their efficiency. Bring pikes against horse whichever way you are counting.

Three more things the roster guarantees regardless of budget:

  • A catapult train opens a Wall on its own. Three catapults strip a level-5 Wall inside the turn limit, from further out than any garrison can answer.
  • Scout-only attacks always lose. Scouts fight (attack 20) rather than dealing nothing, but they lose to any equal-population garrison of any combat unit.
  • Reach decides who takes losses, soak decides who wins. In the open, 300 archers wipe 600 warriors without losing one — the militia die walking. The same bow line loses to 600 swordsmen, who soak twice as much and survive the walk. And against a Wall, ranged fire is divided by 1 + wall_bonus, so a bow line alone cannot take a town at all (see the worked example).

What is deliberately not modelled (so do not plan around it):

  • Evony’s per-unit situational bonuses. Only the pikeman’s bonus versus the cavalry class survives. Evony’s cavalry/cataphract bonus versus Archers specifically, and the swordsman’s versus Pikemen, cannot be expressed against a class and are not in the game.
  • Horseback Riding does not speed anything up inside a battle. It shortens map marches for cavalry and machines; in the lane every unit closes at its configured speed. Evony’s “ballistae with too much Horseback Riding roll into Archer’s Tower range” failure mode therefore cannot happen here — a ranged group stops the turn a target comes into reach.
  • There is no Archery-versus-Horseback-Riding “safe combo” grid. Reach is exactly floor(range × (1 + 0.05 × Archery level)) and nothing else, so farming loadouts are decided by reach and head count, not by a lookup table.
  • Transporters walk to the front like any other melee group. They are machines with attack 10 and no rear-guard rule, so they die with the army rather than only when it loses.

And one thing it guarantees against the barbarian belt: the classic Evony ballista farm works, on the original’s own numbers. Every barbarian settlement fields Evony’s per-level mixed garrison and fortification stock verbatim, and a pure wave of 100 ballistae per settlement level clears levels 1 through 5 without a single loss at Archery 6 (the lowest level a ballista can be trained at, where it reaches 9 paces against the camp’s archers’ and towers’ 6), while level 6 wipes the same wave — the Defensive Trebuchet’s nine-pace volley at machines is the break, exactly where the original put it. Nothing was tuned to make this true; it is pinned as a test. The full guide, the smallest lossless wave per level and the two things to know (Archery 9–10 lifts the break to level 7; transporters die until the rear-guard rule lands) are on the Barbarian Settlements page.

Loot

Looting happens only when the attacker wins — never after a repel or a withdrawal, however many survivors march home.

total_capacity = floor(sum(survivor_count * unit.carry_capacity for each surviving attacker type) * (1 + 0.1 * logistics_level))
total_available = sum of all the defender's current resources (less any Warehouse-protected floor)

logistics_level is the attacking army’s origin-town Logistics research, read when the attack resolves. A player defender’s Warehouse protection — scaled by its Stockpile and pierced by the attacker’s Privateering — is removed from the pool first; see Raiding for the full order.

  • If total_capacity <= 0 or the defender has nothing, nothing is looted.
  • If total_available <= total_capacity, the attacker takes everything the defender has.
  • Otherwise each resource is looted proportionally to its share of the total: looted[r] = floor(available[r] * total_capacity / total_available). Floor rounding can drop tiny amounts.

Carry capacity is computed from the surviving attackers, not the force you sent — heavier losses mean less loot. Looted resources are deducted from the defender immediately at battle time, then delivered to the attacker only when the survivors get home.

Return-trip timing (the two phases)

An attack resolves in two phases:

  1. Phase 1 — arrival. When the attack reaches the target (arrives_at), the battle is fought. The defender’s garrison, Wall and resources update right away. The attack record stores the survivors, losses on both sides, loot, and the outcome.
  2. Phase 2 — return. If any attackers survived, they march home and arrive after the same duration the outbound travel took (returns_at = resolution_time + outbound_duration − camp_seconds): a camp at the target lengthens the wait before the battle, never the way back. Only on return are the surviving units and their loot credited back to the origin town. If no attackers survived, there is no return trip.

Outbound (and therefore return) duration starts as ceil(Euclidean distance / slowest unit's speed) seconds — the slowest unit in the force sets the pace, with each unit’s speed first multiplied by the origin town’s researched march technologies (Compass for infantry, Horseback Riding for cavalry and siege machines). At time_scale 1.0 that raw value is the actual duration. At other scales it is divided by time_scale and then floored at the resolver tick (5 seconds — see the resolver): the scaled duration can never come in below the tick, unless the raw (unscaled) duration was already shorter than the tick, in which case the raw duration wins instead and the march gets no speedup at all. This floor guarantees a faster realm never makes a march take longer than it would at time_scale 1.0.

Because travel time is derived from map distance rather than a config value, this floor cannot be caught by the load-time time_scale validation that protects configured durations like training or research. Concretely, on a realm at time_scale 3.0 with unit speed 1: distances 1–4 tiles get no speedup at all, and every distance from 5 through 16 tiles collapses to exactly 5 seconds — twelve distinct distances become one value. A 9-tile march is 9 / 3 = 3s by the raw division, but the real, floored duration is 5s. Proximity therefore buys less advantage on scaled realms than the raw formula implies — short marches are all bounded below by the resolver tick.

Both phases are advanced by the background resolver on its fixed tick, so a just-arrived attack may take up to one tick to show as resolved.

What this means for planning

  • Bring something that can open the Wall. Check the defender’s wall level in a fresh scout report and size your siege to sum(wall levels) * wall_hp_per_level hit points — more if the town has researched Engineering, which hardens every level by 10% per level (only a dossier-tier scout report shows research; a survey at least shows the fortifications on the wall). Without a breach, melee never reaches the garrison and ranged fire is divided by 1 + wall_bonus.
  • A scout report is not guaranteed. A target that garrisons its own scouts can screen your mission — send too few and your party is intercepted outright: no report, no survivors, just a scout_intercepted event. Send enough scouts to beat the target’s likely garrison, and expect to eat some losses even on a successful run.
  • Read the fortifications before you pick the army. A survey-tier scout report shows fortifications_observed. Traps and abatis are contact mines: burn them with a cheap wave of the class they target — or walk past them with a class they ignore — before the main force lands. Archer’s Towers must be destroyed to win: bring siege engines, which out-range them, unless the town also fields Defensive Trebuchets, which fire on machines a pace before a catapult can shell; then a screening wave that is not a machine has to draw them first. Rolling Logs fire once at anyone within six paces, so the first step inside that reach is the expensive one. See Wall fortifications.
  • A scout report is only as deep as your Informatics. Without Informatics research behind a Watchtower, a report is a glimpse: the garrison comes back as count-word bands (horde, 100–249) rather than exact numbers. Research Informatics and raise the Watchtower to read exact counts, then fortifications, then the defender’s research — and remember the defender’s own Informatics pushes you back down the ladder.
  • Bring the right counters. Look up the garrison’s classes and pick units whose attack_vs_<that class> is high. GET /api/v1/units/types publishes every unit’s class, hit points, range and all four attack values.
  • Out-range the garrison. Each side’s ranged units reach floor(range × (1 + 0.05 × Archery level)) paces — the longer reach fires first and gets free volleys while the other side is still walking (see Range). A defender’s Archery lengthens its archers’ reach behind the Wall too, and only a dossier-tier scout report shows research.
  • Watch the clock. The turn limit is real: a force that wins slowly can run out of turns and withdraw with nothing.
  • Bring enough surviving carry_capacity to haul the loot you expect, or you will leave resources behind.
  • Remember the scout report is a snapshot; the defender’s garrison, Wall and stockpile can change before your attack lands.