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 YouTube 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.
All-Troop In-Battle Functionality Rules
Troop Groups will move only if no enemy troops are within their Actual Range.
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 dead OR a higher priority troop enters their Effective Range.
On the other hand, if no enemy troops are within the Actual Range after moving, then the Troop Group will not attack, and will wait there (only defending) until its next turn.
Ground In-Battle Mechanics
Ground Troops only have one (1) Troop Group, meaning all tiers move and attack together at the beginning of the battle. It may be possible for a Troop Group to separate later in the battle, given specific circumstances.
Ground (In-Battle) Movement Speed & Range
Speed
Tier Published Speed Actual Range
T1-T16 350 units/turn 350 units/turn
Range
Tier Published Range Actual Range
T1-T16 50 units 50 units
Bonuses
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).
Ground MER = 350 + 50 + 0 = 400 units.
Ground Troop Priorities
Ground Troops prioritize Enemy Troops in the following order (with Damage Bonuses/Penalties in Parentheses):
Theoretical Priority
Ranged (+20%)
Siege [T-1 to T16] (+10%)
Ground (+0%)
Mounted (-30%)
Actual Attack Order
However, because of speed and range dynamics on the battlefield, Ground Troops are thought to attack Enemy Troops in the following order (with Damage Bonuses/Penalties in Parentheses):
Ground (+0%) - Until all are dead, then move on to Mounted
Mounted (-30%) - Until all are dead, then move on to Ranged
Ranged (+20%) - Until all are dead, then move on to Siege
Siege [T-1 to T16] (+10%) - Until all are dead
Ranged Troops stay back behind their own Mounted and Ground Troops while attacking the enemy Mounted and Ground Troops. Siege Troops stay back behind their own Mounted, Ground and Ranged Troops while attacking the enemy Siege and Ranged Troops. Since Ranged and Siege Troops on booth sides are out of the Effective Range of the enemy Mounted and Ground, the enemy Mounted and Ground will only advance once all the opposing Mounted and Ground Troops are dead.
Let me know if you have any questions.