Search In
• More options...
Find results that contain...
Find results in...

Damage Equation?

Recommended Posts

Yeah me again. I'm working on a top-down shooter that uses the Doom(well Hexen) map format along with the FreeDoom textures. Basically the game should play very similar to Doom and I was wondering if anybody knew how to calculate the amount of health and armor to deduct after an attack, or where it is in the source code? I understand that even the same attacks do a variable amount of damage, but what is done with the final result?

Thank you for any help.

Projectiles do a base amount of damage multiplied a random number between 1 and 8
Ranged hitscans do a base amount of damage multiplied by a random number between 1 and 3
Melee hitscans do a base amount of damage multiplied by a random number between 1 and 10

Yeah I understand that each attack has a range. But I need to know the amount of health to deduct after that number has been choosen and what affect armor has.

Green armour takes 1/3 of the damage dealt to it while it's in working condition. For example, if you got hit by an attack that normally did 9 damage, you'd would lose 6 health and 3 armour.

Blue armour is a similar story but the damage is split 50/50

Thanks, that's what I was looking for.

Fist
Damage: 2-20 (2*(rand%10+1); 11 average)
Cooldown: 0.49" (17) held, 0.69" (22) unheld
Time to hit: 0.11" (4)
Damage type: hitscan, changes player angle, 64-units rang
Accuracy: first fire 100%, subsequent fires 5-degree fan spread

Chainsaw
Damage: 2-20 (punch)
Cooldown: 0.11" (4) held or unheld
Time to hit: 0
Damage type: hitscan, changes player angle, thrusts ahead, 65-unit range
Accuracy: first two are 100% accurate, subsequents are 5-degrees inaccurate

Pistol
Damage: 5-15 (5*(rand%3+1); 10 average)
Cooldown: 0.4" (14)
Time to hit: 0.11" (4)
Damage type: hitscan, I'm uninformed on range but it is limited
Accuracy: first fire 100%, subsequent fires 5-degree fan spread

Shotgun
Damage: 35-105 (7 pistol shots; 70 average)
Cooldown: 1.06" (37) held, 1.26" (44) unheld
Time to hit: 0.09" (3)
Damage type: 7 hitscan tracers
Accuracy: all tracers inaccurate at 5-degrees fan spread

Super Shotgun
Damage: 100-300 (20 pistol shots; 200 average)
Cooldown: 1.63" (57) held, 1.77" (62) unheld
Time to hit: 0.09" (3)
Damage type: 20 hitscan tracers
Accuracy: 22-degree horizontally; 11-degree vertically (?)

Chaingun
Damage: 5-15 (pistol shot)
Cooldown: 0.11" (4) held or unheld
Time to hit: 0
Damage type: pistol hitscan tracer, each tap firing two bullets one after another
Accuracy: first two are 100% accurate, subsequents are 5-degrees inaccurate

Rocket Launcher
Damage: 20to160 (20*(rand%8+1); 90 average) + 128 - 11 (self width; overall average: 207)
Cooldown: 0.57" (20) held or unheld
Time to hit: 0.23" (8 - more than Cyberdemon's!)
Damage type: missile, 128 damage & radius splash damage caused on impact, from rocket to victim boundary.
Missile speed: 20 per tic
Missile width: 22

Plasma Rifle
Damage: 5-40 (5*(rand%8+1); 22.5 average)
Cooldown: 0.09" (3) held, 0.66" (23) unheld
Time to hit: 0
Damage type: missile, no splash
Missile speed: 25 per tic
Missile width: 26

BFG 9000
Damage: 100to800 (100*(rand%8+1); 450 average) + 600to4800 (40 tracers each 15to120 (15 times (rand%8+1)); overall average: 3150)
Cooldown: 1.14" (40) held, 1.71 (60) unheld
Time to hit: 0.86" (30)
Damage type: missile; 0.46" after impact, 40 tracers come from attacker, regularly in a fan pattern (60-degrees wide?), causing the bigger damage shown above
Missile speed: 25 per tic
Missile width: 26

Former Human
Damage: 3-15 (3*(rand%5+1); 9 average)
Cooldown: 0.74" (26)
Time to hit: 0.29" (10)
Damage type: hitscan shot
Accuracy: 22.5 fan wide

Former Human Sergeant
Damage: 9-45 (3 FH shots; 27 average)
Cooldown: 0.86" (30)
Time to hit: 0.29" (10)
Damage type: 3 hitscan shots
Accuracy: 22.5 fan wide

SS Guard
Damage: 3-15 (FH shot)
Cooldown: 0.29" (10) alternated with 0.43" (15), 0.36" (12.5) overall
Time to hit: 0.57" (20)
Damage type: hitscan shot in loop
Accuracy: 22.5 fan wide

Imp
Damage: 3-24 (3*(rand%8+1); 13.5 average)
Cooldown: 0.63" (22)
Time to hit: 0.46" (16)
Damage type: instant damage within 64 range, missile ahead
Missile speed: 10 per tic or 20 -fast
Missile width: 12

Heavy Weapon Dude
Damage: 3-15 (FH shot)
Cooldown: 0.11" (4) alternated with 0.14" (5), 0.13" (4.5) overall
Time to hit: 0.29" (10)
Damage type: hitscan shot in loop
Accuracy: 22.5 fan wide

Lost soul
Damage: 3-24 (imp damage)
Cooldown: 0.29" (10) minimum; maybe 0.46" (16) instead
Time to hit: 0.29" (10)
Damage type: ram (self-missile)
Speed: 20 per tic
Width, height: 32, 56

Demon, Spectre
Damage: 4-40 (4*(rand%10+1); 22 average)
Cooldown: 0.69" (24)
Time to hit: 0.46" (16)
Damage type: instant damage within 64 range

Revenant
Damage: 6-60 (6*(rand%10+1); 33 average) melee; 10-80 (10*(rand%8+1); 45 average) missile
Cooldown: 0.51" (18) melee; 0.86" (30) missile
Time to hit: 0.34" (12) melee; 0.29" (10) missile
Damage type: instant damage 64 range; missile otherwise, half of them are homing
Missile speed: 10 per tic
Missile width: 22

Cacodemon
Damage: 10-60 (10*(rand%6+1); 35 average) melee; 5-40 (5*(rand%8+1); 22.5 average) missile
Cooldown: 0.43" (15)
Time to hit: 0.29" (10) missile
Damage type: instant damage 64 range; missile otherwise
Missile speed: 10 or 20
Missile width: 12

Pain Elemental
Cooldown: 0.43" (15)
Time to hit: 0.43" (15)

Hell Knight, Baron of Hell
Damage: 10-80 (10*(rand%8+1); 45 averg.) melee; 8-64 (8*(rand%8+1); 36 average) missile
Cooldown: 0.69" (24)
Time to hit: 0.46" (16)
Damage type: instant damage 64 range; missile otherwise
Missile speed: 15 or 20
Missile width: 12

Arachnotron
Damage: plasma gun damage
Cooldown: 0.26" (9)
Time to hit: 0.57" (20)
Damage type: missile
Missile speed: 25
Missile width: 26

Mancubus
Damage: 3 waves of pairs of 8-64 (36 average), total being 48-384 (216 average)
Cooldown: 0.57" (20)
Time to hit: 0.57" (20)
Missile speed: 20
Missile width: 12
[EDIT]
Accuracy: \| |/ V, each stretching 22.5 degrees.

Archvile
Damage: 20 + 70 splash damage some distance in front of target (causing around 83 total damage?)
Cooldown: 2.69" (94)
Time to hit: 1.89" (66)
Damage type: instant 20 damage on sight + jumping, if a flame has yet been triggered, extra 70 splash is added

Spiderdemon
Damage: 9-45 (3 FH shots; 27 average)
Cooldown: 0.11" (4) alternated with 0.14" (5), 0.13" (4.5) overall
Time to hit: 0.57" (20)
Damage type: hitscan shot in loop
Accuracy: 22.5 fan wide

Cyberdemon
Damage: rocket damage
Cooldown: 0.69" (24)
Time to hit: 0.17" (6)
Damage type: same as rocket
Missile speed and width: same as rocket

TheDarkArchon said:

Green armour takes 1/3 of the damage dealt to it while it's in working condition. For example, if you got hit by an attack that normally did 9 damage, you'd would lose 6 health and 3 armour.

Blue armour is a similar story but the damage is split 50/50

Possibly also worth adding that once your armour is blue, it is upgraded to such and uses the blue armour calculation even when you drop down to armour values that are normally green (ie <100).

Enjay said:

Possibly also worth adding that once your armour is blue, it is upgraded to such and uses the blue armour calculation even when you drop down to armour values that are normally green (ie <100).

And conversely once you pick up a green one it goes back to the green armor calculation, had you been wearing a blue one with less than 100 points of protection. I sometimes avoid green armors if I still have some blue armor left, when playing cautiously, due to this.

Well it's only a Doom-like game, so it doesn't have to behave exactly the same. I planned on resetting the players armor only when it reached 0, to prevent what Chain Mail said. So once you pick up blue armor, you have the 50% absortion until your armor reaches 0.