A study of the effects of combat parameters on battle resolution.
1. INTRODUCTION:
I am relatively new to the RTW game (having only discovered the game Feb 2009) and am even newer to both Modding and TWC community in general (having only been a member for a few months). I have recently been making my own mod (from RTR) for my own personal use using historical data for things like armor types, shield sizes (i.e. Frontal area in square meters), weapon type damage etc. My sources include both ancient and modern historians (see bibliography). As I continued to make mods and battle test, I began to note discrepancies in the conventionally interpreted EDU.txt file parameters and their effects on the battle resolution and kill rate in particular.
As such, I determined to conduct a series of rigorous tests in a systematic way, isolating certain variables at a time in an effort to better understand the mechanics of the RTW Battle Engine. What follows is the first of my studies. I hope that this will give the modding community more insight as to the way combat is handled in RTW and hopefully assist in any other mods that may come out from today onward.
For reference on the basics please refer to the writeup that initiates this thread that Aradan so meticulously put together and which has been invaluable in helping me get started on this study.
The Complete EDU Guide for Rome Total War: by Aradan found at the beginning of this thread
http://www.twcenter.net/forums/showthread.php?t=111344
My kindest regards to both Aradan for writing the article and for Florin80 for putting me onto it in the first place.
In this study, the following EDU parameters are examined in-depth (short variable names in parenthesis):
Defensive Parameters: Armor (AR), Defense Skill (DS), Shield (SH)
In addition, preliminary sensitivity study has been performed on the following, but more work is pending:
“Tuning” Parameters: Lethality (L), Animation Delay (AD), Radius (R)
For those who wish to skip onto the data directly, please go to Section 4.
Kind Regards,
Phalanx_man
2. SUMMARY & CONCLUSIONS:
It appears from the data below that Shield and Defensive Skill are not used by the battle engine in exactly the way initially thought.
SHIELD applies FULLY to FRONT and RIGHT (not Front and Left as it should be) and gets a 50% penalty (to Attack-Shield Defense) for BACK and LEFT sides.
DEFENSE SKILL applies FULLY to FRONT ONLY and gets a ~ 33% penalty to LEFT side defense, ~20% penalty to RIGHT side defense and ~50% penaty to BACK side defense (where penalty is a percent of attack-def_skill value).
ARMOR is essentially equivalent from ALL sides (with the caveat that follows) and has a disproportionate increased effect if base Armor value is 20 or more.
A minimum penalty of about 2 to 3 seems to apply to all 3 defense modes (Armor, Shield and Def Skill) if the difference between attack value and defense mode value is at or near Zero; although when Attack value minus defense value of Armor goes significantly negative this penalty seems to disappear for armor only.
This, it seems that all units are weaker in melee on their LEFT side. It should be noted that in another test (not included here) 2 units (non-guard mode swordsmen) tend to rotate counterclockwise AND tend to envelop the LEFT side of their opponent with their right when equal values of defense are given to all 3 modes (10 attack vs. 10 armor, 10 def skill and 10 shield).
And so there seems to be an error in the battle engine in that the NON-SHIELD-SIDE is STRONGER (i.e. Less penalized) than the LEFT side in MELEE.
For MISSILE defense, it seems to be the only instance of the shield being slightly more effective from the left side (albeit slightly) and actually shows a bonus from frontal missile attacks. Overall, there is still a penalty to ALL defense modes when the volley is coming from anywhere but the front (even for armor).
The equation for Kill Rate is confirmed to be Constant x 1.1^(attack-total defense) as shown in Aradan’s guide.
Kills are NOT directly proportional to Lethality, but seem to follow a linear relation that has a non-unity slope and has a Y-intercept.
Preliminary numbers reveal that Kills are inversely related to animation delay but appears to be non-linear (further study to be done).
Preliminary numbers imply that Kills are inversely proportional to soldier Radius (further study to be done).
The effects of soldier Height were briefly looked at but no numbers were collected – further study to be done.
The overall Kill rate was examined in the Battle of Cannae (for comparative purposes of this study) and was found to be approximately 12 %/hr of Infantry ~ 0.2%/min. This will be relevant for later work.
3. METHODOLOGY:
For both MELEE and MISSILE Combat, my test would involve having the AI attack a defending unit PURELY from the FRONT (F), LEFT SIDE (L), RIGHT SIDE (R) and BACK (B) with combinations of ONLY ARMOR, ONLY DEF SKILL and ONLY SHIELD. I would proceed to test with up to FOUR Delta values (DELTA=ATTACK-TOTAL DEFENSE). Delta It will be expressed herein as D = A-D.
For MELEE I wanted to test with the following values in the following way:
ATT from F, ATT from L, ATT from R, ATT from B
for
D = 0, -10, -20, -30
for
ARMOR ONLY, DEF SKILL ONLY, SHIELD ONLY
each involving the average of 4 or more trials of CONTINUOUS combat that were exactly 110 seconds long.
For MISSILE I wanted to test with that same but it turns out that testing with ONLY A-D=0 is sufficient, giving:
ATT from F, ATT from L, ATT from R, ATT from B
for
D = 0
for
ARMOR ONLY, DEF SKILL ONLY, SHIELD ONLY
each involving the average of 4 or more trials that involved ONE volley of javelins.
The left/right orientation is from the DEFENDING (HUMAN) units frame of reference. IE. The DEFENDING units LEFT is the ATTACKING units RIGHT and vice versa. All such references will be relative to the DEFENDING unit in this writeup.
My general method of battle testing was to chose a defending unit (Hoplites) and allowed AI to attack me with a single unit (Legionnaires). I would then time the battle and cut it off at a predetermined elapsed time. In this way I could accurately measure the effects of changes.
Due to variance, I would repeat the same battle configuration a minimum of FOUR times, sometimes more if the variance was higher than normal or if the number of Kills (K) was very small. I found that 4 was a reasonable number most of the time, balancing more time spent testing versus smoothing out the average. Also I found that an even number of tries was better than an odd number, since if often seems (see data below) that pairs of above-average and below-average would tend to occur in the same series, whereas if I chose an odd number of tries, one of the above-average or below-average pairs would skew the average.
My first attempts at determining the relative effects of Attack (ATT) vs. Defense (DEF) was frustrated by the following problems which, after significant trial and error, I resolved in the following way:
(P1) if the attacking AI unit was defaulted to guard mode (spearmen), it would not line up properly with the DEF unit the same each time, resulting in excessive variance of the results
(S1) To resolve P1, I only had AI attack with non-guard-mode units of the same size and spacing. In this way, the Frontage would always undergo the same transition over the same time.
(P2) if the ATT unit was defaulted to non-guard mode (i.e. Light or Heavy) it would inevitable “flow” around to the sides of the DEF unit, spoiling the effect of a purely Frontal (F), Right/Left flank (R) or (L) or Back (B) attack.
(S2) To resolve P2, I chose a unit of 120 attackers (in 16 deep formation) vs. 240 defenders (in 4 deep formation). I noted that the SIZE of a non-guard-mode attacking unit is not so important as is the FRONTAGE, and this combination allowed a combat of up to 2 minutes with the “flow” of the attacking unit never reaching around the sides of the defending unit.
(P3) if the DEF unit was on non-guard-mode, it would change the combat mechanics significantly since it seems that hoplites tend to “push” and they push more against the frontage of the line where the enemy is thinnest (i.e., the flanks). This results in the hoplites semi-encircling the attacking unit and giving false results when trying to test for frontal vs. flank defense. Also, if DEF unit was not on guard mode, they would respond to a non-frontal attack by (the soldiers) slowly turning to face the ATT unit, nullifying the tests for flank-defense and rear-defense.
(S3) To resolve P3 I made the hoplite defending unit on guard-mode for every trial.
(P4) Sometimes, the ATT AI unit would make flanking attempts on a front facing DEF unit and/or would engage, then pull away for a brief while, then re-charge and re-engage. This spoiled the timing of the engagement and it could not be compensated since the “spread” of the frontal line of engagement (Frontage) would have to restart.
(S4) It was noted that this did not always happen, and that the AI looks for its attacking units to have more “power” over the defending unit. By power I mean the relative indication of the power bar in the lower left of the battle-screen, with BLUE being the human and the RED being the AI. If [HUMAN:AI] was about [1:2] or less, the AI would ALWAYS frontally attack AND not pull away during the combat. On the other hand, if power ratio was [1:1] or better in favor of the human unit, flanking and/or retreat+re-engage would occur. Some exceptions to this rule apply, the most consistent of which is that of a unit attacking a pike-phalanx (where regardless of power ratio the AI NEVER frontally attacks a pike phalanx unit). See the results section on how to calculate relative power.
Another reason I chose a 4x60 arrangement for the defenders is because it could be set up for purely Flank and Rear attacks easily and not lose its formation for at least the time required for the 4 directions of defense. Also, when the DEF unit was put sideways (4 wide x 60 deep), it would “shrink” from front to back since killed men are replaced in this way, so I needed to have a maximum length to avoid spillover to the front and back of the formation as men were killed..
Regarding MISSILE testing I had initially used archers, and that worked fine when they were shooting at purely DEFESIVE SKILL troops. In fact, I had to power down the archers other stats because they would fire only a few volleys and then charge the defenders.
However, when they were faced with a DEF line that was purely SHIELD=10, they would approach the line then just sit there and not fire. No amount of tampering with the power ratio would change this.
Thus, I changed the missile test to javelineers, set them as infantry (not missile), with ONE round of ammunition and set the “stat_pri_attr” to “prec,thrown”.
In this way, they would approach, throw one round of javelins then charge – but I would terminate the combat before the charge arrived at the defending troops and counted the kills. In this way, for Armor, Def Skill and Shield, the javelineers always attacked.
There are some other minor points in the Methodology, but for the sake of brevity I will leave them out for now unless further information is requested by anyone.
4. TEST DATA
The tables below represent number of kills of 240 initial defenders in guard-mode during a 110 second engagement from a 120 man attacking force that is not on guard mode. 4 repeats per line are shown so that the raw data variance can be examined. The average is on the right for each row.
This is done for delta values of 0 (baseline), -10 (typical RTW vanilla), -20 (typical RTR) and -30 (max RTR).
However, in the case of ARMOR ONLY, the results for ARMOR values of 20 and up yield results that stray away from the standard equation (see delta=-20 for armor). For this reason the delta=-30 for armor only was not tested for.
Code:4.1.A: MELEE: SHIELD ONLY ∆=0 x #1 #2 #3 #4 AVG ------------------------- F 80 94 91 88 88.2 L 113 123 114 117 116.8 R 114 122 113 110 114.8 B 115 111 126 118 117.5 ∆=-10 x #1 #2 #3 #4 AVG -------------------------------- F 21,29 25,24 22,28 19,25 24.12 L 48 46 41 47 45.50 R 26 25 29 31 27.75 B 40 39 43 43 41.25 ∆=-20 x #1 #2 #3 #4 AVG -------------------------- F 8 8 8 9 8.25 L 25 24 30 23 25.50 R 10 9 6 6 7.75 B 21 25 33 26 26.25 ∆=-30 x #1 #2 #3 #4 AVG -------------------------- F 7,4 2,6 6,4 6,7 5.25 L 19 20 19 19 19.25 R 7 10 8 9 8.50 B 16 15 20 18 17.25 ====================================== 4.1.B MELEE: DEF SKILL ONLY ∆=0 x #1 #2 #3 #4 AVG ------------------------- F 97 89 77 93 89.0 L 124 125 99 119 116.8 R 113 103 124 123 115.8 B 114 106 113 126 114.8 ∆=-10 x #1 #2 #3 #4 AVG ------------------------ F 22 28 27 20 24.2 L 48 54 43 51 49.0 R 40 30 46 33 37.2 B 44 49 48 48 47.2 ∆=-20 x #1 #2 #3 #4 AVG ------------------------ F 6,5 4,6 7,6 4,7 5.63 L 17 20 16 13 16.5 R 11 18 10 11 12.5 B 27 30 24 25 26.5 ∆=-30 x #1 #2 #3 #4 AVG -------------------------- F 3,3 6,4 3,2 6,3 3.75 L 16 13 9 16 13.50 R 6 10 6 9 7.75 B 22 26 18 17 20.75 ======================================== 4.1.C MELEE: ARMOR ONLY ∆=0 x #1 #2 #3 #4 AVG ------------------------ F 84 89 91 86 87.5 L 123 109 95 121 112.0 R 114 106 86 109 103.8 B 111 105 87 108 102.8 ∆=-10 x #1 #2 #3 #4 AVG ------------------------ F 18 21 26 29 23.5 L 26 28 34 27 28.8 R 27 25 27 22 25.2 B 28 29 24 24 26.2 ∆=-20 x #1 #2 #3 #4 AVG ------------------------- F 4 4 1 3 3.00 L 4 4 2 3 3.25 R 4 0 3 2 2.25 B 3 5 4 2 3.50 =============================================== 4.2.A: MISSILE: SHIELD ONLY ∆=0 x #1 #2 #3 #4 AVG --------------------------------- F 4 9 4 8 6.25 L 18,21 23,17 23,22 18,19 20.12 R 22,23 22,29 23,30 22,28 24.88 B 49 49 55 48 50.25 =============================================== 4.2.B: MISSILE: DEF SKILL ONLY ∆=0 x #1 #2 #3 #4 AVG -------------------------- F 48 40 40 36 41.00 L 54 43 41 51 47.25 R 42 41 46 53 45.50 B 52 52 52 53 52.25 =============================================== 4.2.C MISSILE: ARMOR ONLY ∆=0 x #1 #2 #3 #4 AVG -------------------------- F 15 15 19 18 16.75 L 25 26 25 26 25.50 R 22 25 22 21 22.50 B 31 32 23 23 27.25 ============================================== 4.3: LETHALITY (L) SENSITIVITY DATA: (∆=-20, AD=0, R=0.4, H=1.7) Each average value is comprised of 4-8 data points sens Kavg Kavg Kr Kr L (#) (%) (#/min)(%/min) ================================================= 1.0 111.2 46.3 8.6 3.56 DEFAULT RTW VANILLA 0.9 100.5 41.9 7.7 3.22 0.8 91.3 38.1 7.0 2.93 0.7 80.3 33.5 6.2 2.57 0.6 72.5 30.2 5.6 2.32 0.5 62.0 25.8 4.8 1.99 0.4 54.3 22.6 4.2 1.74 DEFAULT RTR SPEARMEN 0.3 44.3 18.5 3.4 1.42 DEFAULT RTR SWORDSMEN 0.2 35.8 14.9 2.8 1.15 0.1 27.0 11.3 2.1 0.87 0.0 16.8 7.0 1.3 0.54 4.4: ANIMATION DELAY (AD) SENSITIVITY DATA: (∆=-20, L=0, R=0.4, H=1.7) Each average value is comprised of 2 data points (rough data) sens Kavg Kavg Kr Kr AD (#) (%) (#/min) (%/min) =========================================== 00 69.8 29.1 5.4 2.24 DEFAULT VALUE 05 56.5 23.5 4.3 1.81 10 54.5 22.7 4.2 1.75 4.5: RADIUS (R) SENSITIVITY DATA: (∆=-20, L=0, AD=0, H=1.7) Each average value is comprised of 2 data points (rough data) sens Kavg Kavg Kr Kr R (#) (%) (#/min) (%/min) =========================================== 0.4 69.8 29.1 5.4 2.24 DEFAULT VALUE 0.5 55.5 23.1 4.3 1.78 0.8 47.0 19.6 3.6 1.51 1.0 32.0 13.3 2.5 1.03
5. ANALYSIS OF TEST DATA
I have used an excel spreadsheet to perform data reduction. I will not now write down all the formulae that I used since I think some may wish to do their own data analysis. Should anyone wish to see my inferred formulae, I can add it to this thread. I have extracted the following from that data above:
5.0: BASE MELEE EQUATION
The equation for Kills per minute CAN be written as shown in Aradan’s guide. That is to say:
K = C1 x E^D where C1~ 88 (for this battle configuration at 110 seconds) and E=1.119 inferring the experimental values herein from FRONTAL data only. Inferring values of E from the LEFT, RIGHT and BACK data, while yielding reasonable averages ranging from 1.085 to 1.117, is not strictly correct, since it seems that the combat engine is assigning variable penalties to Left side, Right side and Rear attacks that are proportional to the values of DEF SKILL, SHIELD and ARMOR, as well as applying a minimum defense penalty (or attacker's bonus) to attacks originating other than the front for cases of D=0.
In this way, we should ideally use the nominal value of E=1.1 and INFER the penalties to side and rear attacks using this same value of E for ALL cases. However, since the inferred penalties looked a little more like round-figure percentages using the experimental value of E=1.119, inferred penalties are based on this value in this study.
5.1: MELEE EFFECTS:
It appears from the data that the combat engine does NOT apply SHIELD (or DEF SKILL) in the way it has been presumed up to now.
5.1-A: MELEE EFFECT OF SHIELD
SHIELD applies FULLY to the FRONT and RIGHT (not LEFT as it should be). This is likely a mistake by the original programmers mixing up LEFT & RIGHT between attackers frame of reference and that of the defenders.
SHIELD defense value is NOT 100% ABSENT from the BACK and LEFT SIDE (as previously thought) but seems to have an equal PROPORTIONALITY PENALTY applied to shield defense value against attacks from these directions.
SHIELD PENALTY ~ 50% x (ATT-SHIELD VALUE) to defense value vs attacks from the BACK and LEFT SIDE (again, no penalty to RIGHT side defense).
In analysis of the data, Shield defense (L+B) was penalized 4 for a shield defense of 10, 9 for a shield defense of 20 and 14 for a shield defense of 30.
5.1-B: MELEE EFFECT OF DEFENSE SKILL
DEF SKILL applies FULLY to the FRONT only.
DEF SKILL defense value is NOT 100% ABSENT from the BACK and LEFT SIDE nor is it 100% present at the RIGHT SIDE (as previously thought) but also seems to have a (differing) PROPORTIONALITY PENALTY applied to defense skill value against attacks from these directions.
DEF SKILL PENALTY inferred from data analysis:
~ 33% x (ATT-DEF SKILL VALUE) penalty to defense on attacks from the LEFT
~ 20% x (ATT-DEF SKILL VALUE) penalty to defense on attacks from the RIGHT
~ 50% x (ATT-DEF SKILL VALUE) penalty to defense on attacks from the BACK
Analysis of the LEFT Side reveals DEF SKILL was penalized 4 for DS=10, 5(*) for a DS of 20 and 13 for a DS of 30.
Analysis of the RIGHT Side reveals DEF SKILL was penalized 2 for DS=10, 3(*) for a DS of 20 and 8 for a DS of 30.
Analysis of the BACK Side reveals DEF SKILL was penalized 4 for DS=10, 9 for a DS of 20 and 17 for a DS of 30.
(*) Some of these may have further data points added since they do not appear strictly progressive. That may be a result of data variance since the values of penalty are inferred by INV-LOG of the presumed (experimental) E=1.119 function. It turns out that these penalties (as inferred from the data) are extremely sensitive to the assumed value of E, and even small changes in E significantly affect the inferred value of penalty.
5.1-C: MELEE EFFECT OF ARMOR
ARMOR HAS NO PENALTY FROM THE SIDES, however …
FOR ALL 3 of the above (Armor, Def Skill and Shield), there appears to be a MINIMUM penalty to defense (or more likely a minimum BONUS to attackers) of anywhere from 2 to 3 if D=0. This makes sense (to have an absolute minumum) since, if the penalty is a proportion of any specific A-D value, otherwise there would be no penalty from BACK or SIDES for D=0.
5.2: MISSILE EFFECTS
I have not yet had the time to data-analyze the missile governing equation given in Aradan’s guide, but simply wanted to ensure (given the unexpected results of SHIELD and DEF SKILL effects in MELEE combat) that SHILED and DEF SKILL were not reversed in some way.
From the data it DOES seem that the base effect (as indicated in Aradan’s guide) hold true, with some minor variations:
5.2-A: MISSILE EFFECT OF SHIELD
Seems that from the BACK, the kills is the same as with PURE DEF SKILL from the BACK. However, it seems that SHEILD has a significant effect on BOTH LEFT AND RIGHT SIDES and furthermore a significant BONUS to defense vs. attacks coming from the FRONT. In fact, it seems that pure shield is better against frontal missile attacks that the equivalent amount of pure armor, supporting the statement in Aradan’s guide that the shield may have double defense value at the front.
5.2-B: MISSILE EFFECT OF DEFENSE SKILL,
It appears that, although DEF SKILL has little defense vs missiles, it DOES seem that AI gives either a penalty to defense (or bonus to the attack) for attacks that do not originate from the front. This penalty/bonus seems to be highest at the BACK, least on the RIGHT and slightly higher on the LEFT side when compared to the RIGHT.
5.2-C: MISSILE EFFECT OF ARMOR,
It appears that AI gives a base penalty to defense (or a bonus to the attacker) against missile attacks that do not originate from the FRONT and that the penalty seems to apply roughly equally to the L,R and B directions.
5.3: EFFECTS OF LETHALITY
Analysis of the lethality sensitivity data shows that this parameter is NOT a direct proportionality as at first believed, but rather seems to be a value that is part of a linear equation. When this data is put to a graph, it is remarkably straight and yields the equation K=AxL+B, where A = 2.98 (slope) and B=+0.54 (Y-intercept).
The effect of L varies with different battle configurations. A second test on a different configuration yielded much different values of Kr (%/minute killed), with a different slope and y-intercept, though the test was not exhaustive and will not be quoted here. Another test on a different configuration may be attempted in the future.
5.4: EFFECTS OF ANIMATION DELAY
As expected, kill rate drops off as AD increases, however it does not appear to be linear.
Further testing to be done.
5.5: EFFECTS OF RADIUS
As indicated in Aradan’s guide, as R increases, Kill rate drops off.
From this preliminary data, it appears to be inversely proportional to Radius value (as suspected in Aradan’s guide).
Further testing to be done.
5.6: RELATIVE POWER BETWEEN 2 OPPOSING ARMIES:
Through trial & error it appears that the following formula is applied to the sum total of ALL the units both “sides” and then represented by blue and red line colors of different length (no other variables have any noted effect):
HUMAN = SUM { (number of soldiers in unit) x (hit points/soldier) x (Attack + 2xArmor + Def Skill + Shield) }
AI = SUM {same for all AI units}
[Length of the BLUE Line] : [Length of the RED line] = [sum total HUMAN] : [sum total AI]
5.7: A NOTE ON KILL RATES IN ANCIENT BATTLES
In order to help make RTW and its mods more realistic, I have compared the kill rate in the testing to that of one ancient battle for which both the number of fallen AND the duration of the battle are thought to be well known (or at least well estimated): That is the Battle of Cannae: (I will be only looking at infantry for now)
ROMANS began with 80000 Infantry of which 50000 were killed
CARTHAGE began with 50000 Infantry of which 10000 were killed
The total battle (plus encirclement rout) lasted 4 hours.
Thus a total of 60000 infantry were killed from an initial total of 130000 or 46% in 4 hours = 11.5 %/hr ~ 0.2%/min
6. CONCLUSIONS:
All conclusions are contained in the Summary & Conclusions (Section 2) to avoid repetition here.
7. BIBLIOGRAPHY:
(1) Polybius: The Histories
(translated by W.R. Paton), Digireads Classic, 2009
(2) Arrian: The Campaigns of Alexander
(annotated by J.R. Hamilton), Penguin Classics, 1971
(3) Peter Connolly: Greece and Rome at War
Greenhill Books, 1981
(4) Victor Davis Hanson: The Western Way of War – Infantry Battles in Classical Greece
University of California Press, 1994
(5) A&E Video: Decisive Battles of the Ancient World
(hosted by Matthew Settle), History Channel, 2006
(5) Jeff Champion: Pyrrhus of Epirus,
Pen & Sword Military, 2009