How Does Combat/Damage Work?
Posted: 08 Dec 2016, 10:03
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.
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.