combat result: 95% win

smalltalk

monkey business
Joined
Jan 6, 2003
Messages
1,140
Location
personality zoo
This is one for the math geeks.

There has been a lot of discussion on the random number generator and combat results. There are tools to determine the outcome of a given battle situation. Result is something like:
warrior vs. warrior = 50 %, if everything else being equal.

Now I'd like to ask the reverse question: Given a certain number of defenders, how many units do I have to bring, to win with a certain confidence, say 95%?

I do know this calculation is possible, unfortunately my math is improbable. The solution has got to do with confidence intervalls and the outcome won't be an integer number.

I guess, by intuition, we are all using estimates like this. Say I want to take a town with three defenders, then I bring, well, about 8 attackers to have an almost certain win.

Also, I am aware, that 95% confidence means, that 1 out of 20 players will claim, this is all bullsh*t; so please no tales about heroic spearmen. Go to the Conan thread instead.
 
Uh, this one is really for math geeks only. Too many variables are involved, and too many assumptions have be made...
 
I'm a firm supporter of quick and dirty. Physics couldn't even calculate free fall in air, if there weren't made some simplifications.
 
You want it quick and dirty, and a 95% confidence at the same time? :confused:

Don't expect anything easy that gives you exact results, and you do know that those heroic spearmen exist. :D
 
Well, as a proposal, one might only consider one type of unit on attack side and one as defender.

(oh my! farewell to combined arms! Maybe you're right, morkaphi:
> too many assumptions have to be made... )
 
u do realise that there are defence bonuses? +50 in a hill or +75 in a large city (my numbers are incorrect)
those heroic spearman do exist, ive seen them kill my tanks once or twice, if you put a numidian mercenary to defencd a fortified mountain, across a river, it will take u quite a number of units to kill it.

this can also be historically possible, 300 spartans stoping 10,000 persians etc etc
 
Disclaimer: I'm majoring in Computer Science, not Statistics. ;)

The problem would be a lot easier if units didn't have hitpoints. An archer attacking a regular spearman produces 4 different results: archer wins, spearman wins with 1, 2, or 3 hitpoints left. This creates 4^n complexity to obtain an accurate result.

When you factor in promotions and blitz ability the computation becomes even worse. For a large number of defenders it is more efficient to run 1000 simulated invasions than to crunch through the complete probability tree.

Edit: On further thought, a breadth first search would be much more efficient. Maybe enough to implement a calculator.
 
A simple approximation is to have an eight hitpoint Swordsman attack a four hitpoint Spearman. This can be calculated with a standard Civ3 Calculator as a 95% chance of victory on open terrain. That means it takes about two Swordsmen for a reasonable assurance of victory. To achieve a 95% assurance against the same Spearman, but fortified in a walled hill town, you would need an 14 hitpoint Swordsman (or about 3 1/2 standard Swordsmen).

Actual combat can be much more complex, but it gives you a basic working ratio.
 
Zachriel, your method works fine for one defender. But with 2 defenders, you need 97.5% probability of killing both to win the entire assault 95% of the time.
 
Originally posted by DaveMcW
Zachriel, your method works fine for one defender. But with 2 defenders, you need 97.5% probability of killing both to win the entire assault 95% of the time.

For multiple defenders, you need a higher assurance for each defender, but with an interesting result. For X defenders, you will need 95%^(1/X) assurance for each defender, or

Def %
1 - 95.00
2 - 97.47
3 - 98.30
4 - 98.73
5 - 98.98
6 - 99.15

It takes a 10 hitpoint Swordsman to take out a 4 hitpoint Spearman with a relibility of 98.76%. So it takes approximately ten Swordsmen to take out four Spearman with 95% reliability, a ratio of 2.5 to 1. The ratio increases to 3.5 to 1 for the fortified Spearmen in a walled town [on grassland].

There are many other factors, of course. This is not meant as a complete analytic solution. Nor does this result indicate how many of your Swordsmen are likely to survive to enjoy the victory.

Edited for consistency; grassland instead of hill
 
Unfortunately, I don't think that calculation works in practice. Suppose we want to kill 100 spearmen, and we have infinite swordmen, which win 67% of the time.

Round 1: 100 swordmen vs. 100 spearmen --> 67 spearmen killed
Round 2: 33 swordmen vs. 33 spearmen --> 22 spearmen killed
Round 3: 11 swordmen vs. 11 spearmen --> 7 spearmen killed
Round 4: 4 swordmen vs. 4 spearmen --> 3 spearmen killed

We are appproaching a limit of 150 swordmen used, or 1.5 to 1. But the real limit is even smaller, because most spearmen start off injured in the later rounds.


Your formula gives the ratio as:

Spearmen - SwordmenRatio
1 - 2 to 1
2 - 2.25 to 1
3 - 2.35 to 1
4 - 2.5 to 1
5 - 2.6 to 1
6 - 2.7 to 1
...
100 - 5 to 1

The ratio should decrease below 1.5, not increase without bound!
 
.. Dont forget promotions :)

However I think its all boils down to this. Build the biggest stack of swordsmen you can and ram them all into Paris.. and hope :)
 
Yeah, promotions is a BIG pain in the ass when attacking cities. It can easily take three dead Swordsmen to get a full strength regular spearman to 3-strength elite spearman. ;)
 
Promotions can really change a battle. A city with one spearman and walls can be a real pain in the ass if the spearman gets promtoted to elite. You will need a lot of swordsmen for that city unless you are lucky (i dont build baracks before modern times so they are weak :( ).
 
[GoD]Toxic, your lack of barracks speaks volumes as to why you lose so many battles.

Check out some numbers in the combatcalc, varying HP's from 3 to 4, you will be suprised at the difference it makes!
 
Originally posted by Angmar
.. Dont forget promotions :)

However I think its all boils down to this. Build the biggest stack of swordsmen you can and ram them all into Paris.. and hope :)

Promotions, training, retreat, healing, terrain, order of attack, combined-arms, bombardment, . . . .

After reflection, I think you'll find my thumbnail formula acts as an upper bound, i.e. a conservative result. Total available hitpoints are very critical, which tends to compress the results into the narrow range of 2-1 to about 4-1 for the previously considered units and terrain.

And yes, build a BIG stack and hope for the best. Rarely do you know the exact number of defenders until after the battle.

:king:
 
While calculating the exact probabilities might be hard, it's actually quite easy to code a "battle simulator" for a particular case:

Definitions:
Win: all defenders are killed in the first turn.
Lose: at least one defender survives the first turn.

(Sensible because if the defending city has barracks you better take the city in the first turn. :) )

I ignored promotions because I don't remember the probabilities... if someone tells me I can do a recalc, though.

Battle case: X veteran swordmen attack a walled town / city located on grassland guarded by Y fortified veteran spearmen.

Each case was run 10,000 times and the results show many times out of 10,000 the attacking swordmen captured the city in the first turn.

Code:
Spearmen:   1       2       3       4       5
Swordmen:
   1       3537       0       0       0       0
   2       7778    1274       0       0       0
   3       9456    4345     442       0       0
   4       9878    7258    2112     153       0
   5       9972    8949    4545     941      51
   6       9995    9689    6984    2588     366
   7      10000    9903    8649    4759    1293
   8      10000    9978    9466    6734    2949
   9      10000    9992    9816    8395    4951
  10      10000    9997    9946    9249    6710
 
I ignored promotions because I don't remember the probabilities... if someone tells me I can do a recalc, though.

The promotion probabilities were in the FAQ... :blush:

(Non-militaristic: veteran->elite 1/8. But: surviving a second attack in the same turn gives an automatic promotion.)

Ok, same scenario, now with defenders having a chance to get promoted:

Code:
Spearmen:   1       2       3       4       5
Swordmen:
   1       3564       0       0       0       0
   2       7560    1228       0       0       0
   3       9008    4202     443       0       0
   4       9769    6903    1953     183       0
   5       9943    8459    4340     886      54
   6       9992    9400    6462    2495     394
   7       9999    9764    8100    4350    1243
   8      10000    9926    9024    6203    2618
   9      10000    9973    9585    7699    4464
  10      10000    9996    9837    8796    6235
 
Originally posted by DaveMcW
Unfortunately, I don't think that calculation works in practice. Suppose we want to kill 100 spearmen, and we have infinite swordmen, which win 67% of the time.

Round 1: 100 swordmen vs. 100 spearmen --> 67 spearmen killed

Wouldn't that be the average number killed, not necessarily an assured number? In any case, . . .

We are appproaching a limit of 150 swordmen used, or 1.5 to 1. But the real limit is even smaller, because most spearmen start off injured in the later rounds.
That is why the thumbnail would be a conservative number, and not meant to be an exact figure, especially for very large numbers of defenders. Please just disregard my numbers. It was only meant to be suggestive. :)

Looking at Pembroke's study, it appears the ratio is close to 3-1, though he didn't extend his chart up to 95% with larger numbers of defenders. Pembroke? May we have some more please? :)
 
This run took 55 min...

Of course, the algorithm is using brute force. :)

Code:
Spearmen:   1       2       3       4       5       6
Swordmen:
   1       3505       0       0       0       0       0
   2       7592    1198       0       0       0       0
   3       9045    4060     419       0       0       0
   4       9763    6777    2007     176       0       0
   5       9946    8484    4270     885      68       0
   6       9986    9405    6406    2422     376      22
   7       9996    9817    8091    4347    1175     160
   8      10000    9940    9077    6285    2685     602
   9      10000    9974    9580    7653    4319    1522
  10      10000    9996    9816    8807    6047    2885
  11      10000    9998    9938    9431    7552    4370
  12      10000   10000    9986    9728    8480    5953
  13      10000   10000    9997    9897    9200    7326
  14      10000   10000    9999    9960    9589    8361
  15      10000   10000    9999    9976    9810    9012
  16      10000   10000   10000    9992    9924    9490
  17      10000   10000   10000    9997    9967    9749
  18      10000   10000   10000    9999    9991    9886
  19      10000   10000   10000   10000    9995    9937
  20      10000   10000   10000   10000    9999    9976
 
Top Bottom