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

I would like to have patrolling enemies that work like they do in wolf3d.

Recommended Posts

In other words, I would like them to be basically identical to regular unalerted monsters in every way, except for the fact that they're standing still.

 

That's how they work in wolf3d, and they have special patrolling states and actions for it. But when ZDoom introduced its patrolling monster feature (which, by the way, I don't remember ever seeing in a mod, aside from that friendly disco are in Mock 2), they had to make it compatible with existing actor classes, so they just reused the See states and the Chase action I guess. It's a good idea overall, since that lets them use their regular pathfinding to get around small obstacles, instead of potentially getting stuck on each other like in wolf3d. But it's also imperfect... recently, I made a test map to finally try out the feature for the first time, and I had problems with it.

 

  • they didn't react to gunfire at all.
  • they had a 360* field of view, and turned around to chase me as soon as I was in line of sight, no matter which way they were facing.
  • they made the same roaming noises while patrolling as they did while chasing, which I guess is not objectively wrong but still questionable.
  • they didn't even make an awakening sound when they switched from patrolling to chasing.
  • the ambush flag seemed to have no effect whatsoever...

 

If you want to see it for yourself, here's a test map I used so you don't have to make your own:

zzzpatroltest.zip

I recommend noclipping outside the walls to observe the monsters without them seeing you. Otherwise, it's hard to see that they patrol at all.

 

 

 

With all that, it's no wonder I haven't seen much of this feature... I wonder how feasible it would be to actually implement it well in Doom. It seems it would be either impossible or cumbersome to do in Decorate, but maybe it could be easier in ZScript? I haven't looked much into ZScript at all, but it seems capable of tweaking the game systems pretty fundamentally. So maybe it could be implemented elegantly with it.

 

To reiterate, the way I'd like it to work is just like the idle state, but with moving - they start chasing the player if they hear a noise, they chase if they see the player but only if the player is in front of them and not behind, they make a wakeup noise when they start chasing... and so on.

 

It would be pretty neat if it could be implemented to work with default monsters, but I'd be fine with a solution that requires new actor definitions. For a mod with custom actors, it would be a lot more straightforward... in fact, I can ALMOST implement it in Decorate...

 

  1. Have the default See state sequence be used speficically for patrolling
  2. Use the A_LookEx function inside that sequence, to look (and listen) for enemies just like normally, and jump to a separate state upon seeing the player, which is already possible thanks to A_LookEx's label argument...
  3. Use a separate function to pathfind to the patrol point, something like A_Chase which is already pretty customizable in ZDoom, but it doesn't let me change the fact that monsters immediately switch to chasing the player upon "seeing" them??? Why does it even happen? the zdoom wiki doesn't say anything about it, which kinda makes sense for a weird hacky situational thing, but still.

 

Crazy frustrating to be tripped by that one unfitting puzzle piece. I wish I could just redefine A_Chase... but I don't even know how exactly the function works originally. Here's a much more straightforward question, where is that thing even defined? I looked in both gzdoom.pk3 and in the actual source code on github, and couldn't find it.

 

So yeah.

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
×