Page 1 of 1

How Does Combat/Damage Work?

Posted: 08 Dec 2016, 10:03
by kwok
Someone asked me recently "Does smoke apply to HE shells? Because it doesn't seem like it does."
After explaining it all to him, it made me realize that most people probably don't know how the combat calculations are done at all. So, here is the explanation to the best of my knowledge. Please correct my understanding if I'm wrong.

This is for bullets and ballistics only. Meaning, not flamethrowers, explosives, etc. (whtever else I'm missing). Bullets and ballistics is the majority of weapons including rifles, smgs, tank guns, AT guns, HE shells, etc.

1. Weapon targets another unit and fires. Note: NOT unit targets unit. Units can have modifiers on their weapons, and sometimes weapons can be different from other weapons based on units even though the same models are used (for example a pioneer k98 is actually different from a grenadier k98).

2. Accuracy check: RNG dictates the chance if the projectile hits or does not hit the target. Accuracy modifiers, including received accuracy modifiers, are applied here. Example modifiers: if the target is in cover, if the target is in smoke, if the weapon is fired on the move, if abilities are active, plenty of factors and modifiers. If the accuracy check passes after the projectile is fired and is type "homing" (most are homing), the projectile will hit no matter what. This is why you see "homing bazookas and schrecks" sometimes.

3. If accuracy fails and the unit is ballistic, scatter "check": RNG dictates the direction the projectile will continue to travel to hit something else. Essentially, there is an area that the projectile can land which COULD still be on the target unit. It is random within the pre-defined area. Some weapons have a higher scatter than others. For example, HE shells have a higher scatter than AP, so the chances the HE shell will land farther from the target is higher. This is why it seems like upgraded bazookas are "worse" than regular bazookas. The upped bazookas have the same accuracy but for some reason have an insanely higher scatter. There are scatter modifiers, however I do not know them within BK. I have not come across any from poking around corsix.

4. If the target is hit, armor/target type check: Even inf have "armor" as far as I know, but it is mostly negligible. This determines if the projectile will penetrate or deflect. Both penetration and deflection have their own damage/critical tables. Penetration and armor modifiers are applied here.

5. Damage is applied based on hit type. This includes deflection. Some weapons deal damage on deflect and is normally barely anything. Damage modifiers and received damage are applied here. Damage is subtracted from HP of the hit target. ZERO HP DOES NOT MEAN A UNIT IS DEAD. Death is explained next step.

6. Random criticals are applied. THIS is where it gets confusing for people and is pretty much the heart of CoH that makes it different from every other RTS out there. THIS is where you pray to RNGods (RNG stands for random number generator). All units, including infantry, have criticals that determine its fate. For each hit type, each weapon type, and each target type, there is a critical table (so when you add a new unit you need to make fucking tons of tables to make it work properly or apply existing tables to the new unit. It's a lot of work so think about what you're asking from devs when you ask for new units). The table consists of multiple brackets of health: "green" is high HP, "yellow" is less HP, and "red" is low HP. In each bracket there are different types of criticals. Depending on how much HP is left on the hit unit post damage determines what critical is randomly applied on the table. The criticals have weights, but they are random. So at red, there is a higher chance that the unit will die, but doesn't mean it will absolutely die at "zero" HP. This is why sometimes cars get escape from AT boys with no HP; the weapon itself has "less" chance of killing in the red bracket.

This is also what devs mean by "5% chance of one-shot": in the green bracket, there is a 5% chance of getting death. There's also the concept of "unique criticals" which means the same critical can't be applied twice. Which means, say a tank has the following green bracket:
20-nothing
30-main gun destroyed
20-engine destroyed
25-treads broken
5-death
Let's pretend that this tanked is fucked up and in the middle of repairing so it is in the green bracket almost full HP. It's main gun is damaged, engine is destroyed, treads are broken. If it gets hit again successfully and penetrated, then there is not a 5% chance of it dying but 20% chance of dying even though it's HP is almost full. This a REALLY extreme example and not true in any BK unit and technically the criticals are done in weighted values not percentages so that plays a part mathematically. But, you get the idea that if the vehicle has criticals it increases the relative chances of other criticals including death.

Re: How Does Combat/Damage Work?

Posted: 08 Dec 2016, 10:05
by kwok
Moral of the story, be nice to mod makers in coh because shit is complicated and hard to balance because it's a huge network of factors, numbers, and tables. I haven't even talked about AoE, explosives, etc. Or even other combat values like cooldown, burst vs rate of fire, reload, RANGE brackets, and oh man it just doesn't end.

Re: How Does Combat/Damage Work?

Posted: 08 Dec 2016, 10:11
by JimQwilleran
Very interesting stuff! Now explain arty ;D. Why do direct hits do 0 damage but a shell landing 3 meters from the tank takes 1/3 hp...

Re: How Does Combat/Damage Work?

Posted: 08 Dec 2016, 10:26
by kwok
LOL maybe another night. AoE is another long explanation. But, even if I did explain it might not explain why there are weird situations where there are zero hits. It might because of really small hard to detect problems with tables. Theoretically there shuoldn't be problems BUT it happens when you have probably thousands of tables to keep track of.

CoH2 simplifies this a lot. It's great.

Quick answer to your question:
It's all still RNG. So if the artillery didn't "penetrate" the tank even on a direct hit, it does no damage. But if it managed to "penetrate" 3 meters away, it will take damage. Because remember, damage is post penetration. If it never penetrated and no deflection damage, then there is no damage.

Re: How Does Combat/Damage Work?

Posted: 08 Dec 2016, 13:39
by Warhawks97
Will try to explain with US 105 vs Panther.... Hope i make it right..
As kowk said AoE is complicate and an explosion has also pen values in its AoE.


So lets take a look...

1.US 105 mm howitzer has 100% basic pen at any shooting range.
2. Basic damage is 335
3.In the Target table vs Panther the pen chance for the 105 is 90%. So you might see a direct hit but it wont penetrate and wont deal damage.
5.Panther G has its own 0.9 received penetration modifier. Means the pen chance is 81% even though it looks like a direct hit (sometimes you see the shells bouncing from axis tanks as well).
6. The damage vs Panther is reduced by 0.75 modifier in the guns target table.
7. The 105 has an Area of Effect (AoE) of 10. So it can deal damage in this area. AoE distance classification is as follows: 0-1 Short, 1-3 Medium, 3-7 is long, 7-7 is Distant and as 7-10 is undefined it counts as distant.
8. Basic Pen values in this AoE is as follows: 100% at short: 100% Short (AoE), 90% Mid, 75% Long, 75% Distant.
9. Basic damage modifier within the guns (105 mm howitzer) AoE circle is: 1.5 Short, 0.75 Medium, 0.5 Long, 0.3 Distant


So now i assume a shell hits a Panther at a distance of 2 (AoE circle) which is considered as medium distance (but still looks like a direct hit.

Pen caluclation is as follows:

1 (basic pen) x0.9 (pen in AoE circle medium)x 0.9 (pen vs tp Panther) x 0.9 (Panther G received pen modifier)= 0.729= 72,9% pen chance.

In case it penetrates:

335 (basic damage)x 0.75 (damage in mid AoE circle)x 0.75 (damage vs Panther target table)= 188,4375 damage vs panther when hitting pretty close. panther HP is 800.

When calculating vs inf i would have to calculate also cover tables. But afaik tanks do not gain bonuses from normal cover.

Theoretically there can also be accuracy modifiers that might say "fail although looks like a hit". But the 105 has 100% "accuracy" in its AoE and panther target type dooes not reduce it.


Note also: arty suffers also no accuracy reduction vs smoke cover. So vs units in smoke indirect fire used should work fine.

Hope its understandable.

Also hope devs can confirm that it works like this.

Re: How Does Combat/Damage Work?

Posted: 08 Dec 2016, 15:22
by JimQwilleran
Woooow, hawks that's nice! Lol guys keep going...
What about damage vs structures? What about AA vs planes? What about flamethrowers? What about call ins?
I want the numbersss!

Re: How Does Combat/Damage Work?

Posted: 08 Dec 2016, 16:22
by Jalis
@ JimQwilleran ; in front of such enthusiasm, I suggest you download corsix at try to understand how it work.

@ Warhawks97 Suggestion ; look at US M2A1 105 shooting at a tiger, then Sherman 105, then imagine I decrew an axis lfh18 105, capture it and turn it against the same tiger. Have fun

Re: How Does Combat/Damage Work?

Posted: 08 Dec 2016, 17:56
by JimQwilleran
I downloaded corsix some time ago, even used it to mod a bit, but it's meh xD. I prefer to have someone explain me numbers ^^. Especially that Hawks and Kwok are like missionaries here xD.

Re: How Does Combat/Damage Work?

Posted: 08 Dec 2016, 20:00
by Warhawks97
Jalis wrote:
@ Warhawks97 Suggestion ; look at US M2A1 105 shooting at a tiger, then Sherman 105, then imagine I decrew an axis lfh18 105, capture it and turn it against the same tiger. Have fun


I am aware of many silly things like that. I often seen weaker axis guns that performed better against axis units as stronger allied guns did against axis units. Its like an axis 37 mm has more power than US 76 when fighting axis armor (exaggerated a bit).

some of them got fixed though.

What often bothers me is that axis tanks taking often way less damage (or dont get penetrated by arty) than allis tanks. Pretty much all axis tanks, including mediums like tank IV´s.

Few samples about weird things of arty:

1. US 105 howitzer has 0.75 damage reduction vs Tank IV.
2. Axis 105 howitzer deals full damage vs Pershing.
3. US 105 howitzer can bounce from Panther but not from Tiger.
4. Axis howitzers that are captured deal more damage vs tanks as US (or allied) howitzers.
5. The only allied tank that has reduced damage taken from arty is the churchill MK VII (axis has 0.75 damage modifier vs that target type). Here the US howitzer is a bit more effective as the axis one. But its the only tank.
6. Allied howitzers deal less damage vs M10 and M18 as they do against M36
7. The largest joke: The US 105 sherman has low chances to penetrate Panthers and tigers. Pen vs Tiger is at best 37%. Vs Panther its 51,7%. (its the most expensive 105 arty unit but by faaaaar the worst. Meanwhile a captured axis Howitzer would be a real "Tiger schreck".
8. It seems that axis 105 arty has trouble penetrating fully sandbagged e8 shermans? The pen chance here is 70%? Is that correct? It actually has to.
Edit: 9: CW Priest is so deadly because in its explosion center the penetration is doubled. Thus all axis tanks are being penetrated with a direct hit.

As we talk about arty: I once asked why axis arty has always way more damage against armor as allied one. 99% of the time axis complain about tanks lost to arty while in fact most late axis armor gets killed by a mix counters which together cause the death. At the same time i could see endless times how entire allied tank advances got bombed to dust by walking stuka, hotchkiss or 210 nebler barrages. My personal record was iirc 16 tank kills with a 210 nebler. 21 with high veted priest.

If we would simply get as standard that tanks are a bit more resistant to arty fire by giving to all arty a 0.75 damage reduction against armor (except hellcat and maybe some other open top tanks) we would also see maybe less arty or lets say arty less often as tool to destroy entire tank assaults of larger scales. Imagine alone AA tank and firefly in advance. One walking stuka or double hotchkiss from a middle distance and its all done.

I mean come on, even a Ostwind receives less damage from arty as a Pershing does.

Currently it looks like that when a sherman is hit directly by an 105 shell 335 and penetrated (always the case unless its an 76, e8 sherman):

335x1.5 (damage modifier in explosion in center)=502 damage (636 HP)

Tank IV hit by 105 shell fired by alli gun:

335x1.5x0.75(damage reduction vs this tp)=376 damage (out of 636 HP)


Well. Sorry for that arty part again. But i had to check this hint.

Re: How Does Combat/Damage Work?

Posted: 08 Dec 2016, 20:13
by kwok
Hey Warhawks. I don't think there is an accuracy check on the arty cuz from what I understand it's a barrage action, so only scatter happens.

Mortars I don't 100 understand cuz they take direct attack orders but are non-homing projectiles so I think accuracy doesn't apply either. Maybe the accuracy values for indirect fire is actually modifiers for scatter?

Illa, don't waste time in Corsix and learn coh2 attribute editor haha! It's actually much simpler and cleaner to work in. Makes modding so easy.

Re: How Does Combat/Damage Work?

Posted: 08 Dec 2016, 20:20
by kwok
AA vs planes is the same as direct fire afaik. Just imagine a different set of critical tables from tanks and infantry. The FUN part is scatter still somewhat applies which is hilarious because when AA shoots at a plane it effectively has infinite range and the suppression effect applies to the ground. That's why inf can get suppressed across the map from AA shooting at the sky.

AA is more of a question of los, which markr wrote about.

Re: How Does Combat/Damage Work?

Posted: 08 Dec 2016, 20:36
by Warhawks97
kwok wrote:Hey Warhawks. I don't think there is an accuracy check on the arty cuz from what I understand it's a barrage action, so only scatter happens.

Mortars I don't 100 understand cuz they take direct attack orders but are non-homing projectiles so I think accuracy doesn't apply either. Maybe the accuracy values for indirect fire is actually modifiers for scatter?

Illa, don't waste time in Corsix and learn coh2 attribute editor haha! It's actually much simpler and cleaner to work in. Makes modding so easy.


Ok, for that part. Maybe. Though i could imagine that game says depending on the accuracy modifiers that a shell doesnt hit directly and that scatter just says how far away the shell goes down. But thats also important since its AoE based damage. So low accuracy combined with high scatter might causes only fail arty.... idk for sure. (The Zooks btw are also AoE weapons so yeah... the M6A3C is more shitty as basic one as basic can deal AoE damage still while M6A3C fails too far to do the same due to its scatter).

But check the arty/mortar area effect. There is also accuracy modifier. Lets say a 105 shell explodes at a distance of 5 (long range AoE circle). And lets assume the accuracy modifier is 0.8. That means that the target is within the explosions AoE just the shockwave "misses" the target and thus doesnt affect the target. Not sure if this is what the accuracy modifier in the area effect table does but thats how i understand it. Its weird that i found something like that for walking stuka rockets.


That AoE stuff is really badass shit lol.

Re: How Does Combat/Damage Work?

Posted: 08 Dec 2016, 20:56
by kwok
Technically I think all ballistic weapons, so AP shells, bazookas, etc. are AOE. Otherwise scatter means nothing. So whether the upped bazookas are shit or not depends if you think the pen increases are worth the increased scatter, both regular and non upped bazookas are aoe.
Essentially only bullets are technically not aoe. That is if you don't count suppression as "aoe".

Re: How Does Combat/Damage Work?

Posted: 08 Dec 2016, 21:00
by kwok
Also fun fact, damage roll is done per projectile, not target. So if a shell hits multiple units, like multiple infantry, then damage applied will be the same for all infantry. This is how you get something like all infantry surviving an arty shell if the die roll is low enough. But the damage roll is modified based on distance to the impact, so inner targets will take more damage. This effect is more noticeable from grenades where the difference of distance from impact brackets are more negligible. Like how all inf survive a single grenade that landed perfectly.

Re: How Does Combat/Damage Work?

Posted: 09 Dec 2016, 00:36
by Jalis
Accuracy

Direct fire use accuracy. if it miss scatter is used for wandering projectile.

indirect fire use scatter.

Re: How Does Combat/Damage Work?

Posted: 09 Dec 2016, 02:07
by kwok
That's what I suspected jalis. But what about special cases like mortars? They take attack commands making it somewhat direct fire

Re: How Does Combat/Damage Work?

Posted: 09 Dec 2016, 03:30
by Jalis
Mortars use scatter, both for regular auto attack and barrage attack. Ground attack is an other matter I never look at, simply because my specialisation is compstomp / multicoop. AI dont use ground attack. I can only say ground attack seems not linked to scatter for accuracy.

Off topic 120 mm mortars history. The 120 mm mortar father is the french brandt 120 mm model 1935. Finland had a licence and build the tampella 120 krh /40, and at the same time made mortars for exportation sold as brandt. Tampella had a licence and at the same time was a subcontractor. After France and USSR signed a treay in november 29 th 1932 then may 8 th 1935, french technology was transfered to USSR where the mortar was copied, without licence, but with french agreement. It became the russian 120 mm mortar mod 1938. German copied the russian one for the granatwefer 42.

Of course finnish and russians models were not, french -- copy paste -- each added it is own adaptations, ideas, enhancements.

off topic /off

Re: How Does Combat/Damage Work?

Posted: 14 Apr 2021, 20:03
by Walderschmidt
Bump for info

Wald

Re: How Does Combat/Damage Work?

Posted: 14 Apr 2021, 23:43
by kwok
What info?

Re: How Does Combat/Damage Work?

Posted: 14 Apr 2021, 23:56
by Walderschmidt
kwok wrote:
14 Apr 2021, 23:43
What info?
So it’s easier for people to find this.

Wald