View Full Version : Odds of winning a fight


Arkalius
Nov 12, 2005, 05:08 PM
I've developed a little Java app that helps me determine the odds of a unit winning a fight in Civ 4 given their modified strength values. This program is based on information I gained on the apolyton civ forums. I've done some testing and determined what the odds are that a given unit will win a fight based on the ratio of the two units' strength values. I figure this can help people out a little.

In the first column is the ratio percentage of the weaker unit's strength to the stronger unit's strength. For example if you're talking about a unit of strength 5.8 vs a unit with strength 8.2, then the ratio would be 5.8/8.2 = .707 or 70.7%. The next column indicates the percent chance that the weaker unit will win the fight. This assumes that BOTH units are at full health, and that there are no first strikes involved. If a unit is at less than full health, it's odds of winning are even less than what it's strength value would indicate. For first strikes... well you can give the unit with first strikes about an 8% bonus to his strength for each first strike... though that is not terribly accurate, as it differs depending on the situation, but it's good enough for approximation. Anyway, here's the chart:


under 52% ... less than 1%
52% - 66% ... 2.3% - 5.3%
67% ... 10%
68% - 80% ... 17.4% - 25%
81% - 95% ... 25.6% - 34.5%
96% - 99% ... 47.4% - 49.3%


Of course, if two units have equal strength, it's a 50/50 shot.

It may seem odd that from 66 to 67 to 68 the numbers jump so much, but that is because of the way the combat works. From 66 to 67, the damage done by the stronger unit has reduced enough that it has to hit the weaker unit 5 times instead of just 4, giving the weaker unit a better chance to win. From 67 to 68, the damge done by the weaker unit has increased enough so that it only has to hit the stronger one 6 times instead of 7 to win, which again increases it's odds of winning. The other jumps you see there are due to similar "hits to win" changes.

Chinese American
Nov 13, 2005, 12:05 AM
is there a way to display this in the combat odds box

Arkalius
Nov 13, 2005, 12:28 AM
No, the game doesn't know the odds like that. It involves a complicated calculation that I put into a java program.

Kylearan
Nov 13, 2005, 03:58 AM
Hi,

see also Arathorn's excellent Combat Explained (http://forums.civfanatics.com/showthread.php?t=137615http://forums.civfanatics.com/showthread.php?t=137615) thread.

-Kylearan

Chinese American
Nov 13, 2005, 05:07 PM
why cant you put this into python as a table or array and have the game show you the odds

Arkalius
Nov 14, 2005, 02:30 AM
Well I suppose you could mod the game to show this... but remember it's incomplete. It assumes both units are at full health and that there are no first strikes involved.

Lord Chambers
Nov 14, 2005, 02:44 AM
So, you gonna share this java app, or just tell us about it? :)

Arkalius
Nov 14, 2005, 03:33 AM
It's a pretty basic command-line affair... I plan on improving it to make it a little better... it's also apparantly got a few bugs I have to work out.