Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Bishop

Zdoom health/damage system

Recommended Posts

A small question for Zdoom decorate modders... how does Zdoom's damage system work? For example I'm shooting at a Demon with a pistol, the pistol has a damage amount of 5. When I hit the demon once, does it then loose 5 health? Or is it more complicated than that?

Share this post


Link to post

It's more complicated than that, and there's nothing specific to ZDoom to this scenario.

Doom uses random damage, inspired by RPGs and the likes, so the damage inflicted by an attack is not in direct hit point drain, but in damage dice. So instead of five points of damage, it's five dice of damage.

For most things, the "dice" used by Doom and other Doom engine games have either three, four or eight "sides". To use D&D notation, the pistol deals 5x 1d3 damage, so either 5, 10 or 15 damage.


ZDoom features can make this a lot more complicated, through custom damage factors and custo damage formulas, but this does not happen with the standard actors.

Share this post


Link to post

I know about doom's random damage system, no problem with that. The real question was if health loss is identical to damage points.
5 damage points causes a 5 point health loss, 10 points causes 10 loss, 15 points causes 15 loss, etc...

Share this post


Link to post

No, 5 damage doesn't do 5HP of damage, more or less between 5 and 30 HP worth of damage..or something like that. That explains why 20 damage (100-150 HP) rockets can severely injure or kill the player with a direct hit.

Share this post


Link to post
Mr. Chris said:

No, 5 damage doesn't do 5HP of damage, more or less between 5 and 30 HP worth of damage..or something like that. That explains why 20 damage (100-150 HP) rockets can severely injure or kill the player with a direct hit.


Actually no, the damage field visible in Dehacked and most ports is only the first value of an equation. All damage caluations in Doom use this equation with different values.

For instance, these are the equations for the Imp, Caco Demon and Barron of Hell melee attacks:

" damage = (P_Random() % 8 + 1) * 3; "
" damage = (P_Random() % 6 + 1) * 10; "
" damage = (P_Random() % 8 + 1) * 10; "

So a Barron of Hell can do 10-90 damage in melee.

Share this post


Link to post
Vermil said:

" damage = (P_Random() % 8 + 1) * 10; "

So a Barron of Hell can do 10-90 damage in melee.

Wrong, because "% 8" limits the random number between 0 and 7. Add 1 to that and it becomes 1...8. So the final damage is something between 10 and 80 inclusive.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×