Thread Tools
Old July 6, 2001, 16:17   #1
freshman
ACDG3 GaiansAlpha Centauri PBEMMac
Warlord
 
freshman's Avatar
 
Local Time: 03:21
Local Date: October 31, 2010
Join Date: Jun 2001
Location: SF
Posts: 246
combat: do the math!
Since I've never seen a post out there like this, here it is...forgive me if somebody else has done this too - I couldn't find it.

Everyone knows (if you've read the manual) how basic combat is computed on a round to round basis. But what is the OVERALL propability of winning the entire battle (10+ rounds)??!! Not only that, but how much damage can you expect to see if winning? We need to do a little math.

Let a = attack factor, d = defense factor
Then the propability of wining 1 round of combat is :
a/(a+d). Example Elephant vs. Warrior (no modifiers) has a 4/5 or 80%
chance of winning 1 round. When winning a round, fire-power units are subtracted from 10 * hit-points of the unit. Combat ends when the hit points of 1 unit reach 0. All combat with early units are between 1hp/1fp units, and so combat will last 10-19 rounds. That's what I focus on here. (ie. only phalanx,warrior,archer,legion,elephant,crusader,kn ight,chariot,caravel,catapult,horsemen,pikeman,tri eme; NOT armor,battleship,etc..)

Let p = chance of winning 1 round = a/(a+d)
Let q = chance of loosing 1 round = 1-p = d/(a+d)

P(x) = propability of win with x damage done
P(0) = p^10
P(1) = 10 * p^10 * q
P(2) = 55 * p^10 * q^2
P(3) = 220 * p^10 * q^3
P(4) = 715 * p^10 * q^4
P(5) = 2002 * p^10 * q^5
P(6) = 5005 * p^10 * q^6
P(7) = 11440 * p^10 * q^7
P(8) = 24310 * p^10 * q^8
P(9) = 48620 * p^10 * q^9
-----------------------
P(win) = sum of P(x) from 0..9 =
p^10 * (1+ 10*q + 55*q^2 + 220*q^3 + 715*q^4 + 2002*q^5 + 5005*q^6 + 11440*q^7 + 24310*q^8 + 48620*q^9)

Sanity check: when p=q=0.5, then P(win) should equal .5 exactly -
well p^10 = 1/1024, and the other terms add up to 512 exactly!!
so we do indeed get 1/2 - not obvious from the formula!

How were the probabilities found? The constants represent the number of ways you can distribute the wins and losses. I counted them by hand!
Just kiding. There is a natural way of counting them if you break up the rounds by the number of ways the first 10 rounds look and how the tail rounds are constrained to look.
Let (x y) = x choose y - the number of ways of picking out y positions from x posibilities.
Clearly there is only 1 way of winning a 10 round combat with no damage: win every round, so the constant = 1
for an 11 round combat, the loss can be anywhere within the first 10 rounds, or (10 1) = 10
12 rounds: (10 1) + (10 2)
13: (10 1) + 2*(10 2) + (10 3)
14: (10 1) + 3*(10 2) + 3*(10 3) + (10 4)
15: (10 1) + 4(10 2) + 6(10 3) + 4(10 4) + (10 5)
16: (10 1)+5(10 2)+10(10 3)+10(10 4)+5(10 5)+1(10 6)
17: (10 1)+6(10 2)+15(10 3)+20(10 4)+15(10 5)+6(10 6)+(10 7)
18: (10 1)+7(10 2)+21(10 3)+35(10 4)+35(10 5)+21(10 6)+7(10 7)+(10 8)
19: (10 1)+8(10 2)+28(10 3)+56(10 4)+70(10 5)+56(10 6)+28(10 7)
+8(10 8)+(10 9)

Probability of a win in 10+ round combat (1fp/1hp vs 1fp/1hp units)
-----------------------------------------------------------------------
def/att_1____2____3____4____5____6____7____8____9____1 0
1_____0.500 0.935 0.991 0.998 1.000 1.000 1.000 1.000 1.000 1.000
2_____0.065 0.500 0.814 0.935 0.977 0.991 0.996 0.998 0.999 1.000
3_____0.009 0.186 0.500 0.737 0.869 0.935 0.967 0.983 0.991 0.995
4_____0.002 0.065 0.263 0.500 0.689 0.814 0.890 0.935 0.961 0.977
5_____0.000 0.023 0.131 0.311 0.500 0.656 0.771 0.849 0.901 0.935
6_____0.000 0.009 0.065 0.186 0.344 0.500 0.633 0.737 0.814 0.869
7_____0.000 0.004 0.033 0.110 0.229 0.367 0.500 0.616 0.710 0.784
8_____0.000 0.002 0.017 0.065 0.151 0.263 0.384 0.500 0.603 0.689
9_____0.000 0.001 0.009 0.039 0.099 0.186 0.290 0.397 0.500 0.592
10____0.000 0.000 0.005 0.023 0.065 0.131 0.216 0.311 0.408 0.500
11____0.000 0.000 0.003 0.014 0.043 0.092 0.160 0.241 0.329 0.417
12____0.000 0.000 0.002 0.009 0.028 0.065 0.118 0.186 0.263 0.344
13____0.000 0.000 0.001 0.006 0.019 0.046 0.087 0.143 0.209 0.281
14____0.000 0.000 0.001 0.004 0.013 0.033 0.065 0.110 0.166 0.229
15____0.000 0.000 0.000 0.002 0.009 0.023 0.048 0.084 0.131 0.186
16____0.000 0.000 0.000 0.002 0.006 0.017 0.036 0.065 0.103 0.151
17____0.000 0.000 0.000 0.001 0.004 0.012 0.027 0.050 0.082 0.122
18____0.000 0.000 0.000 0.001 0.003 0.009 0.020 0.039 0.065 0.099
19____0.000 0.000 0.000 0.001 0.002 0.007 0.015 0.030 0.051 0.080
20____0.000 0.000 0.000 0.000 0.002 0.005 0.012 0.023 0.041 0.065
------------------------------------------------------------------------
Expected damage after successful win (out of 10):
------------------------------------------------------------------------
def/att_1____2____3____4____5____6____7____8____9____1 0
1_____6.476 4.565 3.267 2.487 1.997 1.666 1.428 1.250 1.111 1.000
2_____7.433 6.476 5.467 4.565 3.834 3.267 2.829 2.487 2.216 1.997
3_____7.711 7.131 6.476 5.798 5.149 4.565 4.058 3.628 3.267 2.963
4_____7.839 7.433 6.973 6.476 5.967 5.467 4.996 4.565 4.177 3.834
5_____7.913 7.603 7.255 6.876 6.476 6.068 5.664 5.275 4.907 4.565
6_____7.961 7.711 7.433 7.131 6.810 6.476 6.136 5.798 5.467 5.149
7_____7.994 7.785 7.556 7.307 7.041 6.763 6.476 6.185 5.894 5.608
8_____8.019 7.839 7.644 7.433 7.209 6.973 6.728 6.476 6.221 5.967
9_____8.038 7.881 7.711 7.529 7.335 7.131 6.919 6.700 6.476 6.250
10____8.053 7.913 7.763 7.603 7.433 7.255 7.069 6.876 6.678 6.476
11____8.065 7.939 7.805 7.662 7.512 7.353 7.188 7.017 6.840 6.659
12____8.075 7.961 7.839 7.711 7.576 7.433 7.285 7.131 6.973 6.810
13____8.083 7.979 7.868 7.751 7.628 7.500 7.366 7.227 7.083 6.936
14____8.091 7.994 7.892 7.785 7.673 7.556 7.433 7.307 7.176 7.041
15____8.097 8.007 7.913 7.814 7.711 7.603 7.491 7.375 7.255 7.131
16____8.102 8.019 7.931 7.839 7.744 7.644 7.541 7.433 7.323 7.209
17____8.107 8.029 7.947 7.861 7.772 7.680 7.584 7.484 7.382 7.276
18____8.111 8.038 7.961 7.881 7.797 7.711 7.621 7.529 7.433 7.335
19____8.115 8.046 7.973 7.898 7.820 7.739 7.655 7.568 7.479 7.387
20____8.119 8.053 7.984 7.913 7.839 7.763 7.684 7.603 7.519 7.433

Expected damage (given a successful win) was calculated by:
sum(P(i)*i)/sum(P(i))

The way to view the charts: a crusader (5) will beat a phalanx behind city walls (6) only 34.4% of the time! 65.6% of the time the phalanx will win, but will sustain an average of 6 units of damage though (look at the next chart with att/def switched). Another crusader should be able to come along and finish him off (so it might be a good policy to destroy those city walls with 2/3 diplomats first if a crusader loss or 2 is unacceptable!)

Modifiers question::::
Does anyone know how a 50% modifier is done with an original attack factor an odd number (or an odd def factor). In other words is a veteran warrior considered to have 1, 1.5, or 2 defence/attack?
A vet crusader has 7,7.5,or 8 attack? I tried setting up a scenario where I compared how easy killing a warrior with a warrior was on different terrain: grassland, forest, hills. grassland is clearly df=1.
hills are clearly df=2; I wasn't able to get a statistically significant picture if forest was 1, 1.5 or 2... Maybe somebody else out there has done the research??? I'm dying to know!

Some of the defense factors in the above tables are fictitious; 5 I think is an unreachable factor for instance.
__________________
-freshman

Last edited by freshman; July 6, 2001 at 16:23.
freshman is offline  
Old July 6, 2001, 16:53   #2
freshman
ACDG3 GaiansAlpha Centauri PBEMMac
Warlord
 
freshman's Avatar
 
Local Time: 03:21
Local Date: October 31, 2010
Join Date: Jun 2001
Location: SF
Posts: 246
Why did I bother to do this, you say?
I am trying to shave off turns off my conquer-mode game. I wanted to see the cost / benefit analysis of Elephants vs Crusaders against 2 def guys (if I go with Elephants, then I don't have to research 2/3 techs Myst./Phil/Monoth) and how does veteran units play into combat against pitiful 2 def guys (if I don't go vet, then I don't need 300 shields for Sun Tsus).
Those were my motivations.

But I still don't know what attack factor Civ uses for vet Crusaders : 7 or 7.5 or 8?
__________________
-freshman
freshman is offline  
Old July 6, 2001, 17:48   #3
Edward
Warlord
 
Local Time: 06:21
Local Date: October 31, 2010
Join Date: Apr 2000
Posts: 267
freshman,

Bravo on trudging through the math for combats. It can get very gruesome. Yes, others have done extensive research, and yes this is a topic that has come up before on this board a few times; most recently in the heated heuristics debate at:
http://apolyton.net/forums/showthrea...&threadid=2678

As is often the case, the manual is not entirely correct. Your formula for the winner of a mini-round is missing the fact that ties go to the defender. In reality mini-rounds are fought by comparing two die rolls. I believe the attacker's die has attackFactor*8 sides (numbered from 0 to (attackFactor*8)-1) and the defender's die had defenseFactor*8 sides (numbered from 0 to (defenseFactor*8)-1). This is what allows barbarian leaders to occasionally win fights and also throws off evenly matched fights in the defender's favor (especially when the hit points involved are low).

Modifiers are multiplied together (not added as one might expect from other areas of the game). Fractions are rounded to the nearest 1/8th (which generally means they're not rounded at all). This means:
vet warrior = 1.5
vet crusader = 7.5 attack factor
non-vet warrior in forest = 1.5 defense factor
vet warrior in forest = 2.25 defense factor

As you found out, a small difference in the units' strengths leads to an unexpectedly great difference in their chances to win the entire battle. I think you'll find the Great Library's entry very enlightening:
http://apolyton.net/forums/Forum1/HTML/001944.html?25.
In fact you should probably read it before diving into the discussion thread I mentioned at the top of this post.

p.s. watch out for "pitiful" 2 def guys on rivers.
Edward is offline  
Old July 6, 2001, 17:56   #4
freshman
ACDG3 GaiansAlpha Centauri PBEMMac
Warlord
 
freshman's Avatar
 
Local Time: 03:21
Local Date: October 31, 2010
Join Date: Jun 2001
Location: SF
Posts: 246
Have you ever been beaten by a lowly settler? Here's why:
a settler has 2 hp's and the attacker usually only 1hp, which means that the attacker has to win 20 rounds of combat to win, whereas the settler need only win 10 to kill you off.
A settler sitting on a hill is df 2, and on a mountain df 3, and on a mountain in a city with city walls 9 df!!
a fp1/hp1 attacker against a fp1/hp2 defender (like a warrior vs. a settler)
a win for the attacker means the battle will last 20-29 rounds with the following probabilities
P(x) = win with x damage done; rounds of combat = 20+x
P(0):1 * p^20
P(1):20 * p^20 * q
P(2):210 * p ^20 * q^2
P(3):1540 * p^20 * q^3
P(4):8855 * p^20 * q^4
P(5):42504 * p^20 * q^5
P(6):177100 * p^20 * q^6
P(7):657800 * p^20 * q^7
P(8):2220075 * p^20 * q^8
P(9):6906900 * p^20 * q^9

df/af_1____2____3____4____5____6____7____8____9____10
1 0.031 0.483 0.834 0.951 0.985 0.995 0.998 0.999 1.000 1.000
2 0.000 0.031 0.215 0.483 0.699 0.834 0.910 0.951 0.973 0.985
3 0.000 0.002 0.031 0.135 0.304 0.483 0.636 0.752 0.834 0.889
4 0.000 0.000 0.004 0.031 0.102 0.215 0.349 0.483 0.601 0.699
5 0.000 0.000 0.001 0.007 0.031 0.084 0.165 0.267 0.377 0.483
6 0.000 0.000 0.000 0.002 0.009 0.031 0.073 0.135 0.215 0.304
7 0.000 0.000 0.000 0.000 0.003 0.011 0.031 0.065 0.115 0.179
8 0.000 0.000 0.000 0.000 0.001 0.004 0.013 0.031 0.060 0.102
9 0.000 0.000 0.000 0.000 0.000 0.002 0.005 0.014 0.031 0.056
10 0.000 0.000 0.000 0.000 0.000 0.001 0.002 0.007 0.016 0.031

Expected damage after a win:
df/af_1____2____3____4____5____6____7____8____9____10 1 7.853 6.830 5.698 4.689 3.895 3.295 2.842 2.494 2.220 1.999
2 8.254 7.853 7.372 6.830 6.261 5.698 5.169 4.689 4.265 3.895
3 8.369 8.130 7.853 7.540 7.197 6.830 6.452 6.071 5.698 5.340
4 8.423 8.254 8.064 7.853 7.621 7.372 7.107 6.830 6.547 6.261
5 8.454 8.324 8.180 8.023 7.853 7.669 7.474 7.267 7.052 6.830
6 8.474 8.369 8.254 8.130 7.996 7.853 7.701 7.540 7.372 7.197
7 8.489 8.400 8.304 8.202 8.092 7.976 7.853 7.723 7.587 7.445
8 8.499 8.423 8.341 8.254 8.162 8.064 7.961 7.853 7.740 7.621
9 8.508 8.440 8.369 8.293 8.214 8.130 8.042 7.949 7.853 7.752
10 8.514 8.454 8.391 8.324 8.254 8.180 8.104 8.023 7.940 7.853

Note: a settler behind city walls vs. an elephant is a BETTER defender than a phalanx behind city walls vs. an elephant! An elephant only has a 13.5% chance against a settler (df 3), but a 18.6% chance against a phalanx (6)!! Of course most people use settlers for more interesting tasks than a garrison!! But it just shows the power of having 2 hp's - it MORE than doubles your effective defense.
__________________
-freshman
freshman is offline  
Old July 6, 2001, 18:10   #5
Scouse Gits
lifer
Civilization II PBEMTrade Wars / BlackNova TradersGalCiv Apolyton EmpireApolytoners Hall of FameCivilization II Succession Games
Emperor
 
Scouse Gits's Avatar
 
Local Time: 11:21
Local Date: October 31, 2010
Join Date: Nov 1999
Location: Liverpool, United Kingdom
Posts: 6,344
Thanks for the exhaustive analysis Freshman. Unfortunately your basic premise viz ...
Quote:
Let p = chance of winning 1 round = a/(a+d)
Let q = chance of loosing 1 round = 1-p = d/(a+d)
is not true.
If you look in the GL thread that has been referred to above you will see the accurate formula ...

Please feel free to analyse on this basis - your sums and tables would be most valuable.
______________
The SGs in their traditional Friday splash of red wine
Scouse Gits is offline  
Old July 6, 2001, 18:23   #6
freshman
ACDG3 GaiansAlpha Centauri PBEMMac
Warlord
 
freshman's Avatar
 
Local Time: 03:21
Local Date: October 31, 2010
Join Date: Jun 2001
Location: SF
Posts: 246
ok - I saw the GL thread - should've known to look there first.
Give me some time to complete a more accurate set of tables.
But at least I've got the combinatorics of how a battle goes worked out already (the constant numbers - not the invalid p's and q's probabilities)!

So I'll work out attack-factors of 8,16,24,32,40 with 50% modifiers for vet (are there other modifiers that effect attack-fact?)
and defense factors of 8,16,24,32 (pikeman vs. horsies) with 50%, 100%, 150%, 200%, 50%*50% = 2.25, and 50%*50%*50% = 27/8 X (for river+forest+vet).

thanks you guys!

ps - once I work out the tables with the right p's & q's, should I post to the GL thread? Am I allowed to?
__________________
-freshman
freshman is offline  
Old July 6, 2001, 19:30   #7
freshman
ACDG3 GaiansAlpha Centauri PBEMMac
Warlord
 
freshman's Avatar
 
Local Time: 03:21
Local Date: October 31, 2010
Join Date: Jun 2001
Location: SF
Posts: 246
How's this?
How did I do with the modifiers??

Using the GL:
"
On to the real calculation...
Each unit gets a randomly generated number from 0 to its modified value minus one, multiplied by a constant. This constant has been best-guessed (based on play testing) to be 8. The unit with the higher random number wins the combat, ties going to the defender.

If the defense value is equal to or greater than the attack value, the probability (p) of the attacker winning the combat round is
p = (A - 1) / 2D

If the attack value is greater than the defense value,
p = 1 - ((D + 1) / 2A)

Where A = (a * 8) and D = (d * 8). "

__________________________attack (af + vet af - next row is actual A)
_________________1____1.5____2____3____3_____4.5__ __4____6____5_____7.5
df__mods____Dv:A->___8___12___16___24____24____36____32___48__40__60

1___no_mods___8__0.290 0.869 0.979 0.999 0.999 1.000 1.000 1.000 1.000 1.000
1_________+50_12__0.027 0.356 0.798 0.984 0.984 0.999 0.998 1.000 1.000 1.000
1________+100_16__0.003 0.078 0.391 0.906 0.906 0.994 0.986 0.999 0.997 1.000
1________+200_24__0.000 0.005 0.043 0.427 0.427 0.917 0.836 0.988 0.957 0.998
1______+50+50_18__0.001 0.037 0.229 0.824 0.824 0.987 0.970 0.999 0.994 1.000
1___+50+50+50_27__0.000 0.002 0.019 0.255 0.255 0.840 0.710 0.973 0.913 0.995
1_____+100+50_24__0.000 0.005 0.043 0.427 0.427 0.917 0.836 0.988 0.957 0.998
1_____+200+50_36__0.000 0.000 0.002 0.049 0.049 0.451 0.269 0.848 0.630 0.961
1_______+50x3_54__0.000 0.000 0.000 0.003 0.003 0.054 0.024 0.283 0.105 0.644
1______+100x3_24__0.000 0.005 0.043 0.427 0.427 0.917 0.836 0.988 0.957 0.998
1______+200x3_24__0.000 0.005 0.043 0.427 0.427 0.917 0.836 0.988 0.957 0.998
1____+50+50x3_81__0.000 0.000 0.000 0.000 0.000 0.003 0.001 0.026 0.007 0.111
1_+50+50+50x3_36__0.000 0.000 0.002 0.049 0.049 0.451 0.269 0.848 0.630 0.961
1___+100+50x3_36__0.000 0.000 0.002 0.049 0.049 0.451 0.269 0.848 0.630 0.961
1___+200+50x3_36__0.000 0.000 0.002 0.049 0.049 0.451 0.269 0.848 0.630 0.961
2___no_mods___16__0.003 0.078 0.391 0.906 0.906 0.994 0.986 0.999 0.997 1.000
2_________+50_24__0.000 0.005 0.043 0.427 0.427 0.917 0.836 0.988 0.957 0.998
2________+100_32__0.000 0.000 0.005 0.102 0.102 0.644 0.445 0.922 0.782 0.982
2________+200_48__0.000 0.000 0.000 0.006 0.006 0.111 0.053 0.463 0.202 0.793
2______+50+50_36__0.000 0.000 0.002 0.049 0.049 0.451 0.269 0.848 0.630 0.961
2___+50+50+50_54__0.000 0.000 0.000 0.003 0.003 0.054 0.024 0.283 0.105 0.644
2_____+100+50_48__0.000 0.000 0.000 0.006 0.006 0.111 0.053 0.463 0.202 0.793
2_____+200+50_72__0.000 0.000 0.000 0.000 0.000 0.007 0.003 0.057 0.016 0.211
2_______+50x3_108__0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.003 0.001 0.017
2______+100x3_48__0.000 0.000 0.000 0.006 0.006 0.111 0.053 0.463 0.202 0.793
2______+200x3_48__0.000 0.000 0.000 0.006 0.006 0.111 0.053 0.463 0.202 0.793
2____+50+50x3_162__0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.001
2_+50+50+50x3_72__0.000 0.000 0.000 0.000 0.000 0.007 0.003 0.057 0.016 0.211
2___+100+50x3_72__0.000 0.000 0.000 0.000 0.000 0.007 0.003 0.057 0.016 0.211
2___+200+50x3_72__0.000 0.000 0.000 0.000 0.000 0.007 0.003 0.057 0.016 0.211
3___no_mods___24__0.000 0.005 0.043 0.427 0.427 0.917 0.836 0.988 0.957 0.998
3_________+50_36__0.000 0.000 0.002 0.049 0.049 0.451 0.269 0.848 0.630 0.961
3________+100_48__0.000 0.000 0.000 0.006 0.006 0.111 0.053 0.463 0.202 0.793
3________+200_72__0.000 0.000 0.000 0.000 0.000 0.007 0.003 0.057 0.016 0.211
3______+50+50_54__0.000 0.000 0.000 0.003 0.003 0.054 0.024 0.283 0.105 0.644
3___+50+50+50_81__0.000 0.000 0.000 0.000 0.000 0.003 0.001 0.026 0.007 0.111
3_____+100+50_72__0.000 0.000 0.000 0.000 0.000 0.007 0.003 0.057 0.016 0.211
3_____+200+50_108__0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.003 0.001 0.017
3_______+50x3_162__0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.001
3______+100x3_72__0.000 0.000 0.000 0.000 0.000 0.007 0.003 0.057 0.016 0.211
3______+200x3_72__0.000 0.000 0.000 0.000 0.000 0.007 0.003 0.057 0.016 0.211
3____+50+50x3_243__0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000
3_+50+50+50x3_108__0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.003 0.001 0.017
3___+100+50x3_108__0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.003 0.001 0.017
3___+200+50x3_108__0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.003 0.001 0.017
---------------------------------------------------------------------------------------------------------
Expected damage upon a win:
--------------------------------------------------------------------------------------------------------
attack (af + vet af)
_________________1____1.5____2____3____3_____4.5__ __4____6____5_____7.5
df__mods__act.df___8___12___16___24____24____36___ _32___48__40__60
1___no_mods___8__6.919 5.149 3.763 2.300 2.300 1.428 1.636 1.034 1.268 0.811
1_________+50_12__7.584 6.785 5.543 3.598 3.598 2.198 2.535 1.566 1.938 1.215
1________+100_16__7.794 7.392 6.713 4.865 4.865 3.047 3.515 2.147 2.678 1.650
1________+200_24__7.955 7.767 7.512 6.638 6.638 4.767 5.351 3.432 4.251 2.614
1______+50+50_18__7.852 7.536 7.041 5.416 5.416 3.488 4.009 2.456 3.069 1.879
1___+50+50+50_27__7.986 7.831 7.628 6.988 6.988 5.329 5.894 3.928 4.806 3.003
1_____+100+50_24__7.955 7.767 7.512 6.638 6.638 4.767 5.351 3.432 4.251 2.614
1_____+200+50_36__8.042 7.941 7.820 7.486 7.486 6.585 6.961 5.285 6.145 4.187
1_______+50x3_54__8.093 8.035 7.968 7.808 7.808 7.469 7.599 6.933 7.318 6.105
1______+100x3_24__7.955 7.767 7.512 6.638 6.638 4.767 5.351 3.432 4.251 2.614
1______+200x3_24__7.955 7.767 7.512 6.638 6.638 4.767 5.351 3.432 4.251 2.614
1____+50+50x3_81__8.125 8.089 8.050 7.963 7.963 7.801 7.859 7.589 7.737 7.304
1_+50+50+50x3_36__8.042 7.941 7.820 7.486 7.486 6.585 6.961 5.285 6.145 4.187
1___+100+50x3_36__8.042 7.941 7.820 7.486 7.486 6.585 6.961 5.285 6.145 4.187
1___+200+50x3_36__8.042 7.941 7.820 7.486 7.486 6.585 6.961 5.285 6.145 4.187
2___no_mods___16__7.794 7.392 6.713 4.865 4.865 3.047 3.515 2.147 2.678 1.650
2_________+50_24__7.955 7.767 7.512 6.638 6.638 4.767 5.351 3.432 4.251 2.614
2________+100_32__8.022 7.902 7.754 7.326 7.326 6.105 6.599 4.717 5.616 3.664
2________+200_48__8.081 8.013 7.934 7.740 7.740 7.303 7.473 6.559 7.098 5.567
2______+50+50_36__8.042 7.941 7.820 7.486 7.486 6.585 6.961 5.285 6.145 4.187
2___+50+50+50_54__8.093 8.035 7.968 7.808 7.808 7.469 7.599 6.933 7.318 6.105
2_____+100+50_48__8.081 8.013 7.934 7.740 7.740 7.303 7.473 6.559 7.098 5.567
2_____+200+50_72__8.117 8.076 8.031 7.927 7.927 7.730 7.803 7.460 7.650 7.080
2_______+50x3_108__8.140 8.114 8.086 8.027 8.027 7.923 7.960 7.797 7.883 7.643
2______+100x3_48__8.081 8.013 7.934 7.740 7.740 7.303 7.473 6.559 7.098 5.567
2______+200x3_48__8.081 8.013 7.934 7.740 7.740 7.303 7.473 6.559 7.098 5.567
2____+50+50x3_162__8.154 8.138 8.120 8.084 8.084 8.024 8.045 7.957 8.003 7.880
2_+50+50+50x3_72__8.117 8.076 8.031 7.927 7.927 7.730 7.803 7.460 7.650 7.080
2___+100+50x3_72__8.117 8.076 8.031 7.927 7.927 7.730 7.803 7.460 7.650 7.080
2___+200+50x3_72__8.117 8.076 8.031 7.927 7.927 7.730 7.803 7.460 7.650 7.080
3___no_mods___24__7.955 7.767 7.512 6.638 6.638 4.767 5.351 3.432 4.251 2.614
3_________+50_36__8.042 7.941 7.820 7.486 7.486 6.585 6.961 5.285 6.145 4.187
3________+100_48__8.081 8.013 7.934 7.740 7.740 7.303 7.473 6.559 7.098 5.567
3________+200_72__8.117 8.076 8.031 7.927 7.927 7.730 7.803 7.460 7.650 7.080
3______+50+50_54__8.093 8.035 7.968 7.808 7.808 7.469 7.599 6.933 7.318 6.105
3___+50+50+50_81__8.125 8.089 8.050 7.963 7.963 7.801 7.859 7.589 7.737 7.304
3_____+100+50_72__8.117 8.076 8.031 7.927 7.927 7.730 7.803 7.460 7.650 7.080
3_____+200+50_108__8.140 8.114 8.086 8.027 8.027 7.923 7.960 7.797 7.883 7.643
3_______+50x3_162__8.154 8.138 8.120 8.084 8.084 8.024 8.045 7.957 8.003 7.880
3______+100x3_72__8.117 8.076 8.031 7.927 7.927 7.730 7.803 7.460 7.650 7.080
3______+200x3_72__8.117 8.076 8.031 7.927 7.927 7.730 7.803 7.460 7.650 7.080
3____+50+50x3_243__8.164 8.153 8.142 8.119 8.119 8.083 8.095 8.043 8.070 8.001
3_+50+50+50x3_108__8.140 8.114 8.086 8.027 8.027 7.923 7.960 7.797 7.883 7.643
3___+100+50x3_108__8.140 8.114 8.086 8.027 8.027 7.923 7.960 7.797 7.883 7.643
3___+200+50x3_108__8.140 8.114 8.086 8.027 8.027 7.923 7.960 7.797 7.883 7.643
__________________
-freshman
freshman is offline  
Old July 6, 2001, 20:20   #8
Scouse Gits
lifer
Civilization II PBEMTrade Wars / BlackNova TradersGalCiv Apolyton EmpireApolytoners Hall of FameCivilization II Succession Games
Emperor
 
Scouse Gits's Avatar
 
Local Time: 11:21
Local Date: October 31, 2010
Join Date: Nov 1999
Location: Liverpool, United Kingdom
Posts: 6,344
At 01:20 local time and several bottles of red on board - this will have to wait for a more sober analysis - but thanks for all the effort!
_________________
The SGs well sozzled
Scouse Gits is offline  
Old July 6, 2001, 22:11   #9
freshman
ACDG3 GaiansAlpha Centauri PBEMMac
Warlord
 
freshman's Avatar
 
Local Time: 03:21
Local Date: October 31, 2010
Join Date: Jun 2001
Location: SF
Posts: 246
I already see a problem .... my +200% modifiers should x3, not x2.. ooops. let me fix my program and try again on Monday (until then people can live without mountain statistics, right?)
__________________
-freshman
freshman is offline  
Old July 7, 2001, 00:34   #10
freshman
ACDG3 GaiansAlpha Centauri PBEMMac
Warlord
 
freshman's Avatar
 
Local Time: 03:21
Local Date: October 31, 2010
Join Date: Jun 2001
Location: SF
Posts: 246
ok - so I think I understand why this factor of 8 seems to come into play. It is the minimum constant able to handle 3 consecutive multiplicative factors of +50% without any rounding errors; 8 = 2^3 and 1.5*1.5*1.5 = 3^3/2^3, (8 in the denominator exactly).
And 3 consecutive +50% bonuses are the only fractional bonuses that apply (forest+river+vet) period. The other bonuses are integral multiplicative bonuses.

Also, looking at the HP/FP table I see there are 7 types of units (that impact on the battle combinatorics):
HP/FP
1/1
2/1
2/2
1/3
3/1
3/2
4/2

and so there are 7*7 = 49 ways combat can take place (ok - actually only 37 if you work it out) in terms of combinatorics of wins/losses. The number of rounds of the battle will be:
att-hp = x
att-fp = y
def-hp = w
def-fp = z
#rounds needed for attacker to win = (10*w)/y
#rounds needed for attacker to loose (10*x)/z

and so a successful attacker win will last between
(10+w)/y .. (10+w)/y+(10*x)/z -1 rounds
the combinatorics though can be completely determined as far as figuring out the net probability of a win (and the probability of sustaining X amount of damage).

I could post 37 tables here...but I thought I might just post a C or a Java program you can compile and run yourself (with modifiers, etc...)

What do you folks think?

The main tables which are used a lot are the 1/1-att vs. 1/1-def tables and the 1/1-att vs. 2/1-def
(and I already posted the 1/1 vs. 1/1 above; the 1/1 vs 2/1 combinatorics above are right - but the probabilities are wrong)
__________________
-freshman
freshman is offline  
Old July 8, 2001, 14:09   #11
Marquis de Sodaq
King
 
Marquis de Sodaq's Avatar
 
Local Time: 05:21
Local Date: October 31, 2010
Join Date: Jul 2000
Location: ... no, a Marquis.
Posts: 2,179
Good golly!
I go away for a few days, and suddenly there's a heap of combat math on the boards!

Freshman, my GL thread formula should lead you down the right road. I started making a VB program to calculate any combat on the fly - choose attacker, defender, and conditions, and out spew the odds. Alas, I've not had enough time to finish it. I've even fallen a tad behind in updated the latest test results...

The problem with simplifying the combat to 37 different (so simple! ) is that some modifiers alter the firepower of units, some conditions alter the defensive value itself. That's why a program would work better than a table - too many possibilities for useful display. Also, see the simplified version of the formula. After a whopping 2 game tests, it seems to approximate the odds well. More testing would see if it holds water in all situations.

The 8 constant (multiplier) was apparently added for two reasons. One, to give 0-defense units a chance. Two, the larger the range of numbers in the equation, the fewer unexpected results likely to come up. Try changing hit points to 100, you'll see that the stronger unit's odds get better.
__________________
The first President of the first Apolyton Democracy Game (CivII, that is)

The gift of speech is given to many,
intelligence to few.
Marquis de Sodaq is offline  
Old July 8, 2001, 17:55   #12
Smash
Emperor
 
Smash's Avatar
 
Local Time: 03:21
Local Date: October 31, 2010
Join Date: Jul 1999
Location: Civ2 Diehard
Posts: 3,838
I can't read that.It might as well be written in Chinese or Hebrew

How does does the difficulty level affect the odds?

What about multiplayer?Does a difficulty level modifier apply in MP games?
Smash is offline  
Old July 9, 2001, 10:00   #13
Marquis de Sodaq
King
 
Marquis de Sodaq's Avatar
 
Local Time: 05:21
Local Date: October 31, 2010
Join Date: Jul 2000
Location: ... no, a Marquis.
Posts: 2,179
Smash, the difficulty level affects barbarian attack values. The higher the game level, the stronger they are. Chieftain barbarians attack at 25% strength. For each level higher, add another 25% (so they attack at 150% at deity, as if they are veterans).

Edit: I've never seen any threads about how MP might come into play. Testing would require cooperative players who want to relive the same combat 50 times to find out. If you can do it, let us know what you discover!
__________________
The first President of the first Apolyton Democracy Game (CivII, that is)

The gift of speech is given to many,
intelligence to few.
Marquis de Sodaq is offline  
Old July 11, 2001, 00:59   #14
Smash
Emperor
 
Smash's Avatar
 
Local Time: 03:21
Local Date: October 31, 2010
Join Date: Jul 1999
Location: Civ2 Diehard
Posts: 3,838
Ok.Nevermind barbs for the moment.

Is this saying that I should get similiar results with identical units,terrain,etc regardless of difficulty level?
ie-My non vet king level knights(which beat king level phalanx regularly) will actually win on deity level with similiar success?
Smash is offline  
Old July 11, 2001, 09:36   #15
Marquis de Sodaq
King
 
Marquis de Sodaq's Avatar
 
Local Time: 05:21
Local Date: October 31, 2010
Join Date: Jul 2000
Location: ... no, a Marquis.
Posts: 2,179
They should, even tho defenders have a built in advantage. If that phalanx is on any good terrain or fortified, your odds drop quickly. And of course, Murphy's Law tends to find its way into even debugged programs, leaving your invasion thwarted by a defiant warrior.
__________________
The first President of the first Apolyton Democracy Game (CivII, that is)

The gift of speech is given to many,
intelligence to few.
Marquis de Sodaq is offline  
Old July 11, 2001, 12:28   #16
Edward
Warlord
 
Local Time: 06:21
Local Date: October 31, 2010
Join Date: Apr 2000
Posts: 267
Quote:
Originally posted by freshman
On to the real calculation...
Each unit gets a randomly generated number from 0 to its modified value minus one, multiplied by a constant. This constant has been best-guessed (based on play testing) to be 8. The unit with the higher random number wins the combat, ties going to the defender.
This is probably a wording issue (since your chart looks correct), but each unit gets a randomly generated whole number from 0 to ((its modified value multiplied by a constant) minus one). Make sure your program makes a unit's randomly generated number always be a whole number. (The Civ2 programmers abhorred real numbers.) Otherwise ties will be very rare and the defender advantage won't be shown.

Tell me if I'm reading your chart correctly. Does it say that an attacker with a modified attack value of 1 attacking a defender with a modified defense value of 1 has a 29.0% chance of winning? If so, it looks to be right on track. Looking at your chart lets me see (what I already should have known) that a rivered forest makes for better defense than a hill. If you'd like to make your chart even longer, it doesn't look like it includes the settler-made fortress factor (x2 or +100%).
Edward is offline  
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 07:21.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Apolyton Civilization Site | Copyright © The Apolyton Team