The Calculation of Combat

GhostQ

Warlord
Joined
Jan 9, 2002
Messages
175
Location
Istanbul-Turkey
Sadly Im not posting here how it is calculated. I am asking how it is done. If anyone knows the exact formula for the calculation please reply to this thread with the full formula no matter how complicated it is. I want to know if it is linear or parabolic. Like as in a 15 attack rating unit attacking a 5 defense rated unit(after calculating the def bonuses) is the probability %75/%25 or calculated via some other formulae.
Thanks for the help.
 
The basic combat formula is

A/(A+D)=chance of attacker winning

A is the attack value of the attacking unit.
D is the defense value of the defending unit modified by any fortification or other defensive bonuses.

Terrain bonuses for the defender include being on hills, mountains, forest, jungle, or the attacker having to cross a river on it's way to the defender's tile. Fortification bonuses are provided by towns with walls, cities, metropolises, fortresses, and being 'fortified'.

Each round, one of units wins and does 1 HP of damage on the losing unit. Battle continues until 1 unit is dead or the attacker retreats.
 
From what I can gather the formula is;

Attack chances = Attack# / (Attack# + Defence#)
Defence chances = Defence# / (Attack# + Defence#)

Taking a very simple calculation of Cavalry (6) attacking Musketman (4);

Cavalry - 6 / 10 (6 + 4) = 60%
Musketman - 4 / 10 (6 + 4) = 40%

which means that for each hit point the Cavalry has a 60% chance of winning.

Another example of a Musketman behind walls (50% bonus);

Cavalry - 6 / 12 (6 + {4 + 2}) = 50%
Musketman - (4 + 2) / (6 + {4 + 2}) = 50%

Well this is how it is written up in the manual anyway...
 
Check the Creation -> Utilitys forum here, and there's a whole thread on this subject.


However for those just interested in actually calculating the changes you can use my modified Civilization Calculator, available online here: LWC Civilization Combat Calculator

I also include it (without the small print and graphic) in the LWC Mod, linked in my sig.


Of course some of the default settings are changed to go with the LWC Mod, but you can just change those easily :)
 
Cavalry - 6 / 10 (6 + 4) = 60%
Musketman - 4 / 10 (6 + 4) = 40%
Let me translate to 1-6 cavalry win 7-10 musketman win.
I throw dice, well 5. = cavalry win. musketman lost. musketman lost one hitpoint.

...... me throw dice, got 2. =cavalry win again. musketman lost. musketman lost one hitpoint. . . . .

I musketman died. I take over city. :D

The End
 
Btw, on Cavalry vs. Musketman, everyone seems to forget that all terrain provides at least a +10% bonus. So the Musketman has 4.4 D, with Cavalry having 6 A, resulting in a 64% chance of victory for the attacker.

However if the Musk is fortified he gets +25%, along with +10% minimum on terrain, giving him 5.4 D, giving the Cavalry a 55% chance of victory.

Now if the Musk is fortified, in a City/Walled Town/Fortress which is built on a grassland, it gets +85% defense giving it 7.4 D, leaving the Cavalry with a 40% chance of victory.

If that City was on a Forest it would be only a 36% chance of success, and on a Hill it would be a 31% chance.


But that's only if they both have 3 hitpoints.

In other words, either use a calculator or don't bother trying to figure it out with any degree of certainty :D
 
although cavalry MAY retreat at one hitpoint. heh, i really am getting into this. i wanted to know, who has the most correct formula?
 
Originally posted by Plutarck
If that City was on a Forest it would be only a 36% chance of success, and on a Hill it would be a 31% chance.


Actually, it's impossible to have a city on a forest -- forests (and jungles) are cleared as soon as the settler settles.

As for the actual formula, just look at the source code for any of the many calculators out there. There are both Javascript and Excel calculators out there that all do the same thing.
 
Back
Top Bottom