Difference between revisions of "Lost soul colliding with items"

From DoomWiki.org

[unchecked revision][checked revision]
m (sp)
m (External Links)
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
When charging forward, if a [[Lost Soul]] collides with an item, which is exempt from most collision checks, the Lost Soul will stop charging and start moving normally again as if nothing has happened. This is noticeable on [[E2M8: Tower of Babel]] where the player can hide behind the alcoves of items and effectively protect himself from the Souls in the map.
+
If a [[lost soul]] collides with any item while charging forward, the monster will stop and start moving normally again as if nothing had happened. A notable example can be seen on [[E2M8: Tower of Babel]] in [[Doom]]: as long as the player stays behind the items in alcoves, he is effectively unreachable for the flaming skulls in the level.
 +
 
 +
The reasoning behind this behavior does not seem very obvious. In the [[Doom source code]], <tt>PIT_CheckThing</tt> is the generic function which handles collisions between [[thing]]s - such as [[projectile]] hits and [[item]]s being picked up. Here, projectiles ([[mobj]]s which have the <tt>MF_MISSILE</tt> bitflag onto them) are checked if they actually hit something solid and/or shootable, taking the Z coordinate into account (the function returns <tt>true</tt> if the collision does not take place):<ref>Doom source code, p_map.c</ref>
 +
 
 +
  // missiles can hit other things
 +
  if (tmthing->flags & MF_MISSILE)
 +
      {
 +
        // see if it went over / under
 +
        if (tmthing->z > thing->z + thing->height)
 +
            return true; // overhead
 +
        if (tmthing->z+tmthing->height < thing->z)
 +
            return true; // underneath
 +
 
 +
For reasons unknown, the lost soul's collision code (while dashing, it has the <tt>MF_SKULLFLY</tt> bitflag set, albeit the difference is not significant) does not do any of above checks, simply zeroing out the monster's momentum, along with a call to <tt>P_DamageMobj</tt>. Furthermore, it does not check what kind of thing it hits (flags <tt>MF_SOLID</tt>, <tt>MF_SPECIAL</tt>, <tt>MF_SHOOTABLE</tt>, which again are handled proper for missiles).
 +
 
 +
The result of such flawed logic is, that the lost soul's charge will be interrupted by ''any type'' of thing - a monster, a powerup, or a decoration - situated on ''any height'' along the lost soul's trajectory.  
  
 
== External Links ==  
 
== External Links ==  
[http://forum.zdoom.org/potato.php?t=5310&postdays=0&postorder=asc&start=0 Bug report thread at the ZDoom forums]
+
{{zdforums|t=5310|Bug report thread at the ZDoom forums}}
 +
 
 +
== References ==
 +
<references/>
  
 
[[Category:Errors and bugs]]
 
[[Category:Errors and bugs]]
 +
[[Category:Monsters]]
 +
[[Category:Doom engine]]

Revision as of 14:38, 10 September 2012

If a lost soul collides with any item while charging forward, the monster will stop and start moving normally again as if nothing had happened. A notable example can be seen on E2M8: Tower of Babel in Doom: as long as the player stays behind the items in alcoves, he is effectively unreachable for the flaming skulls in the level.

The reasoning behind this behavior does not seem very obvious. In the Doom source code, PIT_CheckThing is the generic function which handles collisions between things - such as projectile hits and items being picked up. Here, projectiles (mobjs which have the MF_MISSILE bitflag onto them) are checked if they actually hit something solid and/or shootable, taking the Z coordinate into account (the function returns true if the collision does not take place):[1]

  // missiles can hit other things
  if (tmthing->flags & MF_MISSILE)
     {
        // see if it went over / under
        if (tmthing->z > thing->z + thing->height)
           return true;		// overhead
        if (tmthing->z+tmthing->height < thing->z)
           return true;		// underneath

For reasons unknown, the lost soul's collision code (while dashing, it has the MF_SKULLFLY bitflag set, albeit the difference is not significant) does not do any of above checks, simply zeroing out the monster's momentum, along with a call to P_DamageMobj. Furthermore, it does not check what kind of thing it hits (flags MF_SOLID, MF_SPECIAL, MF_SHOOTABLE, which again are handled proper for missiles).

The result of such flawed logic is, that the lost soul's charge will be interrupted by any type of thing - a monster, a powerup, or a decoration - situated on any height along the lost soul's trajectory.

External Links

Bug report thread at the ZDoom forums

References

  1. Doom source code, p_map.c