Combat Formula

BomberEscort

Don't be alarmed; this is a kindness
Supporter
Joined
Jul 28, 2003
Messages
1,138
Location
Kansas City
I did a search and couldn't find this so I will post it here for anyone who is interested...

Combat Calculation Formula

This formula will give you the probability of the attacker winning the battle with a certain number of HP remaining...

{[(A/(A+D))^dhp] * [(1 - A/(A+D))^hpl]} * [n!/(hpl! * (n-hpl)!)]

A = Attacker Strength + All Applicable Bonuses (i.e.- Radar Tower)
D = Defender Strength + All Applicable Bonuses
hpl = Hit Points the Attacker Loses [<= (Attackers Total HP -1)]
dhp = Defenders Total Hit Points (e.g. 3 for a Regular unit)
n = [(dhp - 1) + hpl]

Example: What is the probability that a veteran Tank will defeat an unfortified/unfortressed elite Spearman in Grassland, with 2HP remaining for the veteran Tank?

A = 16, D = 2.2, hpl = 2, dhp = 5, n = 6

11.5%
 
I'd don't have internet access at home though... :( I was looking for something like CivLackey's utility, but updated for PTW, and stand-alone.

I'll just have to write my own... :devil2:
 
You might want to compare your figures with the online calculator, BomberEscort. It shows an 84% chance of the tank winning under the circumstances you set up.
 
Originally posted by wilbill
You might want to compare your figures with the online calculator, BomberEscort. It shows an 84% chance of the tank winning under the circumstances you set up.

I wasn't testing the chances of the tank winning, I was testing the chances of the tank winning and having 2 HP left... I just wanted to post the formula for calculating the various conditions in case someone wants to design a stand-alone calculator for PTW and/or Conquests... I'm working on one for myself that includes all the PTW stuff (e.g. Radar Towers in the calculations)
 
Your formula is not 100% correct. You are including cases where the attacker eliminates all defender HP early, but continues fighting (against whom?) until he looses the required HP anyway. :)
 
Originally posted by alexman
Your formula is not 100% correct. You are including cases where the attacker eliminates all defender HP early, but continues fighting (against whom?) until he looses the required HP anyway. :)

If I understand your statement, I don't think so... Could you post an example.

The above example is ONLY for a Tank that loses 2 HP in defeating a spearman with 5 HP. There are 15 ways this can happen. When the battle ends the calculation stops

There is a 98.9% chance the tank will win the battle...

Of those victories...

52.5% Tank takes no damage
31.7% Tank takes 1 HP damage
11.5% Tank takes 2 HP damage
3.2% Tank takes 3 HP damage

In all the above cases the 5 HP spearman is destoyed. The percentages above are just the likelyhood of the Tanks HP remaining after his victory... If the tank wins, one of these outcomes will happen...
 
Originally posted by wilbill
You might want to compare your figures with the online calculator, BomberEscort. It shows an 84% chance of the tank winning under the circumstances you set up.

I got 98.9% when I used the online calculator in joycem10's post... same as what the formula at the beginning of this thread states...
 
Sorry, I misread your formula, which is actually correct. :goodjob:

(My comment would have been relevant only if you had n=dhp+hpl)
 
In my continuing quest to understand the details of the Civilization combat statistics I have posted the formula to calculate Bombard statistics. It is handled differently than normal combat since it is for a limited amount of rounds (equal to the ROF) and not neccesarily to the death. The formula is below for all who are interested...

{[ A / (A + D)]^Dhpl} *
{[1 - (A / (A + D))]^(ROF - Dhpl)} *
{ ROF! / [Dhpl!*(ROF - Dhpl)!]}


Where:
A - Bombard Value of Attacker
D- Defensive value of Defender after all applicable bonuses
ROF- Rate of Fire of the Attacker
Dhpl- Hit points the defender loses (always <= ROF)

To my knowledge the online combat calculators do not calculate bombarding damage or probabilities...
 
BomberEscort - I recently modified TF's CombatCalc to allow your own figures in the attack/defense/terrain bonus fields (this allows it to be used for PTW and mods).

You can access it online here.

More importantly, you can download it by right-clicking the link as selecting 'Save Target As' - this will then work offline, by running it directly form your harddrive.

You can also modify it to calculate bombards (it seems you have the required maths ;)) - if you get around to this please let me know so I can update my online copy. :thumbsup:
 
anarres, a small bug in the calculator you modified: I believe you don't get a bonus when defending against barbs.
[Edit: note to self: don't ever question anarres again!]

BomberEscort, a formula usually includes an equals sign. :)
 
Originally posted by anarres
...You can also modify it to calculate bombards (it seems you have the required maths...

I'd love to, but I don't have the required programming skills... I am including these formulas for any who want to program a stand alone program (like CivLackey's). I am currently working on an Excell spreadsheet with all of this information on it. Should be finished in about a week...
 
Originally posted by alexman
anarres, a small bug in the calculator you modified: I believe you don't get a bonus when defending against barbs.

Yes you do, depending on the level. The higher the level, the less the bonus, and no bonus on Deity.;)
 
Gotta disagree. You get a bonus fighting barbs, hence poppin out 3 with a warrior & getting promoted to elite everytime on lower levels.
 
Gotta agree. I just tested it, and the barb bonus applies on defense as well. Ignore my silly comment above. :)
 
Back
Top Bottom