Combat Explained....

Arathorn, can you do a reassessment of Combat with the changes in the 1.61 patch with averaged(average of full health and actuall health) combat?

CS
 
CanuckSoldier,

Check out moonsinger's post under Hall of Fame discussion about calculating combat odds, but here is my short answer to your question.

Firepower change made calculations more complex as averaging needs to be done after each battle round between max possible strength of the unit and its current strength hit points. Probability calculations get more complex, but the basic idea remains the same. I don't have the time now to rewrite a fully updated 1.61 combat odds calculation post, but I will try to rephrase in simple words where the old formula fails to do its job :D Finally, I will say what this change brings to the game and how you should upgrade your units differently to get most effect.

When calculating probability of success during each battle round, I think :D, the odds of success change based on recalculation of defense and attack values with new damaged hit points values. I understand that this is not the math for the "damage done phase" of the calculation, but my understanding is that firepower change is taken into account when calculating probabilities of success, i.e. new A and D values, for each round of combat. I am not sure about this information, so someone with better knowledge correct me if I am wrong.

""2) The number of successes needed can be determined by determining the damage the attacker will do, and divide this from the current strength of the defender (and ceil the result).
The damage the attacker will do is (from the article; I verified it to be correct): 20*(3*A+D)/(3*D+A)"" Taken from Moonsinger's discussion on combat odds on Hall of Fame forum.

The damage an attacker will do, its firepower, is no longer a constant based on max strength, rather an average of the max strength and current (damaged)strength that changes each battle round. To calculate the number of successes needed is no longer as simple as before, because firepower changes with each battle round.

I agree with the structure of the formula to come up with the combat odds(look at moonsinger's post on combat odds for complete formula), but firepower change needs to be taken into account to calculate 1.61 values. The real formula is going to look real ugly, but the old formula still can give a close value for the 1.61 combat odd calculation. Firepower change implies that units with firststrike are stronger, because they can also reduce enemy firepower in addition to damaging them. It also happens if you lost extra hp compared to your opponent in the first couple rounds of the battle, you are more likely to lose the overall combat, because your firepower will also be relatively weaker. Damaged units are more likely to lose their fights in 1.61 than they did in 1.52.

I started to upgrade drill for my units after the patch; high levels of drill can be extremely deadly allowing you win battles practically undamaged. Drill is extremely useful in beating huge stacks of attacking units; because very few units will be able to damage with their full power due to your 3-4 first strikes.

I hope my nonsense helps you to understand the math behind the civ4 combat system :D Go drill this patch.

Take care,
 
Is it a fact that the damage each unit does is recalculated after each combat round based on the current strengths? I thought the damage each unit does is only calculated at the start of the combat based on the strength values of the units at that point in time (adjusted for loss of hitpoints, not the full health strength value). In the rest of the combat rounds that value is then used.

Do you have a post from a developer from Firaxis to back up this claim or did you just assume it works like that. This sounds a bit more harsh then I would want. I just want to know if this is a fact or an assumption.:confused:
 
In the Hall of Fame forum where we are discussing this issue, I am being told that firepower is calculated only at the beginning of the combat and NOT for each round of the combat. So you are right.

I will check with combat logs and the SDK code to be sure, but I am pretty much convinced it is the way you said.
 
Ah, ok. Thank you for the confirmation.
 
VirusMonster said:
CanuckSoldier,

Check out moonsinger's post under Hall of Fame discussion about calculating combat odds, but here is my short answer to your question.

Firepower change made calculations more complex as averaging needs to be done after each battle round between max possible strength of the unit and its current strength hit points. Probability calculations get more complex, but the basic idea remains the same. I don't have the time now to rewrite a fully updated 1.61 combat odds calculation post, but I will try to rephrase in simple words where the old formula fails to do its job :D Finally, I will say what this change brings to the game and how you should upgrade your units differently to get most effect.
Actually, it wasn't recalculated every round when the Civ 4 was released and from my tests it isn't being recalculated now as well. At least, results from my combat calculator seem to be similar to an ingame calculator. Also, according to SDK it isn't being recalcualted every round.
 
Yea, I agree now that firepower is only calculated once the combat begins. However, it seems to me that it would be more realistic that firepower diminishes as battle progresses, since unit strength decreases during each round of combat.
 
Hi! Guys! Really useful article! :goodjob:
I've learnt a lot indeed. But it would be far more useful for me if somebody deigned to explain to me what is "round" in the combat. Please, don't think I'm stupid. I just don't know :( And it's impossible to take in the author's message without knowing such essencials of the combat like these bloody "rounds". I guess explanation of rouns should be added to the article.;)

Please, help me, or I wreck my brain trying comprehend the "Combat explained"
 
The whole combat is played over rounds. I roll a dice, if successful, I damage your unit. If unsuccessful, I get no damage done. Then, your unit's turn. You roll the dice, if successful, your units hits. If not, it is my turn again. Each turn is a round, a round like in a boxing match. Whoever loses the HPs first, loses the battle. Details are in the first post of this thread.
 
BuDDaH said:
Hi! Guys! Really useful article! :goodjob:
I've learnt a lot indeed. But it would be far more useful for me if somebody deigned to explain to me what is "round" in the combat. Please, don't think I'm stupid. I just don't know :( And it's impossible to take in the author's message without knowing such essencials of the combat like these bloody "rounds". I guess explanation of rouns should be added to the article.;)

Please, help me, or I wreck my brain trying comprehend the "Combat explained"


It's not an easy article and some things are assumed to be general knowledge which really aren't general knowledge. It is known to the ones familiar with previous versions of civ combat.

A unit that isn't wounded starts combat with 100 hitpoints. A combat round is a contest between the two units which determines which of them is going to damage the other. The one with the higher strength value has a bigger chance to do damage and also does a higher amount of damage.
For example: in a combat between two units with equal strength values, both units have a chance of 50% to damage the other. Only one of them actually does damage (cast a 100 sided die, if you throw a number in the range of 1-50, unit A is damaged, if you throw a number in the range of 51-100, unit B is damaged).
Both units do 20 points of damage to the other in case of a hit. So the one who is the first to score 5 hits will win.
 
VirusMonster said:
The whole combat is played over rounds. I roll a dice, if successful, I damage your unit. If unsuccessful, I get no damage done. Then, your unit's turn. You roll the dice, if successful, your units hits. If not, it is my turn again. Each turn is a round, a round like in a boxing match. Whoever loses the HPs first, loses the battle. Details are in the first post of this thread.

Actually not Quite, it's more like

I roll a dice... if successful I hit you, if unsuccessful you hit me (each turn someone gets hit*)
repeat
until either someone dies or the attacker retreats

* getting hit means you take damage UNLESS
1 This round is one of your Free Strikes
2 This round would kill you and you are the attacker and you successfully retreat.
 
Krikkitone said:
Actually not Quite, it's more like

I roll a dice... if successful I hit you, if unsuccessful you hit me (each turn someone gets hit*)
repeat
until either someone dies or the attacker retreats

* getting hit means you take damage UNLESS
1 This round is one of your Free Strikes
2 This round would kill you and you are the attacker and you successfully retreat.

That is a better explanation, I agree.:goodjob:
 
The combat resolution code is in CvUnit::updateCombat, in case some one find it more interesting to review it than playing the game ;)
 
I am working on an excel sheet that will give exact odds for various promotions.

I am struggling with the odds of winning and getting it right:

Lets use a spear vs spear for example with no promotions or defensive bonuses

Each spear needs 5 turn victorys to win. (floor (20 (3*4/4)/(3*4/4) ) = 20 )

The probability of each spear winning a given turn is 50%. What are the odds that the attacking spear wins?

It is obviously 50% in this senerio, but does anyone know the formula required for this senerio? I haven't found the correct formula yet for a "best of" senerio. Essentially, this would be a best of 9.
 
The Keeper said:
The probability of each spear winning a given turn is 50%. What are the odds that the attacking spear wins?

It is obviously 50% in this senerio, but does anyone know the formula required for this senerio? I haven't found the correct formula yet for a "best of" senerio. Essentially, this would be a best of 9.
I think you need this one
http://apolyton.net/forums/showthread.php?postid=4101550#post4101550

By the way, in our case last hit is always a killing hit. IMHO it should be counted separately. Chance to be hit with X attacks when attacker shoud hit with A strikes and defender should hit with D strikes, attacker wins a round with probability P

ChanceToBeHitWithX(X,A)=C(A-1+X,X)*((1-P)^X)*(P^(A-1))*P
or
ChanceToBeHitWithX(X,A)=C(A-1+X,X)*((1-P)^X)*(P^A)

That way, sum of ChanceToBeHitWithX when X=0..(D-1) is equal to a chance that this unit will win, as it should be.

C(n,k) is the binomial coefficient, C(n,k)=(n!)/(k!*(n-k)!)

***

If i recall correctly i used it in my first and later versions of my combat calculator. There are other formulas as well but they give only a chance to win. My formula also gives an average HP and a chance that some unit will win while recieving exactly X strikes so it's possible to calculate chances vs multiple units.
 
Or, after all this time, for Patch 2.08 ?
Not once in the preceding posts have I found a reference to something that appears in the combat log, and that is "Extra Combat". What is this, and how is it allocated ? I ask because I have just had two successive battles, in each of which a War Elephant with Combat 2 (and +50% vs. mounted) emerged from an enemy city, moved two tiles along roads, and attacked across a river a different Knight, both with Combat 1. But in one battle the log showed "Extra combat +10%" and "Extra combat -10%" with odds 63.3% from modified strengths of 8.8 (elephant) and 8.69; the knight won with 6 hits for 19 against 3 hits at 20: in the second case the log showed "Extra combat -20%" and "Extra combat +10%", odds 68.3%, modified strengths 9.6 (elephant) and again 8.69, and this time the elephant won with 5 hits at 21 vs. 5 at 19 - a close thing. All the units involved began at full health.
But whence the "extra combat" ? Why does the program suddenly sting you with an extra 10% ? Will the same happen when you are the attacker, making an unexpected difference to relative strengths ? Why the difference between the two attacks, in absolutely identical circumstances? Nor do I see why my knights had -13.1% strength modifiers, a strange figure.

Addendum: 8.8/8.69 = 1.013, which from Arathorn's table on page 1 should have given 21 damage per hit whereas the actual figure was 20.
 
2.08 has calculations for collateral combat which don't match the description in the initial post. Drill II-IV offers some protection against collateral damage, and the cap on the amount of collateral damage can be done is calculated in part on the relative strengths of the units involved (example: cats can take an archer down to 50hp, but can only take longbows down to 55hp).

Are trebs really worth it? discusses some of the implications of the 2.08 collateral damage calculations.
 
It's not collateral damage that I was talking about, but direct combat damage. I am collecting data as my game progresses, but this probably won't be much help for fights at lower odds, when my cowardly self prefers to avoid combat. My paticular peeve is the "extra combat" shown in the combat log after the fight, but not on the campaign screen before combat is initiated. Otherwise, I find that damage I do is nearly always less than Arathorn's tables show, whereas that by the enemy is often slightly higher. Only a point or three, but it does shift the jump points sometimes.
 
@Bushface: I think that the first elephant had combat1 promotion, not combat2. That's why the first elephant had a strength of 8.8 and the second 9.6.
Even if the log says -10%, the Combat1-2 modifier is not applied to defender strength, but to attacker's.
 
Top Bottom