Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Memfis

Do all monster barriers affect the movement the same way?

Recommended Posts

Sometimes I use "block monster" lines to better control monster movement. For example, I can prevent the enemies from getting stuck on corners. But I don't know: do "block monster" lines have exactly the same effect as natural barriers? (e.g. a height difference too big for the monster to climb, an "impassable" grate, etc) Or maybe they more actively push the monster away and make it go in the opposite side or something? What about >24 unit steps versus "impassable" lines: do they work exactly the same too?

Share this post


Link to post

Block monster lines just will not allow a monster to be in a position where it intersects such a line, that's really all. They have no implied AI properties whatsoever.

Share this post


Link to post

"implied AI properties" feels like it implies there's pathfinding at all. You can really liken monsters to bouncy balls that try to alter their momentum towards your direction, even if that direction's through twenty different walls which they're just going to bounce off of.

Share this post


Link to post

Here is the ONLY part of Doom's source code where the monster-blocking linedef flag is being checked. The code is responsible for checking collisions with lines. You can see that impassable lines (ML_BLOCKING flag) and monster-blocking lines for non-players (ML_BLOCKMONSTERS flag, !tmthing->player) have the exact same effect (the function returns false, indicating a collision).

    if (!(tmthing->flags & MF_MISSILE) )
    {
	if ( ld->flags & ML_BLOCKING )
	    return false;	// explicitly blocking everything

	if ( !tmthing->player && ld->flags & ML_BLOCKMONSTERS )
	    return false;	// block monsters only
    }

Share this post


Link to post

The only difference I can think off is what happens after the monster died. If the corpse is moving (for whatever reason, possibly because of momentum imparted by its death blow) it might cross a monster-blocking line but not climb a 25+ tall step.

Share this post


Link to post

^ Corpses can't pass monster-blocking lines either. Unless they skip the lines without overlapping them at all, which can happen either due to moving extremely fast (which is theoretically possible for living monsters as well), or due to their radius being reduced to zero by being crushed. This, of course, is true for normal impassable lines too, even 1-sided ones - indeed, a crushed moving corpse can move through walls and possibly out of bounds of the map.

Share this post


Link to post

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  
×