Ouch face

From DoomWiki.org

Revision as of 08:57, 6 August 2006 by 84.92.173.189 (talk)


Ouch face being demonstrated on E1M4 (see demo below)

The status bar graphic "STFOUCH*" displays an anguished face of shock and pain. During normal gameplay it is seen only rarely, and for a long time the face was considered an almost random occurrence.

However, when Doom's source code was released, it became apparent that the code that displayed the face was in error. The programmers had used a greater than (">") sign instead of a less than ("<") sign. The code should have displayed the face whenever the player underwent a damaging event which left him or her with twenty fewer hit points. As it was, the code only displayed the face when the player gained more than twenty hit points during a damaging event - a rare occurence, most commonly trigged by picking up a large health kit whilst being badly hurt.

There are several ways to see the OUCH face. One is to start a level with the player standing on a damaging floor sector. Another way is to receive damage while simultaneously picking up a large health pickup (e.g. being hit by a rocket while picking up a supercharge, or using the iddqd cheat code while on a damaging floor; see the E1M3 demo in shareware Doom v1.666), resulting in a health which is far greater than it was before the series of events took place.

Technical

The code relating to the bug is found in the file st_stuff.c and is as follows (comments added for clarity):

  if (plyr->health - st_oldhealth > ST_MUCHPAIN) // ST_MUCHPAIN is 20
  {
     st_facecount = ST_TURNCOUNT;  // ST_TURNCOUNT is 35
     st_faceindex = ST_calcPainOffset() + ST_OUCHOFFSET; // ST_OUCHOFFSET is 5
  }

The relevant portion is in the first line, which essentially states that the OUCH face will only appear if the player's current health is more than 20 points greater than their health in the previous tic. Since this portion of code is only called when the player receives damage, it is very unusual through normal play for a player receiving damage to end up with a great deal more health than he started with.

Due to the strange nature of the OUCH face, a long-held assumption among players was that the OUCH face only appeared as a sort of "surprise" or a "I can't believe I survived that" moment. However, the obvious error in the code makes it clear that the OUCH face was originally supposed to appear any time the player received over 20 points of damage at one time. Since such events occur frequently during gameplay, especially in Doom II, it is curious that id Software never noticed the error.

The Doom press release beta contained a working version of the OUCH face. Crossing pools of nukage or lava would result in a sustained OUCH face until the player escaped the hazard.

Some modern source ports, such as GZDoom and Eternity, have "fixed" the code, resulting in behavior which was never actually present in the original Doom, but correcting what could nevertheless be considered a "bug".

The Playstation and Sega Saturn console ports include the ouch face. It usually occurs when the player is hit from behind.

Demo

See also