Mechanics question: ranged strength vs melee strength

elprofesor

Pluri-editing poster
Joined
Oct 28, 2010
Messages
773
Location
(hint: I can type "Ñ")
Does 6 ranged strength mean the same as 6 melee strength?

That is, if I attack a warrior with another warrior, will he lose (statistically) the same hp as if I attacked him with an archer, proms aside?

Same for air units: does a bomber cause as much damage attacking a unit as a panzer?
 
I don't know, but I'm hoping someone can explain the full mechanics of battle.
In my experience ranged attack does less damage than melee.
 
That's what I think too, but I'd like to know how much less.

EDIT: so, nearly 500 views, and nobody knows? I'd like to know the feasibility of an archer/charriot archer rush, compared to a pure warrior rush (which comes slightly earlier), as the numbers shown seem to make it easier than it is (I've tried with Incan slingers and Babilonian bowmen, which both have a ranged strength of 6 against cities, and needed 3 archers and 2 warriors to take an 11 strength city, compared to 5-6 warriors, which come sooner both for tech and cost reasons)
 
Very simple testing proves that the damage output of range is less than that of melee for the same ranged str vs melee strength. A slinger and a warrior each without any offensive promotion show as 6str to attack an ennemy warrior. The warrior dmg output is expected to be of 5, the slinger dmg output is expected to be of 3.

The difference though is that range attacks with no dmg intake whereas it's not so true for a warrior rush. An additionnal reason why ranged are worse against cities is because they have a 25% malus to attacking cities (excepted slingers which is why your babylonian bowman's 8str-25% had the same 6str output to cities than that of a slinger).


I can't provide the exact calculation of range "dmg dealt" as a proportion of equivalent melee strength dmg dealt but it's definitely lower. Same happens with how cities deal awful dmg compared to any ranged unit with equivalent ranged strength.

I'm positive they gave significant bonuses to melee (or malus to ranged) combat because of the opportunity cost of not losing any health while attacking from range. Hopefully someone has an answer within the LUA files for precise numbers for you.
 
If I wasn't in the middle of final exams, and someone told me how to access the LUA files, then I would be willing to do the search myself, but right now, I can't. If someone has/can, I would really appreciate an answer.

I'm quite sure the ranged attack strength is actually lower than what it is shown too (for balance purposes, because of the reason you've put forward), that's why trirremes suck too against non naval units.

Thanks for your time anyway Deau :)
 
Does 6 ranged strength mean the same as 6 melee strength?

That is, if I attack a warrior with another warrior, will he lose (statistically) the same hp as if I attacked him with an archer, proms aside?

Same for air units: does a bomber cause as much damage attacking a unit as a panzer?

Yes. Strength is calculated the same way. It is not uncommon for an artillery piece or even a cannon to one-shot a pikeman, for example.

The reason why ranged units seem to be weaker than their melee counterparts is because they indeed are. An archer is str 6 compared to its target, the 11 str swordsman. Similarily a 12 str crossbowman will most likely be up against 18 str longswords.
 
that's not true.
as was pointed out earlier, 6 ranged strength archer will always do less bombard damage than a 6 strength warrior attacking.

i may attempt to figure out a precise formula for results based on combat strength, but for now i can tell you things generally fall in a +1.5/-1.5 range around the displayed odds in a normal distribution (ie bell shaped curve), however the displayed is always rounded.

for example it might say 3 expected damage, and it ends up like this:
2: 9%
3: 53%
4: 35%
5: 3%

the real expected damage is 3.3.
 
Yeah I scouted the XML files after seeing how Vexing had pulled the infos w/ Immortal and Deity AI initial bonuses hoping there would be something similar to resolve combat calculations but couldn't find anything.

I guess it would be possible to extrapolate close to exact data given the hidden functions are somewhat common functions (and quite frankly programmers usually try to avoid such as it tends to lead to outrageous calculations to balance any tweaks to the game, also becasue it blows for moders in a game encouraging players to create mods) through statistical analysis but I would much, much prefer to read the whole game code of combat resolve system than having to pursue that

We'll see, if I'm still enjoying the game as much once Hotseat lands in the next patch I might give it a shot. Up until then, there's no way I'm reloading a game w new random seed thousands of times to come up w very little infos. Atm, I'm satisfied with "melee deal more dmg to compensate the opportunity cost of losing health when attacking"
 
you can set up things with world builder/firetuner to do tests more simply than you're describing.

given the game provides its calculated odds and they always follow the pattern i described, finding a general combat formula won't be too hard.
 
you can set up things with world builder/firetuner to do tests more simply than you're describing.

given the game provides its calculated odds and they always follow the pattern i described, finding a general combat formula won't be too hard.

Can you make a "world builder for dummies" thread?

I tried it once and failed hard.
 
that's not true.
as was pointed out earlier, 6 ranged strength archer will always do less bombard damage than a 6 strength warrior attacking.

Maybe math will prove otherwise, but from my experience archers kill warriors as fast as warriors do. Just take the so common early archer from scout upgrade. You kill a barbarian in open terrain in two shots.
 
Maybe math will prove otherwise, but from my experience archers kill warriors as fast as warriors do. Just take the so common early archer from scout upgrade. You kill a barbarian in open terrain in two shots.

just look at expected damage. they're completely different.
 
here's a set up game for viewing expected combat results. all units are available, opposing units are in open terrain with discipline (so they have +10% -10%, ie no penalty).

some expected results comparing ranged to melee
keshik (13 str)

str - expected dmg
6 7
7 6
8 5
9 5
10 4
11 4
12 4
13 3
16 3
18 3
20 3
22 2
25 2
32 1

legion (13 str)

str - expected dmg

6 10
7 9
8 8
9 7
10 6
11 6
12 6
13 5
16 5
18 4
20 4
22 4
25 3
32 2
36 2
40 1

just glancing at those numbers it looks like maybe a 1/3rd less dmg for ranged
 

Attachments

  • all units vs.Civ5Save
    298.2 KB · Views: 86
here's a set up game for viewing expected combat results. all units are available, opposing units are in open terrain with discipline (so they have +10% -10%, ie no penalty).

some expected results comparing ranged to melee
keshik (13 str)

str - expected dmg
6 7
7 6
8 5
9 5
10 4
11 4
12 4
13 3
16 3
18 3
20 3
22 2
25 2
32 1

legion (13 str)

str - expected dmg

6 10
7 9
8 8
9 7
10 6
11 6
12 6
13 5
16 5
18 4
20 4
22 4
25 3
32 2
36 2
40 1

just glancing at those numbers it looks like maybe a 1/3rd less dmg for ranged

:goodjob:

Nice to finally have an answer to that question. Would have been even nicer if you wouldn't have had to dig for it, or if 1 ranged strength was the same strength as 1 melee strength. But oh well. Well done!
 
Oh, that really must have taken some time!
Thanks Vexing!
When I'll have time for myself again, I'll try to go deeper.

But if you want a mathematical model, I can get you this with the data provided by Vexing; if we consider a "Damage = K * AttStrength / DefStrength" model, then I get either:
- K(ranged)= 4.2 and K(melee)=6.6 if ignoring the 1 damage results (roughly ranged = 2/3 melee)
- K(ranged) = 3 and K(melee) = 4.1 if taking into account the first 1 damage scenario (so roughly ranged = 3/4 melee

I'd be more willing to believe the first numbers than the latter, because of the rounding problem: the higher n, the less 1/n suffers from precision problems.

I've gotten these results with my graphic calculator, because I'm utterly incapable of using the "new" version of Excel, so I couldn't test different (AKA more intrincate) models, and specifically, test if there is a constant added to damage ( "damage = K*(AttStrength+A)/(DefStrength+B) + C" and the likes, or an exponential formula, or whatever).
 
i believe those numbers are all floored, and 2/3rds seems right.
for example any even strength attack seems to lead to a mean of 5.5 damage (i suspect exactly) to both parties, and the game lists the expected damage as 5,
doing a quick 40 samples of even strength ranged attacks got a mean of 3.6 (listed is 3)
5.5 * 2/3 = 3.66
 
They most certainly are, which makes finding the real damage formula too difficult (2 variables, and a final flooring), so I don't think we will find it searching the files. We can try to find the ratio between ranged and melee though.

On the other hand, it seems (theoretically) more probable that the results are "ceiled", since the minimum damage is always 1. However, I can't argue with the facts you've given, which strongly support your hipothesis.

In the end, if the 2/3 hypothesis is true, it's kind of harsh for crossbowmen: 8 real strength against 18 strength longswordmen! The heavy infantry really reigns supreme in its era.
 
The min damage of 1 was added by a patch post release. Before then it was common to see 0 damage when the opposing unit was completely outclassed. I think all that happened is they added logic that if the formula yielded 0, it was forced up to 1 rather than change from floor to ceiling.

Without the maths, things basically amount to:

Ranged unit caught in the order that gets attacked by a healthy Melee unit = Dead ranged unit. Melee unit in fact likely to only get the minimum 1 damage.

Where ranged units sometimes get an upper hand is when enough ranged units are brought in such that all of them kill the melee unit before it gets a chance to respond for no damage at all to these ranged units.

But the place where Crossbows shine is when behind a city especially with the policy under Tradition that doubles combat ranged strength of city:

1. City bombards enemy unit at double ranged strength from having a garrison.
2. The crossbow that's garrisoning then wakes up and fires at the same already damaged unit from behind the safety of the city walls.

An additional advantage that range units have comes into play much later. All ranged units retain the city attack bonus when promoted into melee units (Rifles that started as Crossbows, Calvary that started as Horse Archers)
 
Keshiks and Camel Archers are actually counterproductive in that way, jon, in that they are both a ranged upgrade instead of a melee upgrade. So you get either Melee (Horsemen) > Ranged UU > Melee (Cavalry) or Ranged (Chariot Archer) > Ranged UU > Melee (Cavalry). Either way you have to waste at least 1 promotion, the earliest good cross melee/ranged promotion is City Raider, and you only get that after Accuracy/Bombardment I. Same goes for the English Longbowmen actually, their +1 Range would be SUCH a good toss-back if Riflemen could get ahold of that...oh well.

TLDR: Ranged Units lose promotions, making Ranged over Melee UUs overall negative in the long term.
 
Top Bottom