Combat Explained....

Probability
Several posters to this thread have shown both mathematical aptitude and made some excellent observations. I miss one comment on probability though. When your odds to win a battle is better than 50%, it is more telling to look at the odds of losing than the odds of winning. At least if the unit is valuable. For example, the 5% from 90% to 95% is more valuable than the 5% from 50% to 55%. In the first case, you cut the risk of losing your unit in half, while in the other case the risk is all but unchanged. This means that higher end bonuses is very useful for your most valuable units. If all your units are the same all percentages are equal (heh).

First strikes are useful for:
-defending against several units in a single round. If you disallow your opponents to attack your city defences, a drill IV longbowman could singlehandedly defend against a large number of attackers. This allows for more counterattacking units instead of purely defending ones.
-(possibly) blitzing.

It certainly seems like the samurais are underpowered. They are only good for defence, and knights totally rip them up as they have +50% against melee and are immune to first strikes.
 
I think that the people who overvalue first strikes are forgetting one important fact. On the harder levels and most decent players that play multiplayer will bring siege weapons to attack a city. A group of Swordsman and Catapuls will destroy longbowmen with the first strike capability. Why? Because the good player will not attack the longbowmen until the catapults have lowered the city defense to zero and damaged the longbowmen collaterally. Then it is a 6.0 Swordsman vs 3.0 Longbowman, and no amount of first strikes will help with that battle. (2 to 1 Strength ratio results in 99% victory). So although against a player or AI that throw men into the breach, without siege support, the first strike may prove useful. But not against an equally matched player who comes to play if you know what I mean... But I digress, this thread is quickly becoming a debate about first strike when its intention was to explain combat and post findings. I don't want to threadjack the original intention of this thread, but I believe this has happened or is in the process of happening, against my original intentions. If anyone has anymore comments about first strike, please start a new thread and we can debate it there. Thanks.
 
Until catapults show up though, archers with first strikes can totally dominate. I'm playing a game right now where an archer with Drill 4 just got another promotion. Sweet. I'm almost done eliminating a 3rd opponent and nobody is even close to having catapults yet. A good example of how the Ancient era can be the most crucial in the game.

First strikes can also be great against raging barbarians (i guess, haven't tried yet), as you don't necessarily get lots of time to heal in between attacks and i don't think barbarians ever get catapults.

You have to agree at least that in some cases, Drill is by far the best promotion. It may be a highly specialized one, but it does have its uses.
 
Arathorn (or any mathematician who can give me an answer)

In the originial post Arathorn wrote this

Both the attacker and the defender always begin with 100 hps, regardless of whether they are injured or not at the start of combat...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.

Tell me if I have this concept correct. If somebody changed the 20 in the floor(20*(3*R+1)/(3+R)) and floor(20*(3+R)/(3*R+1)) to 22, then the jump points would remain in the outcomes. However, they would shift up to around 1.2 maybe 1.25. So what would the graph and jump points look like look like for that?
 
Hi Arathorn,

In the first post of this thread, you dive directly into how to resolve a combat between a given attacker and defender. But you don't mention how the defender is selected to begin with, from a stack of potential defenders. I only skimmed the rest of the thread, so maybe this is covered in some of the replies. If so, you should edit it into the first post as well.

Intuitively, one would expect the defender to be picked according to the actual odds of winning (not the strength ratios), so this would confirm that there is an actual built-in combat odds calculator. Alternatively, the defender is selected by some other criterion, such as the strength ratio or some variant thereof. This could mean that wounded, but more advanced units in a stack would run the risk of being killed due to their deceptively high strength (but low HPs). To be concrete, if I have a fully healed spearman at strength 4, I would want him to defend rather than a wounded pikeman at strength 4.1/6, since the latter would actually have a lower chance of winning.

Bottom line, in order to always pick the best possible defender, the game requires a full-fledged combat odds calculator which accounts for everything, including first strikes. If it's not already there, it would be high on my wish-list for a mod.
 
korn469 said:
Arathorn (or any mathematician who can give me an answer)

In the originial post Arathorn wrote this



Tell me if I have this concept correct. If somebody changed the 20 in the floor(20*(3*R+1)/(3+R)) and floor(20*(3+R)/(3*R+1)) to 22, then the jump points would remain in the outcomes. However, they would shift up to around 1.2 maybe 1.25. So what would the graph and jump points look like look like for that?

You're correct that there still would be jump points. But the graph would be pretty different. Now there's a jump point at the point that units are equal in strength. This is because 100 hitpoints is exactly 5 times 20 hitpoints so 5 hits would kill a unit. If a unit is only a little bit stronger, then the weaker unit would need 6 hits to do more than 100 hitpoints of damage. Because the chances of hitting 6 times (before your unit is dead) are a lot smaller than the chances of hitting 5 times, there is a jump point at the R value of 1.

Now 22 is not a divisor of 100 (there exist no integer n so that n times 22 is equal to 100). It would still take 5 hits of 22 damage to kill a unit of 100 hitpoints. However 5 hits of 21 damage will also do the job and even if you're doing 24 damage, you'll still need 5 hits to do more than 100 hitpoints of damage. Therefore, if a unit is only a little bit stronger then another, then both units will still need to hit 5 times. The stronger one will have a slightly larger chance to hit 5 times, but there's no jump point at the R value of 1.

The jump points will occur when the stronger unit will do 25 damage (needing only 4 hits to kill a unit) and the weaker unit will do 19.99999... damage (needing 6 hits to kill a unit).
The jump point where the stronger unit will only need 4 hits is at R=1.2927,
The jump point where the weaker unit will need 6 hits is at R = 1.2105.
It's not a good thing that these two jump points are so close to each other. Ingame, you'll effectively will see them as one super jump point. Before R= 1.2105 you'll be pretty even and after R=1.2927 the weaker unit will be at a very serious disadvantage.

Of course there are more jump points (which I will not calculate). However, I think that the above mentioned differences are the ones that you're most likely to notice ingame.
 
zakalwe said:
Hi Arathorn,

In the first post of this thread, you dive directly into how to resolve a combat between a given attacker and defender. But you don't mention how the defender is selected to begin with, from a stack of potential defenders. I only skimmed the rest of the thread, so maybe this is covered in some of the replies. If so, you should edit it into the first post as well.

Intuitively, one would expect the defender to be picked according to the actual odds of winning (not the strength ratios), so this would confirm that there is an actual built-in combat odds calculator. Alternatively, the defender is selected by some other criterion, such as the strength ratio or some variant thereof. This could mean that wounded, but more advanced units in a stack would run the risk of being killed due to their deceptively high strength (but low HPs). To be concrete, if I have a fully healed spearman at strength 4, I would want him to defend rather than a wounded pikeman at strength 4.1/6, since the latter would actually have a lower chance of winning.

Bottom line, in order to always pick the best possible defender, the game requires a full-fledged combat odds calculator which accounts for everything, including first strikes. If it's not already there, it would be high on my wish-list for a mod.

You're right, it's not already in there, and you're right, it should be. A good example is in my current game, where my archer with 0.5 strength left but 4-7 first strikes, wanted to attack an archer with 0.8 strength left but only 1 first strike. I'm pretty sure my archer is supposed to win this (and he did without losing any HP), but the odds showed as 0.5 vs 0.8, which is obviously wrong (or at the very least incomplete). My archer's score was shown in red and my opponent's in green.

I'm pretty sure the same applies to choosing defenders.
 
I just thought of an advantage for first strike units. When calculating how much XP you'll get from a win, cIV uses the current strengths of the units only. It does not modify for first strike ability. FS units can defeat stronger full strength units than there non-FS counterparts (although this difference isn't very much). Therefore giving it a little more experience in the long run.

For Example:

6.0 Attacker w/o FS vs 7.0 Defender w/o FS = 28.6% Win w/ 4 XP
6.0 Attacker w/ 4 FS vs 7.0 Defender = 53.3% Win w/ 4 XP

It's not much, but over the long run, if you attack stronger units with your firststrikers instead of non-firststrikers you will gain more experience (because your survivabilty is much higher). Still Combat II is only 2 promotions and gives 20%. To get 4 FS may take more promotions.
 
But by taking the inferior promotion you decrease your chance of winning battles in the first place.
 
eg577 said:
But by taking the inferior promotion you decrease your chance of winning battles in the first place.

True, I was trying to give the First Strike crowd hope ;)
 
Great math work you have done,gentlemen;that´s the basis,surely.
But,IMO to think about the promotions,one must decide first what for he wants the unity:to protect a city?just to defend the city square?recon?counteractack?conquer cities?all atack?destroy cities´defenses?weaken stacks?deep strikes?or try the all propose unity?
 
Zombie69 said:
You're right, it's not already in there, and you're right, it should be. A good example is in my current game, where my archer with 0.5 strength left but 4-7 first strikes, wanted to attack an archer with 0.8 strength left but only 1 first strike. I'm pretty sure my archer is supposed to win this (and he did without losing any HP), but the odds showed as 0.5 vs 0.8, which is obviously wrong (or at the very least incomplete). My archer's score was shown in red and my opponent's in green.

I'm pretty sure the same applies to choosing defenders.

Well, your example only shows that the displayed strength ratios differ from the actual chance of winning, which is of course well-known by now. What would be interesting is if someone could come up with an example where the game picks a sub-optimal defender for a given attacker. I personally suspect that the game *does* have an algorithm for calculating the odds of winning, that is at least pretty accurate (if not perfect). This algorithm is presumably used both to pick the best defender, but also by the AI. If so, the game already knows the % chance of winning any given combat, so exposing it through a mod could turn out to be pretty easy.
 
If it does have such an algorithm, why doesn't it use that algorithm to determine the amount of experience you get? The combat i mentioned above gave me 6 XP, and i'm pretty sure my odds were well above 50%.

It's true that a test is needed to know for sure, but i highly suspect that the algorithm is not there at all.
 
I didn't read all the dicsussion about first strike vs combat, but i think you overlooked, how % bonuses add for defender.

If there is no bonus present, then the 10% from combat 1 will be better than 1 first strike, but if there is either a large positive or negative bonus there first strike gets stronger.

Example(using combat calculator): Longbowman(str 6 + 1 FS) with 150% defense(walls,castle,city+hill) vs cavalry with combat 1(str 15);

chance to win for bow with combat 1: 40.25%
chance to win for bow with drill1: 44.03%

The reason is simply that all combat bonuses are added, a +10% on top of +150% is less worth than on top of +0%. Above the combat increases combat 1 increases the longbowman final strength just from 15 to 15.6.

Of course the combat 1 will still be better if it jumps odds above the ratio 1 gap:

chance to win for bow with combat 3(str16.8): 69.5%
chance to win for bow with combat 2 and drill1(str16.2): 49.12%

but above that favor is again with drill:

chance to win for bow with combat 4(str17.4): 71.49%
chance to win for bow with combat 3 and drill1(str16.8): 75.23%

A similar effect is off course at the other jumppoints.

For attackers i think this argument does not hold, as they do not receive any strength modification except combat, so the +10% always increases final strength by 10%.

But if there are no large bonuses combat is better.

A very complicted effect is that with higher combat drill 1 gains slightly ground against further combat promotions.

So drill is better for a defender if there are already large bonuses(no difference whether for or against i think) and strength ratio is not around a jump point.

Someone motivated could do an extensive analysis how much other bonuses already have to be present, that drill gets better than combat, assuming no jump point.

Conclusions: If units are expected to fight with high final bonuses present and a 10% does not get over jump point(difficult to know in advance), then drill is better than combat.


P.s. i fear i can become a real addict, i have so far only played the demo version, but i cannot stop starting again and again to play that 100 turns - and its probably even more fun when the terrain is no longer black!:scan:
 
Zombie69 said:
If it does have such an algorithm, why doesn't it use that algorithm to determine the amount of experience you get? The combat i mentioned above gave me 6 XP, and i'm pretty sure my odds were well above 50%.

Good point. But again, this only shows that the amount of XP you gain does not necessarily correlate all that well with your chance of winning. The clincher would be an example of the game picking a sub-optimal defender; that would convince me that the game is in fact incapable of calculating the correct chance of winning.

It is possible (or even probable) that the algorithms for resolving a combat, calculating the chances of winning one, and determining the amount of XP the winner should gain, might not have been kept all that synchronized during the development process.

We can only speculate (which we do) :lol:
 
Zombie69 said:
If it does have such an algorithm, why doesn't it use that algorithm to determine the amount of experience you get? The combat i mentioned above gave me 6 XP, and i'm pretty sure my odds were well above 50%.

It's true that a test is needed to know for sure, but i highly suspect that the algorithm is not there at all.

XP = (4 * Defender Str)/(Attacker Str)
XP = (4 * 0.8)/(0.5) = 6.3 = 6 XP

Your correct, first strikes and chances are not displayed in the odds and are therefore misleading. I'd get upset when I'd have a 5.0 attacker vs 3.5 defender and lose, until I realized the defender had first strikes. Again the odds are only good for Unit vs Unit w/Bonuses, but are misleading for first strikes attackers (actual winning odds are higher than listed) and when the defender has FS and the attacker doesn't the odds are lower than listed for the attacker. See Here for a first strike analysis
 
Top Bottom