Surprisingly little has been published by the collective Evony community regarding Battle Mechanics. Probably because each alliance wants to get as many advantages as possible, so there's no motivation to share information. If an alliance could develop their own working battle simulator, it would give them a huge advantage over the competition.
The best published work on Battle Mechanics is on DerrickD's YouTube Channel:
https://www.youtube.com/@DerrickDefies.
Essentially, he has figured out how 1-layer vs 1-layer battles work. He's now working on how 1-march vs 1-march battles work. Once that's figured out, the community may be able to start dissecting Rally vs Keep battles, and then maybe Rally vs Reinforced Keep battles, but I think those last two are still many months, if not years away.
The following is a summary of four (4) of DerrickD's videos.
Definitions
Troop Groups are multiples tiers of the same Troop Type (Ground, Ranged, Mounted & Siege) that start the battle moving and attacking together.
The correct troop range plus any applicable bonus is referred to as Actual Range (also differentiating from Published Range, which is often wrong).
The correct troop speed is referred to as Actual Speed (differentiating from Published Speed, which is often wrong).
Troop Groups can move and attack in the same turn if needed. So, Actual Range plus Actual Speed is referred to as Effective Range.
Defeated or Eliminated Troops are either Killed, Wounded, Deserters, or Troops Souls.
All-Troop In-Battle Functionality Rules
The battlefield is 1,500 units in length. All of the Defender's troops start at 0. The Defender's Archer Tower and Traps are also at 0. All of the Attacker's troops start at 1,500.
Order of Movement and/or Attack for Troop Groups is determined by Actual Speed. When Actual Speed is tied Defender acts first.
Defending Ground - 350 Units/Turn
Attacking Ground - 350 Units/Turn
Defending Mounted - 300 Units/Turn
Attacking Mounted - 300 Units/Turn
Defending Ranged - 100 Units/Turn
Attacking Ranged - 100 Units/Turn
Defending Siege T16-T15 - 76 Units/Turn
Attacking Siege T16-T15 - 76 Units/Turn
Defending Siege T14-T1 - 75 Units/Turn
Attacking Siege T14-T1 - 75 Units/Turn
Defending Archer Tower - 0 Units/Turn
Defending Traps - 0 Units/Turn
Troop Groups will move only if no enemy troops are within their Actual Range.
When moving, Troop Groups will only move the minimum distance to get the highest priority enemy troop type within their Effective Range into their Actual Range.
If more than one (1) enemy troop type is within their Actual Range, the highest priority enemy troop type will be targeted.
Once engaging enemy troops, Troop Groups will remain in the same location attacking the highest priority troop within their Actual Range until all of that enemy troop type is eliminated OR a higher priority troop enters their Effective Range.
On the other hand, if no enemy troops are within the Actual Range after moving the maximum distance, then the Troop Group will not attack, and will wait there (only defending) until its next turn.
Attack and Counterattack
DMG = TAM*TMD*AAT*AAT/(AAT+DDF)
NDT = DMG/DHP (round down to the nearest troop)
AAT - Attacker's Attack (for the Attacking Layer)
DDF - Defender's Defense (for the Defending Layer)
DHP - Defender's HP (for the Defending Layer)
DMG - Total Damage
NDT - Number of Defeated Troops (Killed, Wounded, Deserters or Souls)
TAM - Troop Amount (Number of Troops in Layer)
TMD - Troop Modifier (See Chart Below)
Troop Modifiers
Defender
Ground Mounted Ranged Siege Siege
Attacker T1-10 T11-16
Ground 1.00 0.70 1.20 1.10 1.10
Mounted 1.20 1.00 0.80 0.90 1.10
Ranged 0.80 1.20 1.00 1.10 1.10
Siege T1-10 0.35 0.30 0.40 0.50 0.50
Siege T11-16 0.35 0.30 0.40 0.60 0.60
Counterattack Rules
Counterattack Damage and Defeated Troops are determined by the same formulas (see above).
If one (1) or more troops in a layer survive the initial attack, the troops that were defeated will deal counterattack damage to the attacking troop layer, IF the attacking troop layer is IN RANGE of the defending troop layer.
If ALL troops in a layer are defeated by the initial attack, no counterattack damage is received.
Mounted In-Battle Mechanics
Mounted Troops only have one (1) Troop Group, meaning all tiers move and attack together at the beginning of the battle. It is possible for a Troop Group to separate later in the battle given specific scenarios.
Mounted Troop Priorities
Mounted Troops prioritize Enemy Troops in the following order (with Damage Bonuses/Penalties in Parentheses):
Theoretical Priority
Ground (+20%)
Mounted (+0%)
Siege [T-1 to T10] (-10%); Siege [T-11 to T16] (+10%)
Ranged (-20%)
Actual Attack Order
However, because of speed and range dynamics on the battlefield, Mounted Troops are thought to attack Enemy Troops in the following order (with Damage Bonuses/Penalties in Parentheses):
Ground (+20%) - Until all are dead, then move on to Mounted
Mounted (+0%) - Until all are dead, then move on to Ranged
Ranged (-20%) - For one (1) turn, then move to Siege
Siege [T-1 to T10] (-10%); Siege [T-11 to T16] (+10%) - Until all are dead, then back to Ranged (if any remain)
Ranged (-20%) - Until all are dead
Essentially, Ranged and Siege Troops stay back behind their own Mounted and Ground Troops while attacking the enemy Mounted and Ground Troops. Since they are out of the Effective Range of the opponents Mounted and Ground, the enemy Mounted and Ground will only advance once all their own Mounted and Ground Troops are dead.
Mounted (In-Battle) Movement Speed & Range Stats
Tier Published Speed Actual Speed
T1-T16 600 units/turn 300 units/turn
Tier Published Range Actual Range
T1-T16 50 units 50 units
Skill Book Published Speed Increase Actual Speed Increase
Level 1 +5% +0%
Level 2 +10% +0%
Level 3 +15% +0%
Level 4 +20% +0%
Maximum Effective Range (MER)
Maximum Effective Range is Speed + Range + Bonus(es).
Mounted MER = 300 + 50 + 0 = 350 units.
Let me know if you have any questions.