Difference between revisions of "Bullet puffs do not appear in outdoor areas"

From DoomWiki.org

[unchecked revision][checked revision]
(Technical)
m (Technical: link to article, use same phrasing as code comment)
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[Image:Bullet_puffs_outdoors.png|thumb|right|Certain outdoor walls do not show bullet puffs when shot.]]
 
[[Image:Bullet_puffs_outdoors.png|thumb|right|Certain outdoor walls do not show bullet puffs when shot.]]
When shooting walls in [[Doom]], bullet "puffs" appear.  However, due to a bug in the game, these may not appear in outdoor areas when shooting certain walls.
+
When shooting walls in [[Doom]], bullet "puffs" appear.  However, due to a bug in the game, these may not appear in outdoor areas when shooting two-sided walls.
  
 
== Technical ==
 
== Technical ==
Line 6: Line 6:
 
The bug occurs due to a logic bug in the code for handling skies.   
 
The bug occurs due to a logic bug in the code for handling skies.   
  
In Doom, if a [[linedef]] bridges two [[sector]]s with different ceiling heights and has no upper [[texture]] to be displayed in the space between the sectors, the ceiling texture of the lower texture appears to "bleed" into the empty space.  This is used to deliberate effect in outdoor areas where a special sky texture (F_SKY1) is used for the ceiling texture.  This allows low retainer walls to be displayed with a background sky in the distance behind the wall.
+
In Doom, if a [[linedef]] bridges two [[sector]]s with different ceiling heights and has no upper [[texture]] to be displayed in the space between the sectors, the ceiling texture of the lower sector appears to "bleed" into the empty space.  This is used to deliberate effect in outdoor areas where a special sky texture (F_SKY1) is used for the ceiling texture.  This allows the sky texture beyond low outer walls to look like real sky, as opposed to a sky wallpaper.
  
The Doom engine contains explicit code to deal with this case.  [[Rocket]]s fired at these "sky walls" do not explode, but instead disappear, but if the player hits the wall so that he can't move more forward, then the rockets normally explode, and the player takes [[splash damage]]. Similarly, if they are shot with a [[hitscan]] weapon, bullet puffs do not appear, but directly they appear.   
+
The Doom engine contains explicit code to deal with this case.  [[Rocket]]s fired at these "[[sky hack]] walls" do not explode, but instead disappear, but if the walls are shot point-blank the rockets explode in the normal fashion and the player takes [[splash damage]]. Similarly, shooting such walls with a [[hitscan]] weapon produces no bullet puffs, unless the shooter is right in front of the wall.   
  
 
It is because of this that the bullet puff bug occurs.  Although a check is made to determine if the back sector of the linedef has sky for its ceiling, no check is made that it is actually the upper texture that has been hit.
 
It is because of this that the bullet puff bug occurs.  Although a check is made to determine if the back sector of the linedef has sky for its ceiling, no check is made that it is actually the upper texture that has been hit.

Revision as of 20:24, 29 February 2016

Certain outdoor walls do not show bullet puffs when shot.

When shooting walls in Doom, bullet "puffs" appear. However, due to a bug in the game, these may not appear in outdoor areas when shooting two-sided walls.

Technical

The bug occurs due to a logic bug in the code for handling skies.

In Doom, if a linedef bridges two sectors with different ceiling heights and has no upper texture to be displayed in the space between the sectors, the ceiling texture of the lower sector appears to "bleed" into the empty space. This is used to deliberate effect in outdoor areas where a special sky texture (F_SKY1) is used for the ceiling texture. This allows the sky texture beyond low outer walls to look like real sky, as opposed to a sky wallpaper.

The Doom engine contains explicit code to deal with this case. Rockets fired at these "sky hack walls" do not explode, but instead disappear, but if the walls are shot point-blank the rockets explode in the normal fashion and the player takes splash damage. Similarly, shooting such walls with a hitscan weapon produces no bullet puffs, unless the shooter is right in front of the wall.

It is because of this that the bullet puff bug occurs. Although a check is made to determine if the back sector of the linedef has sky for its ceiling, no check is made that it is actually the upper texture that has been hit.

From PTR_ShootTraverse in p_map.c:

  if (li->frontsector->ceilingpic == skyflatnum)
  {
      // don't shoot the sky!
      if (z > li->frontsector->ceilingheight)
          return false;
      
      // it's a sky hack wall
      if  (li->backsector && li->backsector->ceilingpic == skyflatnum)
          return false;           
  }

  // Spawn bullet puffs.
  P_SpawnPuff (x,y,z);

The bug can be fixed through the addition of an extra condition to the "sky hack wall" test: li->backsector->ceilingheight < z