Blast damage

From DoomWiki.org

Revision as of 10:47, 1 October 2013 by Quasar (talk | contribs) (Non-reentrancy: Slight reformatting)


Explosion blast damage. Here, B and C take the same damage because they are at the same x distance, and the x distance is larger than y for both. Both take 128-80=48 units damage. A and D take no damage since the line of sight is obstructed. (In this illustration, one pixel corresponds to one map unit.)

In addition to inflicting damage from the direct hit, blast damage (sometimes called splash damage) attacks inflict radius damage in the area surrounding their explosion (for arch-vile attacks, 70 units; for barrels and player or cyberdemon rockets, 128 units). Because of this, the character using the blast attack will also be damaged if the explosion occurs nearby.

An enemy that is hit will receive full blast damage (unless it is immune; see below), because it is at a distance of zero from the blast. Counting both the hit and the blast, a successful rocket launcher attack averages about the same damage as the super shotgun at close range (about three times the regular shotgun), but is equally effective at long range.

Cyberdemons and spiderdemons are immune to all blast damage (which does not include the tracer damage from BFG blasts). Therefore, a greater number of rockets is required to kill these bosses than might be expected.

The original Doom engine uses the same code for all blasts, and even the same sound effect. The blast radius is either 70 or 128 units, and all objects within that radius are examined. For each object that can be damaged, the distance to the center of the explosion is calculated as the greater of the x-distance and the y-distance of the centers, less the radius of the object. The line-of-sight is checked, and if the view of the object from the explosion is obstructed, no damage is inflicted. Otherwise, damage (in hit points) is equal to blast radius minus the distance.

Extensions were made in Hexen that allow explosions to be clipped to a certain z height around the projectile, have differing damage and radius measurements, and to optionally not inflict damage to the actor which originated the explosion (such as is used for Baratus's Hammer of Retribution).

Non-reentrancy

The blast radius code, like virtually all of the clipping engine code in Doom, is non-reentrant, meaning that it can cause recursive calls into the clipping engine and into its own code, but will not properly tolerate such calls and will therefore malfunction. It is possible for the ordering of the blockmap list used to damage objects in explosions to be changed during the explosion calculation simply through the calls it makes to the function P_DamageMobj, which can change the position of monsters, and thereby inflict damage to some monsters more than once. If multiple explosions cause each other directly within the same gametic, the recursive explosions will interfere with previous explosions' damage, location, and blockmap iteration properties.

See also