Difference between revisions of "Ouch face"

From DoomWiki.org

[checked revision][checked revision]
m (fix link to disambiguation page)
m (italicize non-core title)
 
(13 intermediate revisions by 9 users not shown)
Line 1: Line 1:
[[Image:stfouch.png|right|thumb|Ouch face being demonstrated on E1M4 (see demo below)]]
+
[[File:stfouch.png|right|thumb|Ouch face being demonstrated on E1M4 (see demo below)]]
 +
The '''ouch face''' is one of the [[status bar face]] graphics ({{c|STFOUCH*}}), for when the [[player]] is shocked by great pain. During normal play it is seen only rarely, and for a long time the face was considered an almost random occurrence.
  
The '''ouch face''' is one of the [[status bar face]] graphics (<tt>STFOUCH*</tt>), for when the [[player]] is shocked by great pain. During normal play it is seen only rarely, and for a long time the face was considered an almost random occurrence.
+
The ouch face actually originates in ''[[Spear of Destiny]]'', where it will appear if B.J. Blazkowicz takes 30 damage or more from a single attack. It is, however, not present in the original ''[[Wolfenstein 3D]]''. Following the release of ''Spear of Destiny'' and the start of Doom's development, the ouch face was brought back once the game implemented its modern [[HUD]] iteration, but it was initially given a different purpose. As a result, the [[Doom press release beta]] contained an apparently non-buggy version of the ouch face. Crossing pools of [[Damaging floor|nukage]] or [[lava]] would result in a sustained ouch face until the player escaped the hazard. The ouch face can be briefly glimpsed in the video "[[A Visit to id Software]]", triggered by the same logic, and showing that this behavior was still present until very late in development before it was decided to revert it to the behavior seen in ''Spear of Destiny''. However, a bug in the code prevented the intended implementation from functioning properly.
  
When Doom's [[Doom source code|source code]] was released, it became apparent that the code that displayed the face was in error. The programmers had used the expression <tt>(plyr->health - st_oldhealth > ST_MUCHPAIN)</tt> instead of the correct expression <tt>(st_oldhealth - plyr->health > ST_MUCHPAIN)</tt>. The code should have displayed the face whenever a player was subject to 20 [[hit points]] of damage or more during a single [[tic]]. As it is, the code only displays the face when the player ''gains'' more than 20 hit points during that period, which is a rare occurrence.
+
When Doom's [[Doom source code|source code]] was released, it became apparent that the code that displayed the face was in error. The programmers had used the expression <code>(plyr->health - st_oldhealth > ST_MUCHPAIN)</code> instead of the correct expression <code>(st_oldhealth - plyr->health > ST_MUCHPAIN)</code>. The code should have displayed the face whenever a player was subject to 20 [[hit point]]s of damage or more during a single [[tic]]. As it is, the code only displays the face when the player ''gains'' more than 20 hit points during that period, which is a rare occurrence.
  
There are several ways to see the ouch face. One is to start a level with the player standing on a [[damaging floor]] sector, such as in [[Memento Mori]] [[MAP13: The Inmost Dens II (Memento Mori)|MAP13: The Inmost Dens II]]. The most common way, however, is to receive damage while simultaneously picking up a large health increasing [[item]] (such as by being hit by a [[projectile]] while picking up a [[supercharge]], or using the <tt>iddqd</tt> [[Doom cheat codes|cheat code]] while on a damaging floor; see the [[E1M3: Toxin Refinery|E1M3]] demo in [[shareware]] Doom [[Versions of Doom and Doom II#v1.666|v1.666]]), resulting in a health which is far greater than it was before the series of events took place.
+
There are several ways to see the ouch face. One is to start a level with the player standing on a [[damaging floor]] sector, such as in [[Memento Mori]] [[MAP13: The Inmost Dens II (Memento Mori)|MAP13: The Inmost Dens II]]. The most common way, however, is to receive damage while simultaneously picking up a large health increasing [[item]] (such as by being hit by a [[projectile]] while picking up a [[supercharge]], or using the {{c|iddqd}} [[Doom cheat codes|cheat code]] while on a damaging floor; see the [[E1M3: Toxin Refinery|E1M3]] demo in [[shareware]] Doom [[Versions of Doom and Doom II#v1.666|v1.666]]), resulting in a health which is far greater than it was before the series of events took place.
  
 
== Technical ==
 
== Technical ==
 
+
{{youtube|EQf-lvdmtQk|The ouch face being triggered on E1M4 by the player picking up a soul sphere while simultaneously taking rocket damage.}}
{{youtube|EQf-lvdmtQk|The ouch face being triggered on E1M4 by the player picking up a soul sphere while simultaneously taking rocket damage.}}The code relating to the bug is found in the file [[Doom source code files | st_stuff.c]] and is as follows (comments added for clarity):
+
The code relating to the bug is found in the file {{c|[[Doom source code files|st_stuff.c]]}} and is as follows (comments added for clarity):
  
 
   if (plyr->health - st_oldhealth > ST_MUCHPAIN) // ST_MUCHPAIN is 20
 
   if (plyr->health - st_oldhealth > ST_MUCHPAIN) // ST_MUCHPAIN is 20
Line 17: Line 18:
 
   }
 
   }
  
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.
+
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. Much like all the other faces, the ouch face gets bloodier the more damage the player has taken.
  
 
== Presence in ports ==
 
== Presence in ports ==
 +
[[File:Spear of Destiny ouch face.png|right|thumb|The ouch face in ''[[Spear of Destiny]]'', working with the behavior intended for Doom, albeit with a higher damage value required to trigger it.]]
 +
Some modern [[source port]]s, such as [[ZDoom]] and [[Eternity Engine|Eternity]], have reversed the code, resulting in behavior which is not present in the games out of the box, but correcting what could nevertheless be considered a "[[engine bug|bug]]". A {{dwforumsp|id=674517|title=binary patch}} for the DOS executables similarly changing the face behavior has been written by the programmer of [[PrBoom+]], [[Andrey Budko]].
  
[[Image:DOOM_GUY.jpg|right|thumb|Ouch face in the [[Xbox 360]] version of Doom.]]
+
The [[Sony PlayStation|PlayStation]] and [[Sega Saturn]] console ports include the ouch face. It usually occurs when the player is hit from behind.
 
 
The [[Doom press release beta]] contained an apparently non-buggy version of the ouch face. Crossing pools of [[Damaging floor|nukage]] or [[lava]] would result in a sustained ouch face until the player escaped the hazard.
 
 
 
Some modern [[source ports]], such as [[ZDoom]] and [[Eternity Engine|Eternity]], have reversed the code, resulting in behavior which is not present in the games out of the box, but correcting what could nevertheless be considered a "[[engine bug|bug]]". A {{dwforumsp|id=674517|title=binary patch}} for the DOS executables similarly changing the face behavior has been written by the programmer of [[PrBoom+]], [[Andrey Budko]].
 
 
 
The [[Sony PlayStation|Playstation]] and [[Sega Saturn]] console ports include the ouch face. It usually occurs when the player is hit from behind.
 
  
The official [[Xbox 360]] port of Doom also has the ouch face, but it is harder to trigger and looks slightly different.
+
The official [[Xbox 360]] port of Doom also has the ouch face, but it is harder to trigger. The bug was fixed in a patch of the [[Doom Classic Unity port]].
  
 
== Demo ==
 
== Demo ==
 
+
* [[Media:stfouch-e1m4.lmp | Ouch face]] ([[:Image:stfouch-e1m4.lmp|file info]]) demonstrated on [[E1M4: Command Control (Doom)|E1M4: Command Control]] (or [https://www.youtube.com/watch?v=EQf-lvdmtQk watch it on YouTube])
* [[Media:stfouch-e1m4.lmp | Ouch face]] ([[:Image:stfouch-e1m4.lmp|file info]]) demonstrated on [[E1M4: Command Control]] (or [https://www.youtube.com/watch?v=EQf-lvdmtQk watch it on YouTube])
 
  
 
== See also ==
 
== See also ==
 
 
* [[Status bar face]]
 
* [[Status bar face]]
 
* [[References to Classic Doom in Doom 3]]
 
* [[References to Classic Doom in Doom 3]]
  
 +
{{featured article}}
 
[[Category:Errors and bugs]]
 
[[Category:Errors and bugs]]

Latest revision as of 13:40, 9 February 2024

Ouch face being demonstrated on E1M4 (see demo below)

The ouch face is one of the status bar face graphics (STFOUCH*), for when the player is shocked by great pain. During normal play it is seen only rarely, and for a long time the face was considered an almost random occurrence.

The ouch face actually originates in Spear of Destiny, where it will appear if B.J. Blazkowicz takes 30 damage or more from a single attack. It is, however, not present in the original Wolfenstein 3D. Following the release of Spear of Destiny and the start of Doom's development, the ouch face was brought back once the game implemented its modern HUD iteration, but it was initially given a different purpose. As a result, the Doom press release beta contained an apparently non-buggy version of the ouch face. Crossing pools of nukage or lava would result in a sustained ouch face until the player escaped the hazard. The ouch face can be briefly glimpsed in the video "A Visit to id Software", triggered by the same logic, and showing that this behavior was still present until very late in development before it was decided to revert it to the behavior seen in Spear of Destiny. However, a bug in the code prevented the intended implementation from functioning properly.

When Doom's source code was released, it became apparent that the code that displayed the face was in error. The programmers had used the expression (plyr->health - st_oldhealth > ST_MUCHPAIN) instead of the correct expression (st_oldhealth - plyr->health > ST_MUCHPAIN). The code should have displayed the face whenever a player was subject to 20 hit points of damage or more during a single tic. As it is, the code only displays the face when the player gains more than 20 hit points during that period, which is a rare occurrence.

There are several ways to see the ouch face. One is to start a level with the player standing on a damaging floor sector, such as in Memento Mori MAP13: The Inmost Dens II. The most common way, however, is to receive damage while simultaneously picking up a large health increasing item (such as by being hit by a projectile 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[edit]

The ouch face being triggered on E1M4 by the player picking up a soul sphere while simultaneously taking rocket damage.

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. Much like all the other faces, the ouch face gets bloodier the more damage the player has taken.

Presence in ports[edit]

The ouch face in Spear of Destiny, working with the behavior intended for Doom, albeit with a higher damage value required to trigger it.

Some modern source ports, such as ZDoom and Eternity, have reversed the code, resulting in behavior which is not present in the games out of the box, but correcting what could nevertheless be considered a "bug". A binary patch for the DOS executables similarly changing the face behavior has been written by the programmer of PrBoom+, Andrey Budko.

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

The official Xbox 360 port of Doom also has the ouch face, but it is harder to trigger. The bug was fixed in a patch of the Doom Classic Unity port.

Demo[edit]

See also[edit]