Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can very thin stairs be ignored for stair step? #7

Open
Lamoot opened this issue Feb 4, 2024 · 7 comments
Open

Can very thin stairs be ignored for stair step? #7

Lamoot opened this issue Feb 4, 2024 · 7 comments

Comments

@Lamoot
Copy link

Lamoot commented Feb 4, 2024

Hello, it's me again with another question. I was wondering whether it's possible to limit the stair step if the stair is too thin? In the following video I made very thin stairs and a very steep staircase. The player has no problem climbing the stairs.
The stairs are 0.5m tall and 0.2m thin

thin_stairs_movement.mov

Normally I wouldn't create such level geometry in the first place, the example in the video is exaggerated to more clearly show the effect. I noticed this behavior by accident when I walked near an edge of some random level geometry I placed in another scene. I think that thin steps like these would often appear unintentionally in levels and it would be useful to disregard such geometry for stair stepping.

@mrezai
Copy link
Owner

mrezai commented Feb 5, 2024

I have think about it and implement a prototype but it doesn't cover all cases.
I'll create a prototype git branch if I find a good solution for it.

@Lamoot
Copy link
Author

Lamoot commented Feb 6, 2024

Thank you for considering it.

@RisingThumb
Copy link

RisingThumb commented Feb 14, 2024

Hello, it's me again with another question. I was wondering whether it's possible to limit the stair step if the stair is too thin? In the following video I made very thin stairs and a very steep staircase. The player has no problem climbing the stairs. The stairs are 0.5m tall and 0.2m thin

thin_stairs_movement.mov
Normally I wouldn't create such level geometry in the first place, the example in the video is exaggerated to more clearly show the effect. I noticed this behavior by accident when I walked near an edge of some random level geometry I placed in another scene. I think that thin steps like these would often appear unintentionally in levels and it would be useful to disregard such geometry for stair stepping.

Just to add, this issue is present in Source(see this video for an example of this in the same way you show), and it's also present in all the Quake games(I think...). I don't know if Source 2 solved this issue(I suspect not). The way they work around this issue is using clip brushes to clip off geometry that people could get caught on(they also do this for most stairs to turn them into slopes). In my opinion, this is generally good practice for walls at least, because I think almost all player movement systems would get caught on random bits of geometry.

If it can't be solved programatically, you can at least work around it by baking it into your level design considerations
EDIT: Just in case it's useful to others, a clip brush is just an invisible bit of geometry you collide with, usually to prevent people colliding with complex geometry

@Lamoot
Copy link
Author

Lamoot commented Feb 15, 2024

@RisingThumb thanks for the extra information and the video. I wasn't aware Valve didn't solve the issue either, but fixed it through adjusting the level geometry. I wonder whether Unity or Unreal used an improved method and or they left like that as well.

This then gives me a way forward with using this stair step system and the issue isn't as big anymore. Would be useful to have it mentioned somewhere nonetheless.

@Lamoot
Copy link
Author

Lamoot commented Feb 20, 2024

@mrezai I'm now using your stair-stepping solution in my project and it's working very nicely.

The original issue of thin stairs is not such a problem anymore. I'll just use an invisible ramp workaround for rare cases where it occurs. Do you want me to keep this issue open anyway?

Otherwise I can close it and we let any future user of your stair step know that thin stairs are a corner case solved by extra colliders.

@mrezai
Copy link
Owner

mrezai commented Feb 21, 2024

Thanks for your tests.
I have an idea about how to solve this issue and I want to test it before closing the issue.
I'll share a prototype branch here if I implement it successfully.

@azur-wolve
Copy link

some idea:

var min_step_depth: float    
# wont perform an up-step if the step surface has a minimum depth (frontal width)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants