Invalid Why we need thok barriers?

Status
Not open for further replies.

Fred

Member
So I was reading up on some old Doom bugs, and I came across this.

When a player encounters an obstacle, the game will attempt to "slide" the player alongside the obstacle. Presumably to improve the accuracy of collision detection, at high speeds the game will split the player's path of movement into two segments and test each segment for obstacles. No check is made to ensure that the player did not already slide along the wall once, so if the obstacle is present in each of the two segments, the player will slide along the wall twice in the same tic, effectively doubling the player's speed.

The bug only occurs when the player is traveling quickly enough to the North and/or to the East. This happens because the player's path is not split into segments unless his X or Y movement is greater than a certain amount. However, no check is performed to see if the player's speed is smaller than the negative of that threshold (i.e. the player is traveling just as fast South and/or West), so the bug is not invoked.
So let's break this down. If I'm understanding this correctly, when you're moving slowly, the game checks a short distance directly ahead if there's something solid. If it finds one, it stops you in your tracks.

When you're moving fast, though, the point which the game tests for solid obstacles is much farther away from your own position, so that it can react in time. However, since it's such a long distance away, somebody decided that it would be smart to instead check two points: the one that's far away from you, and a point in between. This way, if by any chance the point that gets tested for collision ends up PAST the solid obstacle (read: past the otherwise Impassable wall), the halfway point will catch it instead and correctly prevent you from going through the obstacle.

There's always something that's bugged me about the wall permeability bug in SRB2. Northern and Eastern walls work fine, but Southern and Western ones are as effective as a big sheet of paper. Why should this be?

The bug only occurs when the player is traveling quickly enough to the North and/or to the East. This happens because the player's path is not split into segments unless his X or Y movement is greater than a certain amount. However, no check is performed to see if the player's speed is smaller than the negative of that threshold (i.e. the player is traveling just as fast South and/or West), so the bug is not invoked.

Because apparently, the game only tests two different points of collision if your X or Y speed is GREATER than a certain amount. Imagine that the threshold is 8. So if your X or Y speed is greater than 8, two points are tested for collision. Your X or Y speed can only be greater than 8 if you're travelling to the north or east -- where collision in SRB2 works fine -- if you travel to the south or west, your speed will be -8! Is -8 greater than 8? No! So only use one point for collision testing.

Am I right? Can this be researched? Can we fix this?
 
Last edited by a moderator:
Fixing it will improve wall collision, but it won't eliminate the necessity of thok barriers.
 
Apart from cosmetic aspects? I know they're still needed to make open-air levels, but don't north- and east-bound one-sided walls work fine? Unless I'm missing something, this could even fix the deprecated Impassable linedef flag (and Block Monsters, where it fails).
 
Nope, the only thing this will fix is when you seem to get stuck in a wall. You'll still be able to run through lines if going fast enough.

Go ahead and make some north and east walls. You can still thok through them.
 
Only through sharp corners, it seems.

Here's a test wad. The GFZ-styled room (with soft corners) seems perfectly solid, but you can thok right through the NE corner in the THZ-styled room (with sharp corners).

Fixing this and reviving the Impassable flag would still allow to simplify a lot of gimmicks which would otherwise require a fake floor or an invisible FOF to do, so it would still be useful.
 
Last edited:
well, considering that Doom's MAXMOVE was 30, and SRB2's is 60, maybe we need to divide the movement by 4 instead.

Note that for objects with a radius smaller than 15, this will continue to pose problems.
 
I'm still all for this idea, though. Even if it doesn't have the intended effect of eliminating the need for thok barriers, collision improvement and the revival of the Impassable flag is still a pretty sweet deal.
 
Would it be possible to apply a similar 2 or 4 point collision check for falling(and flying into the air I guess) in regards to colliding with other objects? If that were possible and you checked enough points to allow a player-sized object to always meet with the player when passed through at the speed attained from jumping at 4096 units above the ground, that would effectively eliminate GFZ Crawla Clipping syndrome. Furthermore, I believe that if multiple speed thresholds were used to determine how many collision points to use (if > 60, if > 90, if > 120 etc), the impact on performance could be mitigated somewhat.
 
Last edited:
*salivates at everything you guys are saying*

...Please do this. It's not every day that a fundamental physics change gets proposed. I hope to see this in the next version of SRB2.
 
We need to use thok barriers to prevent players from going outside the level.
The Hall of Mirrors effect that was in 1.09.4 has been removed ever since 2.0 came out.
 
We need to use thok barriers to prevent players from going outside the level.
The Hall of Mirrors effect that was in 1.09.4 has been removed ever since 2.0 came out.
Um, did you read the introductory post? The point is that he was proposing a change to the EXE that might theoretically eliminate the need for thok barriers. Sadly, the devs have debunked this claim, although the modification could still aid in collision detection.

Also, what are you talking about? Hall of Mirrors still exists.
 
We need to use thok barriers to prevent players from going outside the level.
The Hall of Mirrors effect that was in 1.09.4 has been removed ever since 2.0 came out.
Thanks for stating the obvious that everybody knows about (Hint: Read the first post, not only the topic title) and something that's just wrong. Hall of Mirrors is a glitch, not an effect, and it still happens in Software mode.
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top