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

Random(ish) monster spawning in vanilla

Recommended Posts

Linguica said:

Best played in Chocolate Doom (or doom2.exe of course). Doesn't work properly in ZDoom, and has a... weird... side effect in PrBoom / PrBoom-plus where I guess blood splats can go through teleporters?

There are also teleporting blood splats in Eternity. But that's because blood splats can always teleport in Doom.

Playing a vanilla recorded demo in Eternity works just fine, without seeing the blood teleport, so I suspect it's a pointless Boomism changing how things clip or something else.

Share this post


Link to post

Since no1curr, I will just post an explanation.

  • Monsters behind sound-blocking lines only wake up when they see the player.
  • Monster eyeballs are at 3/4 of the way up their height.
  • They can (obviously) only see past an infinite crusher if there is an unobstructed straight line through it to the player.
  • Monsters also only wake up if they see the player when it is during the first tic of their frame change.
  • Most monsters have wait states with frames of length 10. (I think the Mancubus might be the only exception with 15? I didn't do a rigorous evaluation)
  • It is fairly trivial to make an infinite crusher with a period of 10 tics.
  • Therefore, a monster behind an infinite crusher with a period of 10 tics will either always wake up, or never wake up.
  • Finally, all monsters have the length of their very first dormant state pseudorandomly generated.
The result is that when the level loads, the monsters are effectively divided into ten "groups," and you can have only a portion of these groups actually wake up ever. This could be used for unpredictable ambushes, or... uh, I dunno.

Share this post


Link to post

Nice. I wonder if you can also rely on perpetual lifts for this kind of randomness, which seems easier to build.

Share this post


Link to post

Here is another idea: Put a crowd of different monsters into a large dummy sector (#1) full of WR teleport lines, all of which leading into a small dummy sector (#2) containing a bunch of W1 teleport lines behind each other, and those leading into many different small dummy sectors (#DUMMIES), each of them containing a WR teleport line into a different place in the map. Monsters inside #1 are supposed to be awakened early on, for example by hearing player's gunshot. The teleport destination in #2 would be initially blocked by a barrel, supposed to be blown up later on. When the barrel unblocks the teleport destination, the monsters should randomly distribute into different #DUMMIES to consequently teleport into the map when allowed to do so.

jmickle66666666 said:

split W1 lines

Those aren't actually random, I believe if the monster/player crosses multiple ones, they will be processed in a fixed order according to their position in blockmap, or by linedef index, not sure which one.

Share this post


Link to post

it's trivial to position them in a way that means the player can only cross one of them, and re: random; its just as random as the OP map (i.e unpredictable, but not random)

Share this post


Link to post
scifista42 said:

Those aren't actually random, I believe if the monster/player crosses multiple ones, they will be processed in a fixed order according to their position in blockmap, or by linedef index, not sure which one.

Is it even possible for one object to cross multiple lines at the same time?

Share this post


Link to post
jmickle66666666 said:

seems like there are much easier and more useful ways to get pseudorandom occurances just by using split W1 lines, not just limited to monsters.

I did not claim this was either easy or useful

it is, however, pseudorandom in a different way than any other method I've ever seen, since it only relies on a particular time interval tied to player movement, and not to the player movement itself.

Share this post


Link to post
jmickle66666666 said:

maybe that explains why no1curr

does make me wanna implement my random level gen idea


Do you mean something like OBLIGE, or more like an idea I had?
My idea was to make a large grid of 64x64 sectors, and use ACS with a maze generation algorithm to make a maze the player has to go through. There would be monsters and ammo/health spawned as well.
Too bad I never got around to doing it, and from what little I got done it was pretty boring to play through so I decided to give it up.

Share this post


Link to post

I heart random

I keep meaning to try making a map that has a random layout/route, although i think that might annoy some players.

Share this post


Link to post

The problem with expending a lot of effort to try and make stuff randomized is that a player will probably only play the level once and so the effort is, almost by definition, totally unnoticed.

Share this post


Link to post

Haha, that would be a weird trick. You could edit the WAD file to make all 32 sets of map lumps point to the same data too, to keep the file size surprisingly small. (Or have all the lumps except THINGS point to the same data, so later levels could have more / bigger enemies, I guess.)

Share this post


Link to post
printz said:

There are also teleporting blood splats in Eternity. But that's because blood splats can always teleport in Doom.

Playing a vanilla recorded demo in Eternity works just fine, without seeing the blood teleport, so I suspect it's a pointless Boomism changing how things clip or something else.

Blood splats from crushers were always intended to spray in random directions. From PIT_ChangeSector:

// spray blood in a random direction
mo = P_SpawnMobj (thing->x,
                  thing->y,
                  thing->z + thing->height/2, MT_BLOOD);

mo->momx = (P_Random() - P_Random ())<<12;
mo->momy = (P_Random() - P_Random ())<<12;
However in Doom, moving things can't pass through solid things, even if the moving thing itself is non-solid. So spawning a blood splat inside a monster means it is stuck in place and can only fall to the floor. Boom removed this restriction, which I don't think was an unreasonable change to make; if a moving solid thing can pass through a non-solid thing, then by symmetry a moving non-solid thing should be able to pass through a solid thing. Plus it allows greater possibilities for sliding death exits in speedruns if your corpse can't get blocked by obstacles. :)

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  
×