Unit power formula

Yakk

Cheftan
Joined
Mar 6, 2006
Messages
1,288
So I was crunching away, and I noticed that you can reduce the strength of units in Civ4 to a linear power number.

This linear power number tells you how many units, roughly, it takes to win a war of attrition against a stack of defenders.

If you are within 3 times the strength of the defenders, either way, you can simply square your unit strength. (beyond 3 times the formula doesn't hold that well)

If the sum of squares of your unit stack beats the sum of squares of their unit stack, you can probably win the war of attrition.

This does not take into account collateral damage or first strikes. Adding them to the model would be interesting. :)

It does, however, provide a minimium standard that attacks on cities can be evaluated against. If you fail this test, you should definately not attack the city: if you pass this test, you should possibly do a trial-run attack or two to determine if the attack would succeed.

...

Now, factoring in collateral damage. Collateral damage is nicely independant of normal damage. You get one "first-stike-ish" combat round against up to 8 enemies.

The max effect of collateral damage is halving the HP of every enemy unit (which, I believe, halves their total power, or doubles yours: either is equivilent to the other). So we should note that as a bound.

A Strength X collateral attack against a Strength Y defender has an X/(X+Y) chance of hitting for 20*(3X+Y)/(3Y+X) percent damage. The damage can be refactored as:
20*(3X/Y+1)/(3+X/Y)
If X/Y is between 1/3 and 3, this works out to rougly 20*sqrt(X/Y) (no, really!)

So we get 20% * sqrt(X/Y) * (X/Y)/(X/Y+1) of a unit of Y strength, up to 8 or n-1 targets.

Let R = X/Y, or R*Y=X. Then we get:
sqrt(R) * R / 5(R+1)

as the expected amount of damage on on the target.

Sadly, this doesn't line up with the power exponent, so we can't turn collateral damage into a power number. We could probably build a softening-up number.

...

Now, factoring in first strike. We are aiming at total destruction of the defenders at the possible cost of the total destruction of the attackers, so this should simplify our problem. First Strike is more powerful if you have multiple weak attackers than if you have a few strong attackers, because it happens once per combat. This means the best we will be able to do, if we use a single power number, is to approximate it.

...

Hmm. I just realized I made an assumption. If a 6 strength unit is at 50% damage, will it fight like a 3 strength unit at 100%? I remember at one point Civ4 used that combat model, but I think they changed it. I'm assuming a 6 strength unit at 50% does not fight like a 3 strength unit at 100%.

...

After you pass a 3:1 strength ratio, the growth rate of "relative power" declines. A half-decent approximation is strengthRatio * (2+strengthRatio/3) instead of strengthRatio^2. It eventually flattens out at 7 * strengthRatio.

However, this extreme case is unlikely to matter: such extreme strength ratios only happen with modern armor attacks spearmen, or artillery attacks warriors.

...

Of course, all of this is useless if it is computationally feasable to run a full-stack fight-simulation whenever the AI wants to know if a fight is worthwhile. :)
 
Very interesting analysis. If nothing else it can give us players an easy way to do a quick mental estimation.

...

Hmm. I just realized I made an assumption. If a 6 strength unit is at 50% damage, will it fight like a 3 strength unit at 100%? I remember at one point Civ4 used that combat model, but I think they changed it. I'm assuming a 6 strength unit at 50% does not fight like a 3 strength unit at 100%.

...
I believe a unit's effectiveness is the average of its current and maximum strength. In the patch notes for 1.61:
1.61 notes said:
* firepower is now average of curr and max strength
 
Top Bottom