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

Can someone better explain how "pain chance" code works in the doom series?

Recommended Posts

I've always really liked that chance to interrupt monsters as they're winding up to attack (that's pain chance right?). I really like exactly how it works and want to make some sort of similar system in my flash game.

But how exactly does it work? I know that each monster gets its own pain chance number, right? Like, demons and barons are hard to interrupt, but imps and arachnotrons and hell knights are pretty easy to interrupt. I think. It really makes the monsters feel different and more scary/less scary. Barons always feel like the have tough skin as you perforate 'em with the chain gun, but other enemies get mowed down.

Does it depend on damage done in one tic? Or does it depend on how many hits in one tic? The ssg seems to be a great interrupter, but it has both high damage and many bullet hits, so that doesn't help me figure it out. Or does it not depend on damage at all, just a flat chance to interrupt if any damage is done? Or is it calculated right when a bullet or projectile hits, like a pain chance times projectile damage?

It's the clever, polished gameplay details like this that make doom & doom 2 the greatest games of all time in my opinion, and I don't feel like games have anything like this any more. Or maybe it just is less obvious because I haven't played them as much.

Share this post


Link to post

Each time a monster is damaged, it may enter its pain state. The probability depends only on the pain chance; not on the damage amount. The shotgun and, especially, the super shotgun are especially "paining" because they actually consists in several separate attacks (seven for the pump-action shotgun, twenty for the double-barreled shotgun), so that's a blast gets several rolls to try to inflict pain. Likewise, a point blank BFG hit can deal up to 41 pain attempts (one source of damage from the projectile, plus 40 from the tracers if they all connect), which makes it the single most painful weapon; though it's likely the monster will enter the Death state instead of the Pain state... :p


So, an attack that deals 100 points of damage with a single roll (for example, a rocket or a powerful custom pistol) will be much less efficient for provoking pain than an attack that involves 100 rolls each dealing a single point of damage.

The chaingun works a bit like this too, though the damage rolls are spread in time. You are likely to interrupt the attack with pain because there are several weak attacks in a row. The more, the merrier: the Skulltag minigun, for example, being basically a faster chaingun, can reliably stop archviles and revenants; the chaingun is less likely to have enough attempts in time to get a decent chance at provoking pain in these tough monsters.

(Also note that some ports with custom content can complicate this. ZDoom allows you to define a pain threshold for a monster, so that attacks which do not exceed this threshold will have no chance at inflicting pain. Likewise, attacks can also be flagged as always causing pain, or never causing pain.)

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  
×