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

Doom wiki damage histograms

Recommended Posts

If you look at the Doom wiki articles about monsters, for example "Imp", you'll see a histogram that lists the probabilities of each damage amount of the fireball (3, 6, 9, ... , 24). I see that the histograms are non-uniform, which makes me wonder: were they built merely empirically, by counting how many times the player got damaged that way or that way, or does it have something to do with the vanilla Doom pseudorandom generator (which is a simple 256-sized look-up table of scrambled numbers)? The Doom RNG is supposed to be uniformly distributed, right? So all those histograms should be smooth and horizontal, right? Or do they really take into account any irregularities of Doom's RNG?

Share this post


Link to post
printz said:

something to do with the vanilla Doom pseudorandom generator (which is a simple 256-sized look-up table of scrambled numbers)?


I believe this is your answer.

printz said:

The Doom RNG is supposed to be uniformly distributed, right? So all those histograms should be smooth and horizontal, right?


The table is not perfect. Some numbers are repeated many times, while some numbers never make an appearance at all. This explains why some of those one-shot monster kills that are theoretically possible, will never actually occur in-game. For example (and I'm not sure this is true), a super shotgun deals between 100 and 300 damage, but never deals 100 or 300 damage. I'm sure someone else could give some examples here.

printz said:

Or do they really take into account any irregularities of Doom's RNG?


This is how it would seem, yes.

Share this post


Link to post
printz said:

The Doom RNG is supposed to be uniformly distributed, right? So all those histograms should be smooth and horizontal, right?


Not true. Most attacks are compounded by several calls to tne RNG, and as such, their totals have non-uniform distributions.

Compare e.g. the distribution of a SINGLE dice (uniform) vs that of TWO dice (non-uniform), vs that of many dice (roughly gaussian).



The combined probabilities of two or more uniform events is not necessarily uniform (actually, it can be proven mathematically that it will be asymptoticallyy gaussian).

Plus, Doom's damage system does not have uniform probability of achieving the minimum/medium/maximum damage multipliers for each attack. The multiplier is either 1,2 or 3 depending on the modulo of the RNG's value (it's 1+ value%3), and there are e.g. only 7 values in the entire table which will result in a multiplier of 3.

So it's like having multiple dice rolls of non-fair dice ;-)

Furthermore, certain damage sequences are impossible (e.g. it's not possible to get all maximum-damage pellets with the SSG) due to the way the values are laid out in the table and their usage pattern (I had done a very exhaustive analysis about that in some older threads, the downloads/simulations/excel charts should still be up). So e.g. it's not possible to get 300 HP damage from a single SSG blast, but there is rougly a 1/256 chance of getting a 105-damage SG blast.

Share this post


Link to post
Maes said:

Plus, Doom's damage system does not have uniform probability of achieving the minimum/medium/maximum damage multipliers for each attack. The multiplier is either 1,2 or 3 depending on the modulo of the RNG's value (it's 1+ value%3), and there are e.g. only 7 values in the entire table which will result in a multiplier of 3.

Right.  Some RNG calls do use the high bits of the return value, but I think damage rolls all use the low bits (at least projectile attacks do, because the RNG is called from a common function, with a monster-specific multiplier tacked on at the very end).

(I had done a very exhaustive analysis about that in some older threads, the downloads/simulations/excel charts should still be up).

You have mentioned this before.  Each time, I have searched the forums and not found it.  I've been trying for years to improve the histogram calculations.  Would you mind linking or, for maximum awesome, linking/uploading to the wiki talk pages when the new site is ready?

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  
×