Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
BMRX

Enemy behaviours

Recommended Posts

I have a few questions about Enemies from Doom 1 & 2, I'm looking around for these answers as well but didn't think it would hurt to ask.

Do any of the enemies in Doom 1 or 2 patrol map areas or do they just sit around until the player shows up?
Do enemies heal over time?
How much do they persue the player after they lose sight of the player?

Thanks in advance,
Some guy

EDIT/ http://doom.wikia.com/wiki/Monster_behavior answers two of my questions! :P

Share this post


Link to post
BMRX said:

Do any of the enemies in Doom 1 or 2 patrol map areas or do they just sit around until the player shows up?
Do enemies heal over time?
How much do they persue the player after they lose sight of the player?


-They sit there until they're alerted to the player's presence
-they do not heal over time
-once they're alerted they don't stop moving until their target is dead

Share this post


Link to post
AD_79 said:

-They sit there until they're alerted to the player's presence
-they do not heal over time
-once they're alerted they don't stop moving until their target is dead


Thanks AD!

Forget this topic ever existed, or keep it going. Whichever. Until next time, back to lurking!

Share this post


Link to post

I noticed that sometimes a monster will target the player once he's done infighting, but other times he will stand still like he is unaware of the player. Why is that? Like, today I was playing e4m6, I got to the rocket launcher through a secret passage. A baron and a demon started to fight, I ran away. Then at some point I opened the door on the other side, the demon was dead and the baron was standing there not trying to reach me.

Share this post


Link to post

I actually have more questions, when you enter a room full of monsters... Then leave. Do they line up around the door waiting for the player? I don't think so, I think they just sit around and wait.

That said, if there is no door and the player moves out of sight do they go looking for him? Or can they see through walls?

EDIT/

I'm starting to think that when the enemy loses sight of the player, (around a corner) they do not persue the player past said corner and in fact just start to randomly patrol.

Guess I should just play it and see for my self.

Share this post


Link to post

Enemies can't see through walls, but they do know where you are relative to them. Let's say you alert an imp then run through some halls - He knows where to find you and will sort of wander in that direction, but he will not attack until you're in sight.

Share this post


Link to post
Doomkid said:

Enemies can't see through walls, but they do know where you are relative to them. Let's say you alert an imp then run through some halls - He knows where to find you and will sort of wander in that direction, but he will not attack until you're in sight.


Makes more sense than randomly patrolling.

So what about if the player runs through a door and it closes, do they just stop in their tracks?

Share this post


Link to post
BMRX said:

So what about if the player runs through a door and it closes, do they just stop in their tracks?

No, they will continue trying to walk towards the player forever.

Really, IDDT'ing twice and looking at the automap will answer most questions you would have.

Share this post


Link to post
Linguica said:

No, they will continue trying to walk towards the player forever.

Really, IDDT'ing twice and looking at the automap will answer most questions you would have.


Well that makes things easier, thanks for your help everyone.

G'day!

Share this post


Link to post

One thing I find funny is when demons run away from you, a good example is is E3M1 in that narrow passage where with the pinkies that seemingly retreat from you.

"Hey get back here!"

Share this post


Link to post

Interesting, doomguy instilling fear into Pinkies? Or leading doomguy into a trap? Hmmmmmmmm.

Share this post


Link to post

From my experiences, all monsters will stay still until they spotted the player. Once they spotted the player they will continuously move toward or around the player (or try to if they are separate rooms) until either they or the player dies.

Share this post


Link to post
Memfis said:

I noticed that sometimes a monster will target the player once he's done infighting, but other times he will stand still like he is unaware of the player. Why is that? Like, today I was playing e4m6, I got to the rocket launcher through a secret passage. A baron and a demon started to fight, I ran away. Then at some point I opened the door on the other side, the demon was dead and the baron was standing there not trying to reach me.

Monsters lose track of their original target when they acquire a new one, and will always become dormant when the new target dies. They may re-awaken immediately (you'll notice they make their alert sound again) and target the player under two circumstances:

* A player is still within their line of sight; or
* A sound made by a player has ever travelled through the sector in which the monster is currently standing (this is arguably a bug).

Share this post


Link to post

Monsters just really hate doing a 180° turn.


While vanilla does not have patrol routes for monsters, some ports do have that among their added features. There's even the Stronghold mod for ZDoom where monsters will stay on their patrol roads even while attacking the player -- they'll toss their fireballs at you but they'll chase to their next patrol point, not to you. It can give a sort of Tower Defense feel to the levels.

Share this post


Link to post

Doom's monsters are a great example of how a simple programmed "AI" behavior can have a more complex, unprogrammed, "emergent" behavior.

Doom's monsters can literally do only three things:

  • Stay dormant
  • Pursue a target (they always know the precise X-Y coordinates.
  • When they bump into walls and things, they don't despair: they simply try a new direction (out of 8 possible, heh) and keep walking in it. However, their target always acts as an "attractor" which affects which directions they will move towards, preferentially.
This can lead to interesting behaviors: e.g. if you escape a room and sit behind a door, window or a paper-thin wall that monsters cannot open or cross, sure, most of them will just gather round that passage like dogs besieging a cat on a tree, because the player's attraction is so irresistible.

However, if there is another way from that room to your position, some monsters will eventually find it because the player's attraction is yes, strong, but there's a small margin to escape it, and so you think that some monsters can eventually outsmart you ;-)

Also, their changing direction when bumping into walls may appear as if they are patrolling a zone, however they are always goal-driven towards their target, it doesn't matter much if they walk some extra miles towards it.

There are a few cases where monsters that can wander "goal-less": e.g. Lost Souls after bumping into their target, actually lose memory of it, and simply drift around, changing direction only when bumping into things. Don't be confused about their behavior with the player, though: they will still attack him on sight, unprovoked, like any other monster, and will concatenate several attacks if he keeps in their LOS after an attack.

Also, under exceptional circumstances, a monster may lose its target or acquire some impossible one (e.g. an unattackable thing, themselves, an already dead monster, an invalid pointer etc.) and behave erratically or wander pointlessly.

Share this post


Link to post
Foxpup said:

* A sound made by a player has ever travelled through the sector in which the monster is currently standing (this is arguably a bug).

Cool, thanks. I guess the door closed before I began fighting the nearby lost souls and so I never made a sound in the baron room.

Share this post


Link to post

I always found it interesting that Monster patrols were not implemented into Doom, seeing that Wolf 3D had a simple patrol logic that would allow soldiers to walk around without being provoked by the player.

Share this post


Link to post

But given the nature of demons I doubt they would simply patrol like a human soldier would, they would likely just roam I would guess.

Share this post


Link to post

Maybe the smarter demons would. I thin it would have been neat to look out a window on a Doom II city map and just see a Cyberdemon patrolling the streets. It doesn't see you or attack you, but you can still hear it's steps, which makes a bit more intimidating. imo

Share this post


Link to post

One of the few things I had always wished that id had put in the original game would have been an undirected, random-walk code pointer.

Share this post


Link to post

To the OP: Doom enemy behaviours are simple, up to the point of easily understandable and extremely predictable, once you have some experience with the game. Many Doom players and mappers actually consider it a strength of the game - because it means that player's success will depend on his skill, reactions and understanding of the exact game mechanics (and less so on pure luck), which makes the game highly enjoyable for me in particular.

Share this post


Link to post

This is becoming quite interesting indeed. Fleeing was something I never thought of. Things are getting complicated. Tis' a good thing.

EDIT/ I never thought that they would go back into Dormant stage. I thought that was something that only happened on runtime.

My guess is that they determine their target based on damage inflicted on them.

As such if they are infighting, and nothing else does damage they just go back to dormant instead of looking for a new target. That's pretty neat, so in theory you could clear a whole level through the use of explosive barrels. If you manage not to be seen that is.

By this I mean, you would not even see infighting. Because blame is not put on anything when a barrel explodes ya?

Share this post


Link to post

Ah yes, being heard...

On the topic of Fleeing

What if the target cannot be reached. As I understand it they will always flee. But I'm more to believe that if they cannot find their target at all then they will instead just go into "persuit" or "search" and look in the last known location of the target instead.

This:

Share this post


Link to post

Oh that's great! This helps tremendously, thanks for putting up with my questions. Thanks Scifista!

EDIT/ Quite a complex way to create AI but, I guess that's what makes it magic.

Share this post


Link to post
Foxpup said:

* A sound made by a player has ever travelled through the sector in which the monster is currently standing (this is arguably a bug).

I've never heard about this so I looked at the source a bit to see what the deal is.

* The sector definition has a member called "soundtarget" that is either null or points at a mobj
* soundtarget is only ever set in P_RecursiveSound() when flooding sectors with a noise
* P_RecursiveSound() is only ever called by a player's gunshot
* Once set, the sector's soundtarget is never returned to null, even after there is no longer any gunfire noise
* In the monsters' A_Look() state, they will check if the sector they are in has a soundtarget set, and if so, wake up

So, yeah, the result is that even if a monster has never seen or "heard" the player, going back to idle in a sector where a gunshot has been heard before will instantly wake the monster back up and set that player as their target.

I can sort of see how it probably ended up this way, because monsters can have the "ambush" flag so that once they hear a gunshot, they don't wake up instantly, but instead "lie in wait" until the player comes into view, at which point they wake up, even if they're not facing the player. But the "lying in wait" state isn't stored in the monster's data structure, like I had assumed, but instead indirectly, through the sector soundtarget - as in, if the sector has a soundtarget, then any ambush-flag monsters are assumed to have heard the player and are "lying in wait". This results in the side effect that normal monsters returning to idle in one of those sectors instantly hears the eternal gunshot echo too.

I don't know if you can call it a "bug" exactly, since it's doing exactly what it's coded to do, but it's certainly... illogical.

Share this post


Link to post
scifista42 said:

Sound propagates through sectors instantly, which makes it impossible to fire without being heard, unless there are monster sound blocking lines.

I have to correct you here, since those are different flags.

Share this post


Link to post

Right, sorry. The unpleasant thing is that, sometimes, I confuse them even while mapping. :/

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
×