squeek502 / bunnyhop-webgl

Quake/Half-Life style bunnyhopping in WebGL/BabylonJS
https://squeek502.github.io/bunnyhop-webgl/
The Unlicense
10 stars 2 forks source link

clipVelocity when colliding with a ceiling sloping away from the player #2

Open squeek502 opened 4 years ago

squeek502 commented 4 years ago

From #1:

I have the surfing setup however there is a little problem, going behind slanted ramps results in the error: clipVelocity with 0 backoff. I would try and debug and see why however I actually am not good at physics nor maths at all and am trying to build myself up by trial and error.

https://i.imgur.com/hPWo76g.gifv

From https://github.com/squeek502/bunnyhop-webgl/commit/4048c3639c39c76d1013b6f1374eb7e07809e97d:

AFAIK 0 backoff is not universally a problem, and can happen when e.g. running into a ceiling angled away from you. This needs more investigation to be sure, as the velocity clipping seems to behave strangely when doing so (but doesn't fail, so removing the throw here is a fine first step).

Need to test how this behaves in the Quake/HL1/HL2 engines.

squeek502 commented 4 years ago

Something is definitely wrong. Wall-strafing into a ceiling sloping away from you in the Source engine is similar to wall-strafing into a flat wall. Doing the same in the web browser slows you down to a crawl.

Not sure exactly what the cause is, but it's definitely a bug.

squeek502 commented 4 years ago

I was wrong again!

Avoiding the slowdown is something specific to the Source engine--in HL1 you get the same slowdown when wall-strafing into a ceiling sloping away from you.

So, not really a bug, just a difference in implementation between engines. Worth keeping in mind.