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

Monsters boucing off doors they are opening

Recommended Posts

I've been wondering this.

Why is it that faster monsters will often open a door and then immediately do a 180 rather than going through the now open door (which I assume is because the door hasn't opened enough for them to fit through when the engine determines that they are no longer "opening the door")?

Does Doom only freeze the monster in place for x amount of walking states when it opens a door, before allowing them to move again. Hence faster monsters would run through these x amount of walking states quicker?

Share this post


Link to post

Seems to me like the monster runs into the door as it's opening, then starts in the other direction for a split second to allow the door to finish it's action. This may be because when the monster collides with something, it is forced to change directions and to keep in constant motion. The monster is not coded to "wait". Thats my take.

Share this post


Link to post

When the monster nears the door, it will trigger it. However, unless the door opens instantaneously (or the monster is slow enough), it will act as a regular wall, sending the monster towards another direction. So yes, you're correct in that the door hasn't opened enough for it to move through. In my past experiences, sometimes monsters do get stuck on the door and will wait for it to open completely before it will move again, but even then they won't always move through the door. There are also situations where a monster will completely get stuck on the side of the door for some time when the door is already open.

There's all kinds of weirdness involving doors and monsters.

Share this post


Link to post

Monsters get stuck next to a door because they detect a manual-door linedef in front of them. If they are blocked by something - anything, they stop and press space until they can move to their target.

They get stuck near doortracks because they're blocked by the side wall on their way to the target, and they confuse it with the door itself, so they keep pressing space.
They wait in flocks in front of open-once or locked doors because they think they should open them, but in fact can't do it.

Monsters can only open DR-DoorOpenWaitClose (standard) doors and, curiously, W1-DoorOpenWaitClose (on walking once). Besides opening, they can also keep them open. That's why when someone's stuck next to a door you'll hear periodic shutting noises.

I'm not sure if the monster bouncing behaviour really happens in vanilla Doom. Or are nightmare demons or archviles allowed to 'escape' doors?

Share this post


Link to post

Indeed, monsters sometimes do bouce off doors they are opening, while other times they will wait for it to open completely.

But I'm wondering why faster monsters seem to bouce off notably more often than slower ones.

Share this post


Link to post

Because there is a shorter amount of time between when they open the door and when they would clear the doorway. A slower monster gives the door enough time to get out of the way allowing the monster to pass through.

Share this post


Link to post
EarthQuake said:

Because there is a shorter amount of time between when they open the door and when they would clear the doorway. A slower monster gives the door enough time to get out of the way allowing the monster to pass through.

It's not about time. Normally, monsters stop in front of doors until the doors raise completely (or until they can move to their target). Fast ones are also subject to this. And I very well remember an archvile staying stuck to a door.

ZDoom and PrBoom or Eternity with MBF flags on no longer allow monsters to stop in front of doors, btw. Or at least they fix the 'stuck-in-doortracks' side effect.

Share this post


Link to post
r_rr said:

The monster is not coded to "wait".

That's right.

Monsters are not "aware" of doors, just that if they fail to move and the blocking line is a door then the code tries to open it [depending on type of door].

Share this post


Link to post

it also might have to do with the amount of lines in an area. It became particularly apparent in KDiZD that monsters tend to have a difficult time navigating somewhere when there are a lot of sectors to climb over. It's much easier to get a hell knight to follow you down a hallway than a flight of stairs.

Share this post


Link to post

Wider doors give faster monsters such as demons or spectres a much greater chance of getting through them. If the door is 64 wide, a Demon has little chance of getting through it, it will usually hit the door and turn around. But a 128 wide door, the demon can actually run 'along' the door back and forth until the door is high enough for it to pass through.

In narrow corridors, you need a few monsters in a row to successfully get monsters through doors, the first monster will open the door, turn around, bounce off the monster behind it, and then with any luck, pass through the door while it remains open.

Share this post


Link to post

Lee Killough's solution to the "stuck in door track" problem was in fact to make the monster turn around with a certain low random occurance. The sort of problem that the AI experiences while opening a door is referred to in AI research as a "local minimum." The monster falls into a state where it has one response to a situation, and when that response fails to solve the problem, it simply repeats the response ad infinitum (Door is blocking, open door and wait to be unblocked).

There's really no other efficient and workable way to solve it other than to have monsters choose a different direction to walk a given percentage of the time that they would otherwise wait for the door to open. This will cause them to usually wait around for a while, and then give up, instead of waiting forever. So now even if they walk into a door track, they don't get stuck. However, they may also sometimes turn around when they hit the normal door line, and that seems to be an unavoidable consequence.

BTW I recently abused this bug in Strife to destroy a bunch of Crusaders in the castle map ;)

Share this post


Link to post
Quasar said:

There's really no other efficient and workable way to solve it other than to have monsters choose a different direction to walk a given percentage of the time that they would otherwise wait for the door to open.

Well I think simply fixing P_UseSpecialLine() to return true only if the door or lift was actually put into motion would improve the logic a lot.

Share this post


Link to post

The "stuck in denied-door" bug has a fun side effect. If you slam a "DR" locked door to stop someone from following you, then later you open it, the monster will wait for you right there.

Share this post


Link to post
Ajapted said:

Well I think simply fixing P_UseSpecialLine() to return true only if the door or lift was actually put into motion would improve the logic a lot.


No because whether the door opens or not isn't the problem. The problem is that the monster opening the door may be blocked by something else at the same time, and opening the door is not an action guaranteed to allow it to move, as it was originally coded to "think." After all, when monsters get stuck in door tracks, it is universally with the door open. As they open it they are moving toward the door track, such that they are blocked by both the track and the door if it were closed. This situation is detected as "open door to be able to move." The monster does not try to "use" the door track line, but the door that runs in front of it from the monster's perspective.

Changing P_UseSpecialLine simply can't help that.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×