Phazorknight / Cogito

Immersive Sim Template Project for GODOT 4
MIT License
670 stars 72 forks source link

Character gets stuck on stairs #207

Open PeterD23 opened 1 month ago

PeterD23 commented 1 month ago

Cogito and Godot Engine Version: Cogito master, Godot 4.2.1.stable.mono

Description: I get stuck on stairs and become unable to do anything. Happens every time on Cogito_4_Laboratory, with the steps leading up to the box.

Reproduction steps: Load up Cogito_4_Laboratory Try and walk up the steps to the box

Expected behavior: Player does not get stuck

Phazorknight commented 1 month ago

Hey, yeah I've noticed that the generated collision shapes on some of these seemingly simple meshes don't always play nice.

Please check https://github.com/Phazorknight/Cogito/commit/3c78fa7a69fce2ccab32ac099a719a2db114c926

PeterD23 commented 3 weeks ago

So I've been prototyping some level design with Trenchbroom and Func_Godot for my use case, and after switching to the box it still seems like theres weird issues, like getting stuck on my pyramid unless I'm looking up for some reason? Theres also one singular step in my spiral staircase that I cannot figure out why I can't traverse it except right at one of the edges. The problem goes away if I set the slope angle to 90 degrees but it makes ramp traversal look weird (apologies for the video quality, had to handbrake it down to less than 10 mb) https://github.com/Phazorknight/Cogito/assets/10536628/667a01cc-3bd5-4a84-aaaf-8eba65c46f0f

Phazorknight commented 3 weeks ago

Yeah, this is a bit tricky. The stair handling isn't perfect and there's lots of weird edge cases like this.

I'd experiment a bit more with the step max slope angle, as it actually can have quite the impact even at seemingly odd angles, but fixing the behavior in one case might break it for a different case.

Alternatively you could try to add some "cheat" colliders to the areas that give you trouble (like a small cube at the top of the pyramid or a slope to the one step that seems to stop the player. This is actually how most games solve this.