jdolan / quetoo

Quetoo ("Q2") is a free first person shooter based on id Tech2. GPL v2 license.
http://quetoo.org
204 stars 28 forks source link

pmove-bug on certain non-axial geometry #652

Closed Panjoo closed 2 years ago

Panjoo commented 2 years ago

The old bug returns. It seems that the player can get stuck on certain non-axial geometry again, including clipbrushes.

Here's a drawing of one of the problem spots and I also recorded a short clip;

stickieclips

https://user-images.githubusercontent.com/10857572/147929132-0d2f079e-c00f-44d9-8907-9164dd8b27f6.mp4

jdolan commented 2 years ago

Yep, this is a recent regression and I know which commit likely did it. The rotator on Lava Tomb is also busted badly from this issue. I removed a special case optimization for traces where start and end are the same position. It looked like a relatively pointless performance thing but apparently the math also works slightly differently without the optimization. I was hoping @Paril would clean up my mess because he seems to love debugging pmove and collision… 🤣

jdolan commented 2 years ago

I think this is the huckleberry https://github.com/jdolan/quetoo/commit/42f72170b409b0892e0d4f6eada409b774178a48

jdolan commented 2 years ago

So, this is different than what I thought it was. The regressions for inline models (func_rotating, etc) have been fixed. @Paril is more familiar with the issue that you've found here, and may have some ideas as to how to address it.

Panjoo commented 2 years ago

Yes, I downloaded the latest snapshot from https://quetoo.s3.amazonaws.com/snapshots/Quetoo-BETA-x86_64-develop-pc-windows.zip At first it looked like the sticking issue got fixed, but I can still feel a bit of friction when sliding along slanted clipbrushes, like you see in that little drawing. It's noticable on the clipbrushes that are placed at doorposts. Just check out the SSG area on Edge and try to hump along the corridor corners.

Paril commented 2 years ago

My best guess atm is that it's a bevel we're colliding against.. this issue also happens in Q2 and Q3, but to a lesser degree (in Q2 it's a bit hard to repro on any base maps because they don't have too many sloped surfaces), so it's not necessarily a new thing. I'm not certain how we can solve it offhand.

Panjoo commented 2 years ago

Hmm, getting stuck on clipbrushes kind of defeats their whole idea. I'm sure this has worked better in Quetoo before. This is not like in Q2, which I still play regularly. You can get totally stuck on weird sloped surfaces yes, but not on clipbrushes that are just shaped like a triangle.

Paril commented 2 years ago

The specific instance in the video up above is likely the player colliding against the bevel that is created by the angled brush connected to the stair; it might also be an order-of-operations issue with the "step up" code (the bit that lets you climb stairs), maybe because of how little room there is between the stair and the bevel or something. It's hard to tell without further debugging, and traces are notoriously difficult to debug.

I'll have to see what happens on triangular brushes, but keep in mind that all brushes that are angled will create bevels, and I'm still suspecting that they are what's causing the issue. It might be possible to make it less apparent if the brush is embedded further into the wall so that the bevel doesn't connect to the wall laid against it:

Not 100% certain on this though since I don't even know if it's the collision against the bevel that's causing it.

Paril commented 2 years ago

It's also worth noting that there's a lot of factors at play that determine whether or not the collision acts strange. One such factor is your framerate, because it is linked to how many movement commands you can send to the server; the less movement commands you send, the larger your movements are, which may hide some imperfections caused by extremely small floating point values. It's possible you're only now noticing what we've been seeing for years because of your new GPU?

Panjoo commented 2 years ago

"It's possible you're only now noticing what we've been seeing for years because of your new GPU?"

I doubt this is because of a new GPU. Anything is possible of course but I've had older verions of Quetoo running with great framerate (a steady 250fps) in the past even on my old GPU. Another good test map is Tokays. In the room with the two tall elevators there are clipbrushes around the corner walls.

clippies

I've already tried to embed them further into the walls to no avail.

Paril commented 2 years ago

Yeah I see what you mean, you do hit against the edge sometimes and stop. Hmm

Paril commented 2 years ago

I pushed a new develop build which should help. It doesn't fix every edge case but it should feel like the older builds now.

Panjoo commented 2 years ago

Well it seems like it does, at least on the clipbrushes. Much better already.

Of course since I'm testing and trying to keep in contact with the walls as much as possible, I still get snagged here and there. I know that it is normal behaviour that you get bumped aside when colliding with those type of angled walls. But, after doing the same testing in Q2, it does feel like I have to try harder to get snagged in Q2 on those Edge walls and it doesn't stop me from ascending the stairsteps. Could this perhaps have anything to do with having a bigger player boundingbox?

Anyway the clipbrush problem is now solved it seems, which is an improvement.

Paril commented 2 years ago

The angled walls on q2dm1 don't line up with the stairs, I think that's the main reason for why you don't get caught as much there. It seems more like we're getting caught on the stairs and not the walls. If you move slowly enough up against a stair it will prevent you from climbing it, which is something I noticed a while back - probably something to do with one of the epsilons somewhere.

Paril commented 2 years ago

This should be fixed now in the latest push. It needs way more testing, but it's now impossible to get stuck against a stair even if you're moving at like 0.00001 ups against it, and this fixes the edge cases brought up by Panjoo.

jdolan commented 2 years ago

I can still get stuck on the curved walls inside the main arena if I'm jumping around with speed. I'll freeze, and then get yeeted (that's what the kids are saying, right?) hard and sometimes even crater. Perhaps the 2nd half of the fix lies in Pmove() and not trace tho? Overall, I'm not sure this is an improvement yet, as I didn't get stuck in walls before when flying around the map. It was only the corners of these stairs that were problematic..

jdolan commented 2 years ago

@Paril Latest changes look great to me. I'd be happy to call this one closed if you are.

Panjoo commented 2 years ago

@Paril Movement is smooth as butter again, good stuff man! 👍 This can be closed.