# Combat Explained....

#### Arathorn

##### Catan player
Ahh&#8230;fighting. Love it or hate it, there will be times it&#8217;s part of your Civ-ing career. This article attempts to explain a bit about how combat is figured, discusses some &#8220;jump points&#8221; where your odds of success change dramatically with a very small change in strength, discuss some odd ways that particular bonuses are calculated, and hopefully generally serve to enlighten you in terms of combat.

The basics

You don't even really need to understand this. You can get this by alt-mouseover or by right-click and dragging to the unit and checking the odds displayed in the lower left corner of the screen. This explains how those numbers are calculated.

Attacker&#8217;s modified strength

This is calculated first. Apply any bonuses the attacker gets independent of the defender (generic strength promotions only in the default game). Multiply this total by the unit&#8217;s hps/100. This gives the attacker&#8217;s modified strength.

Example: A swordsman with Combat I, City Raider I, and only 73 hps is lining up to attack a city. His modified strength is 6 * 1.1 (from Combat I) * 73/100 (from hps) = 4.82 (well, 4.818 actually, but I don&#8217;t know if Civ4 keeps more than 2 digits of accuracy).

Defender&#8217;s modified strength

This one is more complicated. Determine the defender&#8217;s bonuses from terrain, general strength bonuses, bonuses vs. the type of the attacking unit, fortification bonuses, etc. Sum those up. Now, subtract any bonuses the attacker might have if it attacks this unit. Those would include attacker bonuses against defender combat type, attacker bonuses against a city, attacker bonuses in the terrain type (?). If the overall value is positive, add that percentage to the defender to get its modified strength. If the overall value is negative, the defender&#8217;s modified strength is found by taking the original defender&#8217;s strength divided by (1-overall_value). [Note: That&#8217;s the same as dividing by (1+abs(overall_value)) when overall_value is negative, which is how I think of it.]

Once this value is calculated, the defender&#8217;s hps become an issue. This is again a straight multiplication by the number of hps remaining times the modified strength found above.

Example #1: (Both healthy) An archer (str:3) with City Raider I and Combat I promotions is attacking a warrior (str:2) on grassland. The attacker&#8217;s modified strength is calculated by simply taking the combat I promotion and getting a value of 3.3 (3 + 3*.1). The defender has no strength bonuses and the grassland defense bonus is 0, so the defender has a modified strength of 2.

Example #2: (Both healthy) A knight (str:10) with Combat I and Cover (+25% vs. archers) promotions is attacking a longbow (str:6) in a forest. The attacker&#8217;s modified strength is again simple, using the Combat I promotion of 10%. The knight&#8217;s attack value is 11 (10 + .1*10). The longbow has an initial bonus of +50% for the forest. However, the knight&#8217;s Cover bonus now affects the defending longbow, giving it a -25%, too. So, the overall bonus for the longbow is +25%. The defender&#8217;s modified strength is 7.5 (6 + .25*6).

Example #3: A knight (str:10) with Combat I, Combat II, and City Raider I (+20% attacking a city) but only 73 hps is attacking an axeman (str:5) in a town with a 3% defensive bonus from culture. The attacker&#8217;s modified strength is 8.76 (10 + .2*10)*76/100 from the two Combat promotions and the hps. The defender first calculates a +3% defensive strength from the city. Then the attacker&#8217;s bonus is kicked in. This gives a -20% to the defender. Thus, the overall value is -17%. The defender&#8217;s modified strength is 4.27 (5 / (1+.17) = 5 / 1.17)).

The actual combat

We now have the attacker and the defender&#8217;s modified strengths. We will call these A and D going forward to help the discussion. If a bit of algebra scares you, just jump ahead to repercussions....

Round odds

The odds that the attacker will win each round is given by A/(A+D), so the odds the defender wins a round is D/(A+D).

I&#8217;m now going to introduce a new variable &#8211; the ratio between the attacker&#8217;s and defender&#8217;s modified strength. This value is R. It is A/D and it controls all of combat. The greater R is, the better the attacker&#8217;s odds of winning.

Each round, the attacker wins with odds R/(1+R) and the defender with odds 1/(R+1).

Damage per hit

The attacker and defender both start with their current number of hps (NOT 100 as was previously stated). The attacker&#8217;s damage is given by floor(20*(3*A+D)/(3*D+A)). That is, you calculate the value and drop any fractional remainder. The defender&#8217;s damage is given by floor(20*(3*D+A)/(3*A+D)).

Going back to R notation, the attacker does floor(20*(3*R+1)/(3+R)) damage and the defender does floor(20*(3+R)/(3*R+1)) damage.

The maximum damage one size can do is 60 per hit. The minimum that can be done is 6. Only those values are possible, regardless of the relative strengths of the units.

Once one side goes below 0 hps remaining, it is destroyed (or retreats). The winner has strength remaining equal to starting_strength*hps/100, but it has fewer hps, so it is more likely to die in further combat. Modified strength no longer matters.

Exact odds can be found at http://c4combat.narod.ru/c4c.htm [Note: Updated to include hps -- thanks, Ellestar.]

First Strike

First strike round(s) are special. The number of them is determined by looking at the number of first strike rounds of the attacker and the defender. Whichever number is greater gets the difference of values in first strike opportunities. For x-y first strikes (possible first strikes), the math is still unproven, but it looks like a 50% likelihood of getting a first strike each "round" possible.

A first strike round is like any other round, except that the first striker is the only one who can do damage. For example, if the attacker has two first strikes and the defender zero, the first two rounds have two possibilities &#8211; the attacker wins so the defender loses damage or the defender &#8220;wins&#8221; and nobody gets hurt. The odds in this round are just like any other. The first striker is just immune to damage.

Retreat

Retreat rolls happen when a round ends that would kill the attacker. In that case, a special role is made against the attacker&#8217;s retreat chance. If successful, the attacker retreats with the number of hps he had before that final, potentially killing round. The attacker&#8217;s chance of winning combat is never decreased by having retreat chances. They only come into play when the attacker would die.

Retreat has a few points. First, any attacker with an X% chance of retreating will always have a strictly greater than X% chance of surviving a combat. He could win (greater than 0), retreat (x*die_percent), or die. The second is that retreat can only occur for the attacker, not the defender. Third, retreat is most valuable when the attacker is less strong than the defender &#8211; a catapult attacking a city, for example.

Example: A catapult (str:5) is attacking an archer(str:3) fortified in a city. The archer has +50% defense bonus for the city and 25% fortification bonus. The catapult has a 20% retreat chance (one Promotion). Attacker&#8217;s modified strength is 5. Defender&#8217;s modified strength is 5.25. Without retreat, the catapult would win 34.7% of the time and die the other 65.3% of the time. With retreat, the odds of winning are still 34.7%, but 20% of that 65.3% is retreat (.2*.653). So, win 34.7%, retreat 13.1%, and die 52.2% (.8*.653) of the time.

Collateral Damage

When attacking stacks, siege units have the built-in capability to damage additional units in the stack besides the one attacked. This is called collateral damage.

Collateral damage is done ONLY by an attacker and only to the stack member(s) that aren&#8217;t directly defending. The chosen defender will engage the attacking unit in a regular combat.

Maximum Damage

Gone are the Civ3 days of completely red-lining a unit. Each unit that can do collateral damage has a limit on the amount of damage it can do. These are given in the Units XML file. For catapults, it is 50; cannons 60; artillery 70. Tanks/panzers and modern armor are capped at 60; Cho-Ko-Nu at 60, and (stealth) bombers at 50. That means a catapult can not damage a unit at or below 50 hps. Similarly, an artillery cannot damage any unit at or below 30 hps. Those are hard caps.

Number of Targets

The number of targets is a function of both the attacking unit and the number of potential targets. The number of potential targets is the number of units in the tile which are not defending and who are above the maximum damage threshold.

Example: A catapult is attacking a stack a stack with a 100 hp musket, a 95 hp musket, a 42 hp knight, and a 73 hp axe. The number of potential targets is 2 &#8211; the 95 hp musket and the 73 hp axe. The 100 hp musket will defend, so is not a collateral target. The 42 hp knight is below the maximum damage for a catapult.

Each type of unit capable of doing collateral damage is limited in the number of targets it can hit, too. A catapult can only hit 5, a cannon 6, an artillery 7, Cho-Ko-Nu 5, a tank/panzer 5, a modern armor 6, a bomber 5, and a stealth bomber 6. So, even targeting a stack of 12 muskets, a cannon will only hit 7 total (1 directly which defends and 6 with collateral damage).

The number of targets, then, is the lesser of the two numbers &#8211; min(potential_targets,max_capable).

Selecting targets

The target of each &#8220;round&#8221; of collateral damage is selected randomly from the list of potential targets, as defined above. I don&#8217;t think the list is updated each round (so that a unit at the maximum damage mark could be selected), but I&#8217;m not certain.

Amount of Damage Done

The damage calculation is similar to the damage calculation for regular combat. However, the modifications to each unit&#8217;s strength are done differently.

The only potential attacker strength bonus is Barrage -- +20% for Barrage I, another 30% for Barrage II and another 50% for Barrage III. This affects the starting percentage of strength of each unit. The defender gets no strength bonus for anything. Hps are also not used in calculating these relative strengths.

All the regular artillery units (catapults, cannons, artillery, and (stealth) bombers) calculate based off of their full strength. The tanks (tank, panzer, modern armor) calculate based from 0 and the Cho-Ko-Nu starts at 50%.

Example: A Cho-Ko-Nu (str:6) will always have an adjusted strength of 3 (.5 * 6) when figuring collateral damage.

Example: A tank with Barrage I will have an adjusted strength of 5.6 (28 * .2) for collateral damage. With Barrage II, it would be 14 (28 * .5).

Then, the likely damage is half what it would be if the units were fighting directly with those relative strengths. That is, damage = floor(10*(3*A+D)/(3*D+A)). This amount is reduced only if the damage would put the defender past the damage threshold discussed above.

Example: A catapult (with Barrage I and Barrage II) is targeting a longbow with 71 hps in a city on a hill for collateral damage. The catapult&#8217;s adjusted strength is 7.5 (5 * 1.5) and the longbow&#8217;s adjusted strength is 6 &#8211; the hill defense, the city defense, the hps just don&#8217;t matter. The catapult does 11 damage to the longbow.

Putting It All Together

Then, the siege attack weapon simply loops through the selection and damage phase the number of times equal to the number of targets. Not every potential target gets hit and some may get hit more than once.

Example: A catapult (with Barrage I) attacks a stack with two full-strength muskets, a knight (with Combat I) at 54 hps, a sword at 38 hps, and an elephant at 83 hps. The number of targets is 3. The first random target is the elephant. Adjusted strengths of 6 and 8 means 8 damage to the elephant. Round 2, the knight is picked. Adjusted strengths of 6 and 10 mean 7 damage, but the limit is 4 because of maximum damage. Round 3, the elephant is selected again, and takes another 8 damage. Before combat between the catapult and the first full-strength musket begins, the stack now has two full-strength muskets, a knight with 50 hps, a sword with 38 hps, and an elephant with 67 hps. Then, the attack between the catapult and the musket would resolve as normally (described above).

Experience Points

The winner of combat gains experience points. Like most of combat, experience points are determined by the ratio of strengths. The value is floor(iXPValue*opponent_strength/your_strength), where iXPValue comes from the XML file. For all standard units, iXPValue is 4 for an attacking unit and 2 for a defending unit. The minimum number of experience points for a successful fight is 1, however. The strengths are the displayed modified strengths (from bonuses and hps).

Exceptions: A unit which attacks and retreats gains a single experience point in all cases. The defending unit receives no experience points in this case.

Example: A sword (str:6) attacks a spearman (str:4) on flatlands. If the sword won, he would receive 2 (floor(4*4/6)) xps. The spear would gain 3 (floor(2*6/4)) xps if it won.

Example: A modern armor (str:40) attacks a spear (str:4). If the modern armor wins (odds: 99.999999+%), it gains 1 xp, not 0 (floor(4*4/40)). If the spear wins (odds: 6e^-13), it would gain 20 xp (floor(2*40/4)).

(continued in next post)
Arathorn

Repercussions

Now Ill discuss a bit of strategy. It helps to have understood, at least partially, the way combat works before reading this section, but it's not absolutely necessary.

Jump Points

Because of the nature of the hp damage dealt and the way it divides the attacker and defenders hps, there are a few natural jump points, where a very small change in R can make a huge difference in relative odds of winning  these are points you should aim to be on the right side of, whether youre attacking strong and want high odds or are attacking weak and need a best chance.

Full 100 hp situation

For ease in explaining, Im going to describe the case when both the attacker and defender have 100 hps. Then Ill discuss a bit of how it changes when either or both are injured.

The first is when the defenders damage drops from 15 to 14. This happens when the attacker is at least 1.8 times as strong as the defender. It means the defender needs 7 hits to kill the attacker instead of 6. Above 1.8 R, the attacker wins 99+% of the time. Thats not to say upsets wont happen (1% is actually pretty likely), but it does mean the odds are very good.

The second jump point is when attackers damage is 25. That means, the attacker needs only 4 rounds to destroy the defender. Doing a little math show that happens when R=11/7. If you are 1.57142857... times as strong as the defender, you win over 95% of the time. Shrink that just a little to only 1.57 times as strong and the odds of success drops all the way to 90%.

The third jump point occurs when the defenders damage drops from 17 to 16. This is the difference between 6 hits to kill and 7 hits to kill. It happens when R = 43/31, which is approximately 1.387. Above that ratio, the attacker wins over 87.5% of the time. At 1.387 and below, the attacker wins less than 80% of the time. Thats a jump from 5/6 to 4/5. Its significant. If you can achieve that 1.388 mark, its worth doing.

The final jump point is around an even battle. Even a tiny bit of strength makes a HUGE difference. Any stronger unit, by even .01, will have at worst a 62.3% chance of winning the combat. Thats because the stronger unit does 20 damage and the weaker only 19. 5 rounds to kill vs. 6 rounds to kill. Thats all there is to it. Going from a tiny bit stronger to a tiny bit weaker drops your chance of winning from 62.3% to 37.7%. A 40% chance of winning is impossible for fully-healed units(without first strikes).

Code:
``````[b]Ratio value	      Odds of winning[/b]
>1.8                   99%+
1.58-1.79	        95%-98%
1.39-1.57	        87%-90%
1.25-1.38	        75%-80%
1.01-1.25	        62%-75%
1.0                   50%
0.80-0.99	        25%-38%
0.73-0.79	        20%-25%
0.64-0.72	        10%-13%
0.56-0.63	         2%-5%
<0.56                  <1%``````

Obviously, it is to your benefit to just beat one of the jump points up if you can (so get 1.58:1 odds) and to avoid being on the bad end of a jump point. Attacking at 0.73:1 is a LOT better than at 0.72:1 (e.g., 4.4 vs. 6 is a LOT better than 4.3 vs. 6). Probably worth scrolling attackers to get good odds.

Note: the 75% spot is NOT a jump point. I just included it for perspective's sake.

Wounded Attacker/Defender

If one of the units is wounded, then the jump points situation will change. There will still be jump points, however. Those points will occur at the points when one sides damage crosses a jump point. The jump points can be found by looking at ceiling(remaining_hps/n) where n is any number (but, in reality, only n up to 8 are very likely to be an issue). The attacker looks at the defenders remaining hps and the defender looks at the attackers remaining hps.

Example: A 64 hp unit is attacking a 91 hp unit. Without consideration of strengths, we know that the jump points will occur when the attackers damage is 91, 46, 31, 23, 19, 16, 13, 12. Well, damage = 91 is impossible and damage = 46 is very unlikely, so there are jump points at 6 locations based off the defenders hps. (More explicitly, ceiling (91/1) = 91, ceiling (91/2) = 46, ceiling (91/3) = 31, ..., ceiling (91/8) = 12.) There will be jump points for the defender, too. Those jump points occur at fractions of 64  so 64, 32, 22, 16, 13, 11, 10, and 8. 64 is impossible and 8 is very unlikely. That leaves 32, 22, 16, 13, 11, and 10. So, the critical R values (from the attacker perspective) are 2.52, 1.32, 0.90, 0.64, 0.40, 0.32, 0.37, 0.83, 1.57, 2.47, 3.77, and 5.00. Those come from the attackers damage needed and the defenders damage needed respectively (so that 0.90 corresponds to 19 attacker damage and 1.57 to 16 defender damage).

The R values needed to do a certain amount of damage (or to prevent it being done to you) are summarized in this table (all figures rounded to the nearest hundredth).

Min ratio to do x damage:
Code:
``````[b]    R               1/R         damage[/b]
1/5   (0.20)     5/1   (5.00)     10
13/49 (0.27)     49/13 (3.77)     11
1/3   (0.33)     3/1   (3.00)     12
19/47 (0.40)     47/19 (2.47)     13
11/23 (0.48)     23/11 (2.09)     14
5/9   (0.55)     9/5   (1.8)      15
7/11  (0.64)     11/7  (1.57)     16
31/43 (0.72)     43/31 (1.39)     17
17/21 (0.81)     21/17 (1.24)     18
37/41 (0.90)     41/37 (1.11)     19
1/1   (1.00)     1/1   (1.00)     20
43/39 (1.10)     39/43 (0.91)     21
23/19 (1.21)     23/19 (0.83)     22
49/37 (1.32)     37/49 (0.76)     23
13/9  (1.44)     9/13  (0.69)     24
11/7  (1.57)     7/11  (0.64)     25
29/17 (1.71)     17/29 (0.59)     26
61/33 (1.85)     33/61 (0.54)     27
2/1   (2.00)     1/2   (0.50)     28
67/31 (2.16)     31/67 (0.46)     29
7/3   (2.33)     3/7   (0.43)     30
73/29 (2.52)     29/73 (0.40)     31
19/7  (2.71)     7/19  (0.37)     32
79/27 (2.93)     27/79 (0.34)     33
43/13 (3.15)     13/43 (0.32)     34``````

So, for all R between 1.10 and 1.21, 21 damage is done by the attacker.

Example: A 64 hp axeman attacks a 91 hp spear, with no bonuses or terrain modifications. The axemans adjusted strength is 5 * 1.5 * 64/100 = 4.80, and the spears adjusted strength is 4 * 91/100 = 3.64. R = 1.32 (just below). The spear wins 48% of the time and the axe just 52%, despite a rather significant advantage in R.

Example: Same as before, but now the axeman has 65 hps, instead of 64. Axemans adjusted strength is 4.87, so R = 1.34. The spear now only wins 34.4% of the time and the axe 65.6%.

How to Handle Jump Points

One problem with this is that hps are not displayed. Ive not found any way to determine a units hps other than to keep track of them from the Combat log window. Of course, for units strength 10 and higher, you can look at their remaining strength and determine exact hps. Either way is quite tedious.

Another problem is that the above table is rather long and complicated. I can generate it easily enough but theres no way I can memorize it. The table for healthy units is easier  7/5 is a good estimate for 1.39 and I can calculate that in my head. But figuring the jump points for injured units and then thinking 1.85? Hard to do.

The problem is that it matters. It matters in the order in which you attack. It matters in what your goals are. It matters in all kinds of things that insanely motivated Civers (like that guy I see in the mirror) care about.

Example: Two axemen, one with 64 hps and one with 55 hps absolutely, positively have to kill two spearmen (with 91 and 89) hps this turn. Theyre on the only metal in my empire, for example. I have two choices. Attack with the stronger first and then the weaker? Or the semi-counterintuitive and attack with the weaker first? Well, attacker stronger then weaker gives me a 23.2% chance of killing both, whereas attacking weaker then stronger gives a 28.5% chance of killing both.

Example: Same as above, but my stronger axeman has 65 hps. Weaker then stronger is now a bit better, 28.8%. BUT, stronger then weaker is an even better 29.2%. Because of the jump points.

And, depending on how the computer rounds things ending in .x5, I might not be able to tell the difference between a 64 hp axeman and a 65 hp axeman by looking  one is strength 3.20 and one is strength 3.25 (which may well round to 3.2). Keeping track of hps, which arent even displayed, could make significant differences in outcomes. What tedious micromanagement  its creeping back in again.

Bonus Peculiarities

Because of the way situation-dependent bonuses are applied to the defender instead of the attacker, some care needs to be taken in their use. The difference between a 25% bonus to yourself and a 25% penalty to the foe can be quite significant.

Example: Consider a unit with 3.7 strength (injured sword or whatever) with a 25% Cover promotion (or just any 25% bonus against archer units) attacking an archer in the woods. I'd expect from reading the +25% strength promotion to have 3.7*1.25=4.6 strength attacking 4.5 (3*1.5), so I would hope to have the odds in my favor (almost 64% of the time). BUT because of the bonus peculiarity, it'd be my 3.7 against their 3.8 (3*1.25). So, in actuality, the odds would be against me (36% chance of success)!]

Now, the correct numbers are displayed, but a clever player wants to know which units to use when. Reaching a jump point is nice, but the bonus peculiarity can be used (dis)advantageously as well.

If the defending unit has no bonuses (from terrain or fortification or against the attacker), then the R value is unchanged. So, theres no real area of gain to play against. Its only when the defender has some defensive strength that the peculiarity makes a noticeable difference.

If the expected attacker bonus that is eventually subtracted from the defenders bonus is greater than the defenders bonus, the peculiarity helps the attacker (i.e., when overall value for the defender bonus is negative). That is, both the attacker and the defender have bonuses, but the attackers bonus is larger than the defenders. So, a lot of bonuses will be more valuable than expected if they overcome defenders bonus. If youre attacking fortified units in cities, for example, that dont have a city defense bonus, the specific promotion for that scenario will be worth a little more than its listed percentage value.

Example: A sword (str:6) with City Raider I, II, and III is attacking a pike (str:6) defending a city. The city has a 30% defensive bonus. The attackers strength is just 6, but the defenders strength is 6/(1+1.1-.3) = 3.33, for an attack ratio of 1.80. The right way of doing things would have a strength 12.6 unit attacking a 7.8 unit, for a ratio of 1.62. So, here, the bonus peculiarity is helping the attacker.

If the expected attacker bonus does not overcome the defenders bonus (i.e., when overall value for the defender bonus is positive), the targeted promotion is providing less than its promised weight. That is, your 25% bonus against archery units may only be providing 22% in this case. Youd probably be better off just defending, all other things being equal. (See the earlier example)

First Strike

First strikes make the most dramatic difference to pure winning percentage when the two fighting units are very close in strength. Two units with identical strength and equal first strikes each have a 50% chance of winning (YAY! Something that finally makes sense in this mess of math). Give 1 a single first strike, though, and the odds of that unit winning goes up to 56.8%. Thats a tremendous difference. Take somebody at the 1.39:1 level and a first strike only matters a few percentage points (from 87.6% to 90.8% and still 84.5% if the weaker unit has the first strike). More than one first strike are similarly weighted towards mattering most for units close in strength. Raw strength is still VERY important, though. A unit with 3.3 strength and no first strikes will still kill a unit with 3 strength and 2 first strikes more often (~56% of the time).

The other thing, though, is that units with first strike are less likely to be wounded. First strike helps preserve hit points, so that a unit which won will be healthier. Back to the 3.3 vs. 3 with 2 first strikes example. The stronger unit wins more, but it deals, on average, 78.6 hps damage, while the first strike unit deals, on average, 79.8 hps damage. And the first striker is more than twice as likely to walk away uninjured as the stronger unit.

If your unit is barely stronger with first-strike or barely weaker without first strike, then the first strike promotion is better than a strength promotion. This appears true out to about the 1.38/1.39 strength ratio barrier. If the strength ratio is outside 1.38, strength beats first strike. And if strength would change which unit is stronger, strength wins out. Exact calculations on this may come later. One thing to note -- Combat I doesn't always give 10% to modified strength. An archer defending a city on a hill, for example, gains far less than 10% modified strength with Combat I (6 vs. 6.3). In cases with lots of bonuses, Drill might be the better promotion, potentially even over a 20/25% bonus. Work is still in progress on this.

Graph of Win Percentages

R = attacker's strength/defender's strength

Green -- attacker has 2 extra first strikes
Blue -- attacker has 1 extra first strike
Black -- attacker/defender even on first strikes
Orange -- defender has 1 extra first strike
Red -- defender has 2 extra first strikes
(sorry for the messiness -- I drew it by hand)

Arathorn

Here's some math, demonstrating the utility of the "vs. Specific situations" promotions over the General "Combat x" promotions...

For example, let's say you have two swordsmen ready to attack a city.....

1. Swordsman (+10% City Attack, and Combat II... 7.2 Strength) vs. Archer (+50% City Defense... 3 Strength) A/D Ratio is 1.714 (A=7.2 / D={3*1.4} 4.2)
2. Swordsman (+10% City Attack, and Combat I and City Raider I... 6.6 Strength) vs. Archer (+50% City Defense... 3 Strength) A/D Ratio is 1.833 (A=6.6 / D={3*1.2} 3.6)
Both situations show a significant advantage to the Swordsmen, but, in its role, the City Raider is numerically superior.

(I was worried that it wasn't even significant, statistically; but it appears that it is... )

Arathorn -- can you try to analyze the massive amount of damage the attacker seems to take when the odds are close... or even when they're not...

Hi,

great analysis! I knew how combat works internally before, but never thought about jump points and bonus peculiarities. Thanks!

-Kylearan

I'm curious as to how your archers and knights get City Raider. But good stuff. The whole "subtract attackers mods from defender" is really counterintuitive; why didn't they just go back and add them to the attacker?

Arathorn said:
(...)
Example #2: A knight (str:10) with Combat I and Pinch (+25% vs. archers) promotions is attacking a longbow (str:6) in a forest. The attackers modified strength is again simple, using the Combat I promotion of 10%. The knights attack value is 11 (10 + .1*10). The longbow has an initial bonus of +50% for the forest. However, the knights Pinch bonus now affects the defending longbow, giving it a -25%, too. So, the overall bonus for the longbow is +25%. The defenders modified strength is 7.5 (6 + .25*6).(...)

Small correction: The special promotion against archers is Cover, not Pinch.

Apart from that a great article!

Those "most attacker boni are applied to the defender" rule is somehow necessary to get the combat system working correctly.And it is definitly another issue to take in account, when deciding for or against certain promotions.

So there are percentage ranges for odds of winning that don't exist? Like the odds of winning will never be 51-61%? Seems strange. Informative post though.

There are still first strikes, which may cause values within those ranges.

BTW, first strikes are not to be underestimated.There is no better countermeasure against the danger of

WOW, after reading the thread, I played a little, and realised that the war system is way better and more complex then in any other strategy game. (except Warcraft maybe ) The bonus damages against certain unit types, terrain, rivers, stacks, airplanes, siege make the wars extremely complex. I think it's even possible to make unit combinations, like war elephant +maceman in one stack. They can only be hurt by archers or other maceman, war elephant, this combo makes mounted units useless... After all this I think spies and recon can be very useful, cause if you know what units the enemy has, and you even have a slight technological advance, you can make incredible damage very fast.

It's a real shame spies come so late in the game, and the only other way to get advance intel is holy city LOS.

before attacking you can also keep a few units inside enemy territory and keep an eye on his techs to make a better predicition of what youll need

edit:
this is a great thread, however a lot of people might not bother to read and comprehend all of this algebra, i would kindly ask you make a summary of whats in this thread, namely the parts about jumping points (24 to 25 damage) first strikes and the alt-mouseover thing which automaticly calculates odds.

Arathorn - thanks for this well written and interesting article. Might I suggest a few easily printable graphs esp. R vs odds of winning?

Hey, could you mod it to display the % chance of winning? Or is that too hard?

Khaim said:
Hey, could you mod it to display the % chance of winning? Or is that too hard?

That's a great idea, if possible

Unfortunately I'd have no idea how to do this but it might make a great intro tutorial on the topic of modding the interface.

How can being damaged not matter? That basically means free healing, right? There must be something I missed.... What could it be?

Both the attacker and the defender always begin with 100 hps, regardless of whether they are injured or not at the start of combat.

Tribute said:
How can being damaged not matter? That basically means free healing, right? There must be something I missed.... What could it be?

The hitpoints aren't really 'hitpoints' they are simply a measure of progress in the combat mechanic. A 'wounded' unit has a lower than normal 'strength' and therefore suffers a greater hitpoint reduction per lost attack/defence. There's no healing unless a unit waits a few turns.

Rather than thinking of it as 100 hitpoints, think of it instead as percentage of total stamina for that fight. A weak or wounded unit still has 100% available stamina at the start of the fight, but that amount of stamina might be quite low.

Because being injured lowers your strength. You really don't want to fight injured if you can avoid it.

Arathorn said:
First strikes make the most dramatic difference when the two fighting units are very close in strength.
Your conclusion differs with those at Apolyton Civilization.

DeepO said:
How do first strikes work?

First, in order to determine how many first strikes a unit A actually got, you need to look at the combatting unit B. If B ignore first strikes, unit A will have 0 first strikes. (very important early on!) If both A and B have first strikes (say A has 3, B has 1) it's the difference that counts (A gets 2, B gets 0).

Once battle is fought, each first strike gives a free round of battle. That means that a round is fought normally, but in case A has a first strike, he can't lose the round. If B would be hit, he gets hit. If the result is negative, it is ignored.

Notice that the base strength of the units is unaffected: if A has a strength (or hp) of 4, first strikes of 2 after modifiers, and B has a modified strength of 6, the first 2 rounds still have a 4/(4+6)=0.4 chance of succeeding, taking 0.2*6*(3*4+6)/(3*6+4)= 0.98 off the strength of B each time they hit. B, however, has 6/(4+6)=.6 chance of succeeding, but instead of taking .2*6*(3*6+4)/(3*4+6)=1.46 off the strength of A, it doesn't hit anything.

Once first strikes are over, combat continues as usual. At most, B has been hit once (but it could be twice or not), which would mean its strength is now at 5. (the average would be a bit higher) A is still at 4. The numbers in the formula don't change, though, so B still has a .6 chance of winning the next round, while A only has .4. With those numbers, B is almost certainly going to win, even if he was hit a little during first strikes.

You would be tempted to think that first strikes are thus unimportant. Nothing is farther from the thruth, you only need to use them well. If the situation is reversed, and a unit C has 6 strength and 2 first strikes, while unit D has 4 strength, the results are very different.

C will hit D in 60% of the cases, and it will do 0.97 damage. D can hit C in 40% of the cases, and will do 0.8 damage. With those numbers, C will hit D once or twice, doing at least 0.97 damage and reducing D to 3.03. Another 4 hits and he's dead... C still needs 6/.98= 6.1 or 7 hits.

(due to roundings, this is a bad example. In reality the number of rounds left will be 3 for C and 6 for D)

If you compare the battle of C with one without first strikes, you would see that C has a much higher chance of not getting damaged, with a sligthly higher chance of actually winning. The bigger the difference in strengths between C and D, the extremer this effect. Adding 2 first strikes to a unit that is already twice as superiour will mean he will win most battles undamaged. As your damage directly affects your strength in the next battle it is very important to keep a good health.

OTOH, if the difference between the strengths decreases, first strikes give a small advantage. You can use that to win fights where e.g. you have a 10% disadvantage. Once the difference is too large, first strikes won't help you to win, though.

First strikes should be used for two different types of units: those that defend and the overwhelming attackers. As defenders are most likely stronger because of the bonusses, they are helped as they can fend of multiple attacks, still remaining strong. It's very annoying to have dozens of units attack a city, where one single defender just shrugs of the attacks.

For the overwhelming attackers, it can keep you going. This especially applies to pillagers: they will remain healthy long enough to pillage that resource far inside the foreign borders, where units with the same strength but no first strikes will get slowly damaged over time to a point where an older unit can win. A tank which is damaged to strength 1 will most definately lose from a spearman of modified strength 5.

Lord Chambers said:
Your conclusion differs with those at Apolyton Civilization.

To the contrary: they're both saying the same thing with different words: First Strike makes a difference to winning when the units are at equal or almost equal strength

Replies
3
Views
648
Replies
8
Views
794
Replies
8
Views
1K
Replies
1
Views
169
Replies
13
Views
1K