Senshi
2016-01-30, 14:35
Just for those curiously inclined, I'm currently working on another small tool:
Super-early alpha damage calculator (http://tournament.realitymod.com/damagecalc)
Currently it only shows info about materials, so it's not really a damage calculator yet.
A short summary about how PR actually calculates damage (it's logical, but not trivial):
A firearm emits a projectile.
That projectile has the following important parameters:
- raw damage
- material
Said material defines how the projectile reacts when hitting another material.
All soldiers, vehicles, statics, even terrain also have materials assigned (objects can have them assigned per-polygon, meaning it is important where you hit the target). The relation of "offensive" material vs "defensive" material is assigned a damage modifier (among other properties), which is a multiplier applied to the raw damage value of the projectile.
Example:
The Russian AK74M (rurif_ak74m) fires a 545_39_g projectile. This projectile has a raw damage value of 36 hitpoints and has material 3556 assigned.
In the damage calculator, I can now set this material as source material ("3556 pr_bullet_556").
I can then see what target relations are defined for this one (many), and select my target. Usually, you target soldiers, so I filter for "human" in the target list.
This shows me that the following multipliers apply:
23 Bodyarmour: 36 * 1.0 = 36HP
3703 Poor Bodyarmour: 36 * 1.3 = 45.5HP
24 Body: 36 * 1.7 = 61.2HP
25 Head: 36 * 5 = 180HP
77 Limbs: 36 * 1.1 = 39.6HP
All PR soldiers have 100 HP, and will start bleeding 0.2HP/sec at 75HP or less.
Projectiles also can cause splash damage. This follows the same principle: There's a raw "explosionDamage" and "explosionMaterial" assigned. However, for explosions it is NOT relevant where you hit a target: Instead, each object has a "default material" assigned. Explosive damage is always matched against this default material, no matter where the explosion "ball" will hit. For soldiers, this is material 24 (= human_body) in most (all?) cases.
Projectiles also have a "explosionradius" defined. The closer to the limit of the radius the target is, the less damage it takes (this is a linear relation: 25% radius = 75% damage).
The AK does not deal explosive damage. Some big calibers (12+mm, as found in heavy static MGs (e.g. DShK) or autocannons) can.
On a direct hit with an explosive round, BOTH the impact damage and explosive damage is received by the target. Random fact: Hand grenades deal zero damage on impact.
We're not done yet: Projectiles can have an additional modifier that depends on travel distance. This is used in PR for all ballistic projectiles.
The AK74M will start losing damage at 350m, and reach a minimum damage of 40% at 1000m distance. The decrease in damage between those points is also linear. This multiplier can be a severe reduction: a headshot at 1000m deals merely 72HP damage.
Currently, you have to look up the firearm name and projectile information yourself in the game files.
So the logical next step for this tool is to add projectile and gun information, and allow selecting guns/projectiles and target objects. I have all that information present, but sadly it's ~20MB of data. Don't want to force clients to load that via JScript everytime they open the webpage.
So I have to delve into PHP coding, another new topic for me. The expected benefit is that users will not have to download the entire dataset, but will only request the tiny snippet of information they actually need (the server will select and send it).
As I just restrict it to materials right now, Jscript is fine, though it's still ~2MB of data (which explains why it takes a couple of secs to fill the list).
Also, no styling yet. Barebone HTML ftw.
It'll probably take a while until I have this PHP stuff sorted out, hence a barebone release now.
Super-early alpha damage calculator (http://tournament.realitymod.com/damagecalc)
Currently it only shows info about materials, so it's not really a damage calculator yet.
A short summary about how PR actually calculates damage (it's logical, but not trivial):
A firearm emits a projectile.
That projectile has the following important parameters:
- raw damage
- material
Said material defines how the projectile reacts when hitting another material.
All soldiers, vehicles, statics, even terrain also have materials assigned (objects can have them assigned per-polygon, meaning it is important where you hit the target). The relation of "offensive" material vs "defensive" material is assigned a damage modifier (among other properties), which is a multiplier applied to the raw damage value of the projectile.
Example:
The Russian AK74M (rurif_ak74m) fires a 545_39_g projectile. This projectile has a raw damage value of 36 hitpoints and has material 3556 assigned.
In the damage calculator, I can now set this material as source material ("3556 pr_bullet_556").
I can then see what target relations are defined for this one (many), and select my target. Usually, you target soldiers, so I filter for "human" in the target list.
This shows me that the following multipliers apply:
23 Bodyarmour: 36 * 1.0 = 36HP
3703 Poor Bodyarmour: 36 * 1.3 = 45.5HP
24 Body: 36 * 1.7 = 61.2HP
25 Head: 36 * 5 = 180HP
77 Limbs: 36 * 1.1 = 39.6HP
All PR soldiers have 100 HP, and will start bleeding 0.2HP/sec at 75HP or less.
Projectiles also can cause splash damage. This follows the same principle: There's a raw "explosionDamage" and "explosionMaterial" assigned. However, for explosions it is NOT relevant where you hit a target: Instead, each object has a "default material" assigned. Explosive damage is always matched against this default material, no matter where the explosion "ball" will hit. For soldiers, this is material 24 (= human_body) in most (all?) cases.
Projectiles also have a "explosionradius" defined. The closer to the limit of the radius the target is, the less damage it takes (this is a linear relation: 25% radius = 75% damage).
The AK does not deal explosive damage. Some big calibers (12+mm, as found in heavy static MGs (e.g. DShK) or autocannons) can.
On a direct hit with an explosive round, BOTH the impact damage and explosive damage is received by the target. Random fact: Hand grenades deal zero damage on impact.
We're not done yet: Projectiles can have an additional modifier that depends on travel distance. This is used in PR for all ballistic projectiles.
The AK74M will start losing damage at 350m, and reach a minimum damage of 40% at 1000m distance. The decrease in damage between those points is also linear. This multiplier can be a severe reduction: a headshot at 1000m deals merely 72HP damage.
Currently, you have to look up the firearm name and projectile information yourself in the game files.
So the logical next step for this tool is to add projectile and gun information, and allow selecting guns/projectiles and target objects. I have all that information present, but sadly it's ~20MB of data. Don't want to force clients to load that via JScript everytime they open the webpage.
So I have to delve into PHP coding, another new topic for me. The expected benefit is that users will not have to download the entire dataset, but will only request the tiny snippet of information they actually need (the server will select and send it).
As I just restrict it to materials right now, Jscript is fine, though it's still ~2MB of data (which explains why it takes a couple of secs to fill the list).
Also, no styling yet. Barebone HTML ftw.
It'll probably take a while until I have this PHP stuff sorted out, hence a barebone release now.