Resource icon

[vanilla] The Mechanics of Combat (vanilla)

You can always bombard over flatland.
You can bombard over hills or forest if you are on a hill.
You can never bombard over forested hills or mountains.

You can bombard over anything if you have Indirect Fire and a unit spotting for you.

this is true. But there is a bug with the ranged targeting system. Sometimes (mainly when you have the range promotion) the hexes available for bombarding are not the right ones. I've seen open terrain/river block me from shooting at a unit 3 tiles away. I've also seen the ability to shoot past hills (rare) even when standing on flat terrain.
 
I'm confused by promotions for terrain.

Am I right that if you are attacking, it is the terrain the enemy unit is on that applies and if you are defending it is the terrain of your tile that applies?

So if I have a promotion that gives me +20% on open terrain, it will apply if I am attacking a unit that sits on open terrain, regardless of the terrain of my tile?

And it will not apply if I am being attacked and am not sitting on an open terrain tile, even if the attacker is?
 
I'm confused by promotions for terrain.

Am I right that if you are attacking, it is the terrain the enemy unit is on that applies and if you are defending it is the terrain of your tile that applies?

So if I have a promotion that gives me +20% on open terrain, it will apply if I am attacking a unit that sits on open terrain, regardless of the terrain of my tile?

And it will not apply if I am being attacked and am not sitting on an open terrain tile, even if the attacker is?

yes. Though sitting in rough terrain gives you a defensive bonus anyways, so it's usually the safer place to be (until you get open terrain 2 or 3).
 
Using formulas from above I tried to imagine a fight between a Caravel and a submarine. Caravels attack sub. How many of them do we need to sink a submarine?

CARAVEL
Combat: 15 melee, 7 ranged

SUBMARINE
Combat: 25 melee, 60 ranged

Our caravel is highly promoted (targeting III, Logistic)

Attack strength: 7 * 1.6 (via Targeting III) = 11.2
Defence strength: 25 * 0.4 (via naval defense penalty) = 10.0

Damage:
r = 11.2/10.0 = 1.12
m = 0.5 + (1.12 + 3) ^ 4 / 512 = 1.0628
min damage to weaker party = 4 * m = 4 * 1.0628 = 4.3
min damage to stronger party = 4 / m = NA (no back damage - ranged attack)
mean damage = min damage * 3 / 2 - 0.5 = 5.9
max damage = floor( min * 2 ) = 8.0

Can 1 caravel with targeting III and logistic promotions sink a normal submarine with 1 turn?

Start of Renaissance Era (Astronomy) can beat end of Industrial era (Refrigeration)?

(Presuming I have a destroyer /or air recon that can see a sub)/
 
Why on the screen approx damage inflicted is 5? Why not 7 or 8?
What did I miss in formulas?

for ranged attacks
The combat formula uses the same modified ratio as above, but the base minimum damage that gets modified is 2 instead of 4, though the base spread remains 4.

the formula listed applies only to melee as it is. it also uses some shortcuts as base min damage and base spread are the same for melee and are both 4
precisely the formula in general is
min = base min damage for domain * or / modified ratio
spread = base spread for domain * or / modified ratio
mean damage = min + spread / 2 - 0.5
max damage = floor( min + spread )

for the destroyer vs destroyer example, this cuts the min damage in half (from 5.4 to 2.7), makes the mean 4.9, and max 8
 
Precisely, the formula works out as follows for melee combat:

r = max combatant's CS / min combatant's CS
m = 0.5 + ( r+3 )^4 / 512
min damage to weaker party = 4 * m
min damage to stronger party = 4 / m
mean damage = min damage * 3 / 2 - 0.5
max damage = floor( min * 2 )
actual damage = max( floor( min damage + random( 0, min damage ) ), 1 )

The above reads a bit confusingly. I think it would read better if you defined:

damage variation = max damage - min damage

actual damage = max( floor ( min damage + random (0, damage variation))), 1)

This formula is true even if max damage were not min * 2.

---

Great article, thanks!
 
The above reads a bit confusingly...

as you quoted, the formula was correct for melee combat - that's all it claimed.

i've modified it to a general form, though i'm not convinced it's any clearer this way. comprehensive reading is required either way =d
 
for ranged attacks

max damage = floor( min + spread )

for the destroyer vs destroyer example, this cuts the min damage in half (from 5.4 to 2.7), makes the mean 4.9, and max 8

floor(2.7 + 4) = 6. Why 8?

May I take this as basis:
r = max combatant's CS / min combatant's CS
m = 0.5 + ( r+3 )^4 / 512

Melee to melee:
min damage to weaker party = 4 * m
min damage to stronger party = 4 / m
mean damage = min damage * 3 / 2 - 0.5
max damage = floor( min * 2 )

Range to melee:
min = 2 * m
mean damage = min + 4 / 2 - 0.5
max damage = floor( min + 4)

I just want to enter all formulas in excel to have a some sort of base information about possible damage for needed units.

(range to range have the same formula for damage, but difference in strength calculation (1.25x strength multiplier))
 
the base spread of 4 has the modified ratio applied, just like min damage, so it ends up being 5.4 for that example. 2.7 + 5.4 = 8.1, floored is 8. since it's barely above 8, the max of 8 damage will happen rarely, precisely 0.1 / 5.4 percent of the time, or slightly less than 2% of the time.

i've attached a zipped simple spreadsheet with the formulas for melee and ranged plugged in; it should just require entering the two unit strengths as they'll be for combat.
 

Attachments

  • civ5DamageCalc.zip
    1.9 KB · Views: 286
i've attached a zipped simple spreadsheet with the formulas for melee and ranged plugged in; it should just require entering the two unit strengths as they'll be for combat.

No formulas, just values.
Opening with Excel.
 
sorry, i didn't realize excel couldn't translate ods formulas by default (which seems ridiculous).
i changed the upload to a converted .xls

Thanks!

But it seems that "Ranged to Weaker" means how much damage will do weaker ranged (naval or land unit) to a stronger target. And "Ranged to Stronger" means damage will be done unit with higher strength to a unit with lower strength.

For e.g. Destroyer vs Destroyer: 35.2/22.4. Attack stronger then defence so damage will be from "Ranged to Stronger" min 2.7, spread 5.4, max 8.0, mean 4.9
But when frigate (no promotions) attack destroyer (targeting III): 15 / 22.4, damage will be from "Ranged to Weaker" min 1.5, spread 3.1, max 4.0, mean 2.6.
Am I right? Or all the time I should use "Ranged to Stronger"?? That in case frigate vs destroyer (targ III) give min 2.6, spread 5.2, max 7.0, mean 4.7
 
if the offense strength is greater than the defense strength, the larger values apply.
your listed values seem correct.
 
Great article, though the formulae remain a bit... vexing. (They could be clarified perhaps by centering each part in-line in the article and giving a short description on what each portion means, building toward the final damage formula.)

What my wife and I really liked was the title graphic, decisive spearman vs tank victory, truly inspired illustration, sir.
 
@vexing

I Think in the excel file you have uploaded, you have interchanged "ranged to weaker" and "ranged to stronger" heads, or am I wrong or missing something?
 
@vexing

I Think in the excel file you have uploaded, you have interchanged "ranged to weaker" and "ranged to stronger" heads, or am I wrong or missing something?

you're correct.
if offense > defense, the larger values apply
 
I was under the impression cities had 20 hp, not 25. Are you sure about this?
 
Ah. I actually went back into the game and watched damage pile up. It looks like the half health point is 12 hp, so yeah.

Do you know how much it heals per turn? I've seen 2 hp, I've seen 3 hp, and I think I've even seen 4 hp.
 
i believe it's 2 base, and each defense structure provides +1 (including palace, so capital starts at 3)
 
Top Bottom