The Combat Formula

Specialist290

Terracotta Statue Man
Joined
Jul 1, 2003
Messages
1,335
I'm having a little trouble working the big complex formula Sodak gave in his article in the War Academy. The

p = (A - 1) / 2D

and the

p = 1 - ((D + 1) / 2A)

I have no problem with, but the big long one at the end,

P = SUMn(COMB(n-1,dh-1) * (p^dh) * (1-p)^(n-dh))

just completely confuses me. Can someone explain how it works?
 
I have no clue, and I don't relay care. People who pry into these things too much have far too much time, and should find something truely interesting to do. I enjoy Civ, but I never plan to become someone who plans out each turn of a game in advance after the first turn, sitting with a combat calculator of some kind weighing the odd of every pice they move and deciding how to work an exact percentage of gold per turn so that they time their revolution at the proper moment so as to avoid blah blah blah....

These are the people who need to remember that Civ is just a game. So enjoy it, and don't pry it appart down to its raw codes and formulas. Civ was meant to be played, not studied.
 
Perhaps to you, but would you rather spend your time looking over equations and charts to determine the probability of X happening over Y, or would you rather just play it though? Spending all your time reserching and calculating with occasional sleep, sounds strangley like...
SCHOOL
Dun dun dun!!!!
Then we look at all those historical blurbs in the Civopedia, and the historical accuracy of the game...
:eek: Oh my god! Civ was fabricated by the ministry of education to educate people, cleverly diguised as a strategy game! We must warn the wold of this conspiracy!
:cool: Not so fast Mr. Anderson!
:wow: Eeep!
:ninja: I'll save you!
:) Horray! It's Ninja Man!!!
Ninja man, Ninja man,
Does whatever a Ninja ca- er...
:confused: What were we talking about?
 
*Ahem* Does anyone want to actually answer my question and stop debating this?
 
Thanks. Printing that out as we speak. Also checking out the Combat Info thread in the Apolyton GL.

Yuri was pretty close when he made an analogy for school; I needed that formula for my school science project :D
 
There, You see now??? The truth is right in front of you!!! Soon Civ will no longer be a game, but a boring historical recreation program! They'll do it gradually, first they crank up the realism, with the excuse that it "adds to the game." Then they de-euro-centrocise it, incorperating more accurate erras, evolving names/leaders, and more UUs. And then, before anyone realises what's happend, they disable random maps! Leaving the most detailed and accurate Earth map in it's place. They add more Civs to represent every nation that's ever existed, and then create "scenarios" that are just perfect re-enacmets of events!!! Before you know it we'll have quadratic combat formulas, Market-Economy simulators, and use TRIGONOMETRY to place cities!!! I warn you all, you must rebell! Overthrow the government agency that has Captured Sid Meier, and taken controll of Firaxis!!! We mu- Hey, who are you!? What are you... no, don't AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA!!!!
:joke:
:mischief: I can be so crazy sometimes. :lol:
 
No, I'm still bemoaning the fate of the Southeast Asian civilizations in Civ3; without the ability to irrigate hills, their destinies are rather compromised. The "Eskimos" are happy, though, secure in the knowledge that it is actually possible to plant trees in tundra.
 
P = SUMn(COMB(n-1,dh-1) * (p^dh) * (1-p)^(n-dh))
The combat between two units is divided into battles: in each battle one side wins and other one loses several hitpoints (depending on opponent's firepower). First unit that loses all hitpoints is killed.
'p' are probabilities of a win in a battle
'P' is a probability of a win in all the combat - and you may deduce the formula
P = SUMn(COMB(n-1,dh-1) * (p^dh) * (1-p)^(n-dh))
by yourself - it is a quite simple probability math (shall I explain it more detailedly?).
 
Part of the problem might stem from this problem: Is the "^' symbol representing exponential multiplication, or division?

I think I understand it better, but some stuff is still hazy (like what exactly "COMB" represents), so a bit more depth might be necessary.
 
a remind
Originally posted by sodak
ah = Attacker's modified hit points
dh = Defender's modified hit points
p = probability for attacker to win combat round
P = probability for attacker to win battle
Note: Modified hit points: An opponent's total hit points are divided by the unit's firepower. Thus an attacker with 2fp halves the defender's total hit points.
So ah represents the number of combat rounds that the attacker must lose so that it is definitely destroyed, similarly dh.

Sorry, I see in my last post I swapped terms battle and combat! From now I will use Sodak's terms.

Comb is the 'combinatorial number':
Comb(n,k)=n! / k!*(n-k!)
(! is the factorial)
Comb(n,k) is equal to number of k-sized subsets of a set of size n

^ is the exponent

It is clear that
P=SUMn (probability that attacker wins dh combat rounds and loses n-dh combat rounds - so there is total n rounds)
Where "n" is summed from dh to dh+ah-1 (then attacker loses from 0 to ah-1 rounds: it cannot lose more because he would be killed)

p^dh is equal to a probablity that attacker will win dh times in a row
(1-p)^(n-dh) is equal to a probablity that attacker will lose n-dh times in a row
(p^dh) * (1-p)^(n-dh) is equal to a probablity that attacker will win dh times and lose n-dh times
Attacker always wins the last round, but the n-1 preceeding results (win-loss) may be mixed up in COMB(n-1,dh-1) ways

An example of mixing Wins and Loses:
n=6, dh=4 (therefore there must be 4 Wins so that defender is destroyed), n-dh=2 (it is the number of Loses)
W W W L L W (last round is always Win)
W W L W L W
W L W W L W
L W W W L W
W W L L W W
W L W L W W
L W W L W W
...
L L W W W W
total is COMB(5,2)=10

That's all.
BTW Sodak explains it this way:
Originally posted by Sodak
In layman's terms, P is the sum of the probabilities of all the possible outcomes of the attacker winning. For example, the odds of the attacker winning ten straight combats, plus that of winning ten out of eleven, plus that of winning ten out of twelve, and so on, added together to produce a grand total. The maximum number of rounds is the attacker's and defender's total hit points minus one. Basically, until the winner is left with a single hit point after destroying the loser. The defender's chance is (1 - winner's probability).
 
Yuri2356 said:
Did you even begin to notice that that's supposed to be a conspiracy theory?

Andu Indorin said:
No, I'm still bemoaning the fate of the Southeast Asian civilizations in Civ3; without the ability to irrigate hills, their destinies are rather compromised. The "Eskimos" are happy, though, secure in the knowledge that it is actually possible to plant trees in tundra.

Ooo - sarcasm and ironic rejoinder... weekend fun... thanks for bringing us back to "reality", SlowThinker...

:lol:
 
If I am understanding one of the conquences of the formula would be that an even number of attackers and defenders would always give the defenders a big advantage. The disparity between hit points would have to be a good bit bigger for the attackers to have the advantage if the numerical number of opponents were the same. Or am I a confused as usual?
 
I agree that Civ2 is not a game to be studied.

The fun thing about Civ 2 is that you play it many times and the results are unpredictable. I often throw my units in suicide attacks and they win. This game is fun only because it's a game.

I once wrote a Civ2 player guide for beginners. But I did it mostly because it was fun to do. (the manual is in portuguese, no I did not put it to download in this site- if anyone wants it, it's free, please send a message to fabioburch@terra.com.br, and i will send you the Word file).

War in Civ2 has to be about strategy and having fun. Not formulas and cold numbers.

It creeps me to know that there are people who really create formulas and spend many hours of their lives calculating Civ 2 movements!
 
Originally posted by scloopy
If I am understanding one of the conquences of the formula would be that an even number of attackers and defenders would always give the defenders a big advantage. The disparity between hit points would have to be a good bit bigger for the attackers to have the advantage if the numerical number of opponents were the same. Or am I a confused as usual?
The defender gets a bonus approx. 1/8 to his defense value, the attacker loses 1/8. So a warrior against warrior is 0.875 vs. 1.125 and the probability that the attacker wins is 39% IIRC.
But hitpoints are more important, unit with 20 HP is twice strong as a 10HP unit.
Read the post Combat math in practice in the Info: Combat (GL) thread.

Originally posted by The Mass Leader
The fun thing about Civ 2 is that you play it many times and the results are unpredictable. I often throw my units in suicide attacks and they win. This game is fun only because it's a game.
:) I think the fun thing about Civ 2 is that different people find different ways how to enjoy the game.
War in Civ2 has to be about strategy and having fun. Not formulas and cold numbers.
IMHO you need to think some way if you want to enjoy strategies, if you play accidentally then you cannot speak about a strategy. 10 shields for a warrior and 20 shields for a horsemen - do you want to say you ignore these stats? Are you unable to predict turn when a new unit will be completed? I suppose you do. But in practice these are also 'cold numbers' (maybe you feel they are 'warmer', because you are more familiar with them).
 
Back
Top Bottom