Okay, I said that I'd share my knowledge (read: guesses) about guideless glides so I guess I'll do that now.
To start, I'd like to make a change to my earlier taxonomy. I've taken a liking to the term "gap glide" rather than "standard glide" as it's more intuitive. The subject of this post will be "guideless gap glides," or "guideless glides" for short as the guided/guideless distinction doesn't apply to wobble glides.
It's only going to get more complicated from here.
My first point of reference after deciding to learn how to perform these glides was this post by cack_handed. The techniques I use in my Epic 2 demo are so much the same as those listed here that the differences aren't worth noting. Also, the most important insights about how these glides work can already be found in that thread, but in this case I may be able to offer a few refinements.
For instance, a common belief (if beliefs in a field as esoteric as this can be considered "common") is that, for a guideless glide to be possible, the player must position himself exactly in front of the center of the gap, and then move directly into it. Speaking strictly, this isn't the case. After I managed to record my first successful glides on Epic 2 MAP07, and after I got Doom Replay Editor 2 (download) to work, I was surprised to learn that at the moment of each successful glide the player moves from a position that's outside the gap, and just barely off-center with it, to a position that's centered in the gap, and already a small distance inside it, in a single tic. This microscopic teleport surprised me, but I think it can be fully explained within Doom's intended movement logic. But, to tell you that story I'll have to tell you this one: the phenomenon of sideways drifting when attempting one of these glides can also be explained within Doom's movement logic.
The explanation behind "drift" is actually so simple that it hardly deserves its own paragraph. The truth is that, when playing with a reduced turning resolution (eg. when recording a vanilla demo), the four orthogonal directions that the player can face aren't orthogonal at all; instead of lining up perfectly with the map's axes, these directions are turned to the left by about 0.01 degrees. I discovered this by recording a demo of the player simply running forwards and backwards along one of these "orthogonal" directions, and then studying the resulting demo in DRE to see the player's position at each tic. For every 5000 map units (roughly) that the player moves forward along one of these directions, he will also move to the left by one unit. Because of this, when the player runs "directly" into a wall, the angle of his approach causes him to drift just slightly leftward.
This factoid allows us to explain a successful glide within the terms of Doom's movement logic. (The following explanation should probably be taken with a grain of salt, as my only understanding of Doom's movement code is what I've been able to glean and extrapolate from this post by 4mer.) When calculating the player's movement during a single tic, the normal (low-momentum) case is that the engine makes up to two checks. First, the engine looks at the player's momentum for that tic, calculates a displacement vector from that momentum, and then checks whether the position where that vector would place him is legal (ie. not intersecting any lines/things the player can't walk over). If it is legal, then the player is placed there and that's the end of it. If it's illegal, then Doom tries to "slide" the player along the line (or one of the lines) that caused the first check to fail by reducing the displacement vector to the component that is parallel with the offending line. Then, Doom moves the player according to this new vector (assuming that the resulting position isn't also illegal).
Performing a guideless glide requires the first check to succeed. During a tic where a guideless glide succeeds, the engine has first calculated the player's momentum (taking both the player's input for that tic and leftover momentum from previous tics into account), calculated a displacement vector from that momentum, and decided that the resulting position from that vector is perfectly one-hundred-percent legal. Because the "orthogonal" directions that the player can face aren't truly orthogonal, the displacement vector will always have both "forward" and "left" components to it, so the only original positions from which a move into the gap can be can be considered legal are, in fact, some miniscule distance to the right of the gap entrance. A glide succeeds if the "sideways" component of the displacement vector calculated during this first check is perfectly sized to place the player in the exact center of the gap, and because that same displacement vector also has a "forwards" component, the player will be moved some distance inside of the gap in the same tic. This is the cause of the "microscopic teleport."
If you're still reading this, then I'm sure that the first question on your mind, which you've been patiently waiting for me to answer, is, "What's the easiest way to do these glides?" Well, if my relentlessly exact language hasn't already made its message clear, let me spell it out: there's no easy way. However, there is a "safe" way and a "fast" way, both of which should become reasonably possible to perform with practice and a good set-up. Before describing them, however, I'll have to plunge you neck-deep into seemingly irrelevant details just one more time!
Doom Replay Editor writes out the X and Y coordinates of the player after each tic down to six decimal places. I noticed while studying demos that the smallest amount of movement possible along one of the map's axes appears to be roughly 0.000015 map units. I'm going to hazard the guess that the Doom engine considers this distance as 1/65536 of a unit, and that a unit's worth of distance can be broken up into 65536 of these "micro-units." What makes a guideless glide difficult is that you need to come up with a displacement vector that places the player exactly in the middle of a 32-unit gap, instead of in one of the 65535 other positions that all return the same coordinate value when you type "idmypos." Also, there's essentially only one tic per glide attempt during which there's a chance that the glide will succeed. Remember, if the first check in Doom's movement code fails, it will "slide" the player, so, if you're almost lined up with the 32-unit gap, but the sideways component of your movement vector for the next tic is just a little bit too large, you'll slide past the opening and fail the glide, without receiving any visual indication that you have done so.
When the odds are this steeply against you, it's astounding that these glides are possible at all. Here's how cack_handed's method beats the odds:
- By playing at vanilla resolution, you can study the pixels visible on-screen to narrow down your position. When the player's face is pressed directly against an orthogonally-facing wall, he can see 32 units' worth of texture. At 320x200 resolution, each texture pixel is ten screen pixels wide. Therefore, you can ensure that you're standing within the correct tenth of a map unit by positioning yourself so that the right pixels are showing. (Theoretically, you could pinpoint your exact location even more finely when playing at higher resolutions, but it becomes much harder to identify individual columns of pixels as screen resolution increases.)
- It just so happens that, when sliding left towards the center of a 32-unit gap, at the moment that the first column of screen pixels of the texture on the front face of the left pillar comes into view, the player is positioned about a twentieth of a unit from the gap's center. Human reaction times being what they are, it's likely that the player will be even closer to the center of the gap by the time he releases his "move forward" key (assuming he hasn't overshot it entirely). It's a bit odd that the player can see more of the left side of the gap than the right one, even when still positioned to the right of the gap's center, but this may be because, as mentioned earlier, the player is turned 0.01 degrees to the left of what you'd expect.
- With a slow enough forward approach, it's actually possible for the player to slide sideways by only one micro-unit per tic, guaranteeing that the glide will ultimately succeed. (On one tic, the player will be located only one micro-unit to the right of the gap's center - on the next, the player will end up inside the gap.) This repeated movement of 1/65536 of a unit per tic will be the result if the player can somehow feed the engine an endless stream of GF2 (Go Forward 2) commands. The part of Doom's movement code that handles sliding takes the movement vector of a GF2 tic and flattens it into a vector that moves the player only 1 micro-unit along the wall. (The distance that a GF1 tic moves the player is so slight that the sideways component of the movement vector seemingly rounds to zero.)
Ta-daa! We have perfected the art of guideless gliding - in theory. Looking at the matter practically, there are still a few things to consider. Let's imagine that an aspiring glider has positioned himself as accurately as possible with pixel cues, and is now somewhere within one-twentieth of a unit to the right of a gap's center. Let's also suppose that, thanks to a perfect set-up and diligent practice, our glider is able to send a pure stream of GF2 commands to the engine. Well, one twentieth of a unit is around 3277 micro-units, and each second has 35 tics, so it'll take up to ninety-four seconds for the glide to happen. I'm calling this the "safe" way to do a guideless glide, because it's not fast.
If you want to perform a guideless glide in a reasonable time-frame, take a chance and do it the "fast" way. To give you a sense of what the "fast" way looks like, I'll analyze my own demo.
After I first approach the bars, I spend a few awkward moments crudely positioning myself, lining myself up with the gap in front of me as best I can. Then, at tic 1299 the sex metaphor breaks down as I start running forward - a series of GF50 tics is a "quick" way of moving to the left. At tic 1436 I'm done tapping my "run forward" key and all existing momentum has resolved. I'm quite lucky, because I'm now resting only 230 micro-units from the center of the gap. At tic 1484 I start pushing my mouse forward, and only 12 tics later I botch the glide. My Go-Forward commands have an average value of 5, but the sideways momentum caused by them is already large enough to take more than one tic to resolve, so my momentum during each tic is increased by a slight additive effect. This results in my displacement vectors being big enough to send me skipping 10-30 micro-units to the left every tic, so the odds of landing on the correct micro-unit really were quite low. I have no way of knowing that I've already blown the glide, so I keep up the attempt until tic 1577, when I finally abort it by turning one player-angle-unit to the right and moving forward to quickly slide back to the right side of the gap. (Note that it's also possible for a glide to succeed during these return trips - it's just much less likely that the player will land directly in the middle of the gap when he's sliding at such a "fast" pace.) At tic 1606 I start running into the bars again to slide back left into position, and at tic 1701 I come to rest, and again I'm quite lucky - I'm only 151 micro-units from the gap's center. I start moving my mouse forward at tic 1722 (a little slower this time) and on tic 1739, a lucky jump of 13 micro-units puts me square inside the gap.
This is the fast way. The odds are never in your favour, but with more practice and finesse than are on display in my demo, you should be able to make a complete glide attempt in only a few seconds. Then, it's your choice whether you string multiple glide attempts together in a single run attempt or restart your run in between. Either way, the glide will eventually succeed.
The most important skill to practice is positioning yourself (with GF50 tics) as close as possible to the middle of the gap without going past it - it's kind of like "The Price is Right." I believe it should be possible to develop a "feeling" that will help you enter this sweet spot fairly consistently. Also, if it's ever important that a glide succeed in its first few attempts, remember that can increase the chance of success of a single glide attempt by making smaller forward movements during that phase of the attempt.
Well Grazza, I'm glad you read all the way through, even though nobody else did. ;)
PS: I have absolutely no idea why east-west glides are easier.
PPS: I think that all of this may also have some bearing on guided glides. I may analyze a few more demos and return to that topic later.