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

The Doom Movement Bible

Recommended Posts

Is there anything that would lead to one-sided and two-sided linedefs being treated differently when it comes to wall running? I have a memory of an outdoor TeamTNT DM level where you could wallrun around the perimeter fence really easily. As I remember, the fence was a simple axis-aligned two-sided impassible linedef box.

Share this post


Link to post

Yes, for some reason 2S impassible linedefs are ignored by the PTR_SlideTraverse function, which checks to see if a linedef can be slid on. More specifically, the pseudocode is like:

if(line is 1-sided OR opening is too short OR ceiling is too low OR floor is too high)
    add to line slide list
else
    return
Note that it never actually just checks if a linedef is impassible. Sliding along 2S impassible lines ends up being functionally identical to thingrunning - the engine never knows what to do so it always resorts to the stairstep routine. (So if the 2S impassible linedef happens to be axis-aligned it will work "normally", even though it's kind of an accident.) That's why rubbing on the fence to the left of the start of Doom 2 Map01 feels so weird.

Share this post


Link to post
chryso said:

Is there anything that would lead to one-sided and two-sided linedefs being treated differently when it comes to wall running? I have a memory of an outdoor TeamTNT DM level where you could wallrun around the perimeter fence really easily. As I remember, the fence was a simple axis-aligned two-sided impassible linedef box.


Linguica beat me to it, but you can construct a square room in any map editor to create/duplicate the scenario. Place one 2 sided line and run against it. Now opposite of that line create a rectangular sector equal in length, and raise that sector 32 pixels high. You can compare the difference that way. I've used raised sectors as windows or other objects to get around it, and I'm sure I wasn't a pioneer. I think earth.wad from 1994 gave me the idea.

Share this post


Link to post

Oh the fun...

That brings back memories of 12-13 years ago when I ran into all those glitches and tried fixing them.

To be honest, I'd have problems playing with all those things still present these days.


That 2s omission in the sliding code was the first one I went after back then.

Share this post


Link to post

I always thought they must have done collisions with square box, cause with circle the player would be stuck in every 270 degree corner when sliding a wall. I wonder if in todays games the still have cube as a collision box. I would even trust it, cause its a lot simpler and saves a lot of pain in arse.
Only one bad thing about it . Does this mean that in orthogonal direction you will pass 32 pixels wide corridor and in diagonal 45 degree the corridor will have to be 32*sqrt(2)?

Share this post


Link to post
NinjaLiquidator said:

Does this mean that in orthogonal direction you will pass 32 pixels wide corridor and in diagonal 45 degree the corridor will have to be 32*sqrt(2)?

Yes. It also implies that every hitscan/projectile attack has a higher chance to hit a thing under a 45 degree angle than under an orthogonal angle, simply because the thing's "radius" is wider at 45 degrees.

Share this post


Link to post

Adding my vote of approval. Great job, Linguica! This must have taken you weeks to research, and it answers countless questions on this and other forums.

I guess in your research, you added some instrumentation to your personal Doom source port. For example, the display of the TAP. I'd be interested to know (without too much hassle), what statistics and instrumentation you added, and how you captured and studied that data. Cause I can imagine that this would require analysis of a lot of data, while being able to repeat very specific tests!

Again, your efforts are very appreciated. Wow!

Share this post


Link to post

amazing info, thanks

make it sticky, link it to the wiki or so

Share this post


Link to post

What about the monster's ability to activate slow walkthrough lifts and them always being stuck when they're on an edge?

Share this post


Link to post

^ The slow walkover lift is one of several linedef types hardcoded so that monsters can activate them. And when a monster happens to be in a place where the height difference between its feet and the lowest point on the floor below the monster is greater than the max step height (24 units), and cannot get out of such a position by making a single step in any direction, the monster becomes stuck.

Share this post


Link to post

While this topic explains how the classic E2M6 glide and similar ones work, there are some other glides which I didn't understand at first:

* The new E2M6 glide which is on a different corner and uses a rocket boost, as seen for example on the E2M6 0:17.97 by Zero Master: https://dsdarchive.com/files/demos/doom/45940/e2m6p017.zip

* The demos where you can void glide on the corner between an angled wall and a non-angled (horizontal or vertical) wall: https://www.doomworld.com/forum/post/2340506 (uses -turbo) and https://www.doomworld.com/forum/post/1348983 (no -turbo)

 

The conceptualization to understand those demos is that doing a void glide consists of two parts which you can see as independent:

  1. Build up a lot of speed (near MAXMOVE=30 in one or both of the X and Y axes).
  2. Hit the corner where the two walls meet in a very precise way.

 

When you do the glide between two 45º angled walls such as the E2M6 glide, you get both parts at the same time, as hitting that corner will allow you to build speed, and after you have built up enough speed, you just need to get lucky to hit that same corner in the right way. Also in this case you also benefit from the wall running "double-TAP" bug mentioned in the OP by Linguica which gives you a lot of leeway in how you hit the corner.

 

However, looking at both parts separately allows you to explain a wider variety of glides.

 

--

 

(1) Build up a lot of speed (near MAXMOVE=30 in one or both of the X and Y axes).

 

You can't get a speed near 30 by doing a normal SR40 or SR50 input, you need help from other sources. However, there are various other ways that I can think of to get to a speed near 30 in one or both axes:

 

  • Getting trapped between two angled walls like the ones in the classic E2M6 void glide
  • -turbo cheat (of course, this is cheating, but this is great to test)
  • Sliding against specific angled walls will build speed near 30. For example the one in TNT Map32 you can see in this demo: https://www.doomworld.com/forum/post/1348983  . Note that this is NOT the same as the "wall running" trick mentioned in the OP by Linguica, when you are "wall running" you are moving very fast, but it's because the game is moving you twice in a tic, not because your actual speed is high. Only specific walls have this property where you can build high speeds by sliding, most walls will either have a speed cap below 30, or eventually "eject" you and cause you to lose speed if you try to slide against them.
  • Damage boosts (from enemies or your own rockets). Doing it this way you will only get near 30 for a tic, since you will lose speed very fast due to friction. (However, if you are in the air, you will get no friction, so you can keep the speed for many tics, but you will lose control of your character. Due to this it will be very hard to do a void glide this way, I haven't seen any demo using this.)

 

--

 

(2) Hit the corner where the two walls meet in a very precise way.

 

Ideally, you should hit the intersection where the two walls meet in the following way:

 

  • Obviously, the tic you want to glide out, you should hit the sliding wall at the furthest point you can in the axis you want to glide out. Unless you are TASing a demo, the point of the sliding wall you will hit is basically random, so you just need to try over and over.
  • Your speed should be as parallel to the sliding wall as possible, otherwise some of your speed will be lost.
  • Your speed should be angled with one of the angles where you get a speed boost due to the P_AproxDistance approximation, see the OP by Linguica. This is absolutely necessary since this is the only way your speed can rise from 30 to 32 and above.
  • The wall you are NOT sliding against should block your movement, this way the P_SlideMove algorithm will do the boost by P_AproxDistance two times. This will always happen since you are hitting the intersection.
  • Your X or Y speed should be positive, this way the "double-TAP" bug will let you move twice in a single tic so you can get up to four P_AproxDistance boosts in a single tic.
  • Your position (i.e. your hitbox) should be as physically close as possible the wall. If you hit the sliding wall but you aren't as physically close as possible, you will lose a lot of speed, even as far as instantly going to zero if you hit the wall in the worst way possible (your speed is multiplied by a variable called "bestslidefrac" in the code which does this). Again, unless you are TASing a demo, this is basically a combination of random, and the method you are using to build up speed.

 

The bad part is that often you can't control many of those factors, since you need to do this right after the trick you used to build up a lot of speed. The good part is that the amplification you get from a good P_AproxDistance boost(s) is huge, so as long as your speed is angled in the right way, you can miss a lot of those conditions and still glide out.

 

--

 

With this in mind we can explain the two glides:

 

In the E2M6 0:17.97 by Zero Master, the method to build speed is to get trapped between the two angled walls, this works similarly as the classic E2M6 glide. However, unlike the classic E2M6 glide, getting momentum by getting trapped between those two angled walls does not automatically glide you out, because the speed vector is still not good enough to glide you out when meeting the intersection of the two walls (since the walls are not angled at 45º, he doesn't get to 30 speed in both axes, but only in the X axis).

 

By getting damaged by a rocket in the right way, he gains more speed, and the way he hits the intersection where the two walls is more favourable (given the above conditions) and he can glide out.

 

In the TNT Map32 Void Glide, the method to build speed is sliding against a specific angled wall, this will get a Y speed near 30. However, unlike in the E2M6 glides and the explanation by Linguica, there's no "positive feedback loop" at all at the interesection of the two walls here. Instead, it is simply of trying over and over until I get very lucky so that at the last tic of the run against the angled wall, I hit the very end point of the angled wall, I get a boost by P_AproxDistance, and my Y speed goes over 32, which allows me to simply glide out against the other wall which is perfectly horizontal.

(If I missed the trick here, I would simply stop dead in the tracks, there's no "wobble" at the intersection).

 

Edited by A_CyberAttack

Share this post


Link to post

Is GZDoom supposed to have item bumping? I somehow got the yellow key in CATWALK.WAD without lowering the platform and I was so confused at first. Thought GZDoom would have had completely different collision detection for item pickups by now given that almost everything else is so far removed from original Doom?

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
×