What Does Doom Without Randomness Play Like?

In the days of 80386 processors, id Software had to optimise the daylights out of Doom. So intent was it on this goal that even the random numbers are as high-performance as you can get. Rather than generating them on the fly, all of Doom's randomness comes from a series of fixed values. Change those values and well, the game does some interesting and unexpected things.

Software engineer Jonathan Dowland recently tinkered with Doom's source code, specifically the file responsible for providing the engine with random numbers. Usually, a pseudo-random number generator with a changing seed is used (say, the current time of day), which will provide values that are more than good enough for a game's typical needs.

Doom, on the other hand, uses predefined list of 256 values with an incrementing index. Whenever the engine needs a random value, it asks for one from this table and the index is increased until it wraps around.

For example, take the list below, with the index at zero. We ask for a "random" number, and get 129. [*129*, 056, 042, 018, 002, 242]

The engine increments the index. We then ask for another number and out pops 56. [129, *056*, 042, 018, 002, 242]

And so on. Random enough for Doom's needs it seems -- I don't think any of us noticed anything odd back in the 90s. But what happens if you change those values? Here's what Dowland experienced:

What does it play like? I tried two values, 0x00 and 0xFF. With either value, the screen "melt" effect that is used at the end of levels is replaced with a level vertical wipe: the randomness was used to offset each column. Monsters do not make different death noises at different times; only one is played for each category of monster.

The bullet-based (hitscan) weapons have no spread at all: the shotgun becomes like a sniper rifle, and the chain-gun is likewise always true. You'd think this would make the super-shotgun a pretty lethal weapon, but it seems to have been nerfed: the spread pattern is integral to its function.

And that's not all. Dowland goes on to mention that everything from monster movement to minimum and maximum damage are affected. If you ever wanted an idea of how much games rely on randomness -- shooters in particular -- hit up Dowland's full post.

Deterministic Doom [jmtd, via GamesRadar]

Image: Wikipedia


    It feels like yesterday that I was playing this game on my 486. Not long now it will feel like yesterday that I wrote this comment and shortly after, it will feel like yesterday that I was 70 and still capable of playing games. Ah, life.

    I wonder if the shotgun uses impact points as a modifier, rather than calculating each bullet individually. If you only had a single point of impact, it would mean you only multiplied damage by 1 each time, explaining the nerfing effect.

      That's my guess too. All the bullets hitting the same dead-zero pixel means you get one pixel's worth of damage.

Join the discussion!

Trending Stories Right Now