Closed ethereumdegen closed 4 months ago
I'm wondering how this should connect to #10 and #11.
Imo, if we had to pick between this and #10 as a feature, I think we should pick the max slope. While a slippery ground is a bit of a gimmick, next to every 3D game has varying slopes, so forcing them all to use perfectly "straight" walls everywhere the player shouldn't be able to go through is a bit of a bummer
The reason I want to connect this to #10 is that setting a max slope is slipping. If the player jumps on a steep slope, we want to make them slip down. If I separate between the slope detection and the slipping down, the same two features can be used:
Steep Slope | Slippery Surface | |
---|---|---|
Surface Detection | Check normal | Check surface components |
Slipping | Set to full slipperiness (can't climb up) | Set partial slipperiness (can move slower, with less acceleration) |
I agree w this — for open game worlds like mine its very useful to be able to say 50 degree slopes are impassable” as a hard set limit instead of relying on wonky physics only because its very important to be able to control player agency and esp without making invisible walls yes exactly
I see commonly this is achieved by casting multiple rays / sensors or i suppose reading the normal of the collision in front idk
On Thu, Feb 22, 2024 at 1:35 PM Jan Hohenheim @.***> wrote:
Imo, if we had to pick between this and #10 https://github.com/idanarye/bevy-tnua/issues/10 as a feature, I think we should pick the max slope. While a slippery ground is a bit of a gimmick, next to every 3D game has varying slopes, so forcing them all to use perfectly "straight" walls everywhere the player shouldn't be able to go through is a bit of a bummer
— Reply to this email directly, view it on GitHub https://github.com/idanarye/bevy-tnua/issues/42#issuecomment-1960034491, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPVWL4K6QSUFYAZDTPPXJTYU6FY3AVCNFSM6AAAAABDQJXUOOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRQGAZTINBZGE . You are receiving this because you authored the thread.Message ID: @.***>
Okay, Okay...
Here is the plan: I'll add a new max_slope
parameter to TnuaBuiltinWalk
, which will default to half PI (right angle). If the angle between the proximity sensor's normal and the up direction is higher than that, the basis will go into "lost grip" mode, which would mean:
One problem I can think of with this plan is that if the game allows unlimited air dashes, these air dashes could be used to force the character up the slope. Not sure how urgent it is to address it though.
Aah @idanarye, I see now. Didn't think of impassible slopes as slipping before, but you're totally right!
Took me quite a while (mainly because this is PITA code and I had other stuff to work on), but it seems to be working quite nicely:
https://github.com/idanarye/bevy-tnua/assets/1149255/98869b1a-798f-4992-8153-ce4e79b784c0
As you can see in the video, it doesn't work very well for low slopes. But I'm not sure this usecase is important enough to make it worth fixing. At least not right now.
Thanks for implementing it ❤️
I dont see any paramter for this and my character can walk up EXTREMLY steep inclines -- not good