Techokami / SonicWorldsNext

Official development repository for the successor to Sonic Worlds Delta
MIT License
139 stars 29 forks source link

Collision issues when switching from normal to rolling hitbox #143

Closed JimmyThrush closed 6 months ago

JimmyThrush commented 8 months ago

test.webm

On sharp corners like this, if landing on the very edge while holding down to roll after landing, the player will collide with the corner in a very jarring way without his movement being affected. Ideally the player should either ignore the corner entirely or have the y velocity set to 0 in a situation like this. I haven't been able to recreate this issue without rolling as I land.

This issue is somewhat more evident and grating with sound enabled (due to the rolling sound effect), but I unfortunately cannot record sound at the moment. Please note that only the first and third jumps in this video clip display the issue, the second works as intended.

Perhaps this bug is a result of a move_and_slide or move_and_collide collision with the tile that falls outside the range of the player's Raycast2D sensors? If so, an adjustment of the floor sensors for PhysicsObjects could solve the problem, if I might speculate.

An interesting note: this exact same glitch is present in Sonic Superstars. I have never experienced it in any other 2D Sonic game.

Renhoex commented 8 months ago

It's kind of hard to tell from the video but I'm assuming this might be because the game adjusts your hitbox when you enter a roll, so it's probably just far enough to clip off, reset the hitbox and then collide again?

JimmyThrush commented 7 months ago

Here's a demonstration of another issue: the difference in width between the normal hitbox and the rolling hitbox can cause you to clip inside platforms like this. test.webm This is easily fixed by making the two hitbox settings the same width, but I don't know if that'd cause some other kind of problem or not.

Changing the width does not affect the corner rolling problem; here is a better demonstration of that. demo.webm

I changed the issue title rather than making another one because I figure that it's all stemming from the source of something wrong with the rolling hitbox.

Renhoex commented 7 months ago

I see, from the looks of it, seems what's happening is that the vertical floor raycasts are activating before the wall ones, I don't know when I'll have time to look into it but it'll be in my list of things to to once I have time