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

Slopes acting weird in some situations #2885

Closed
Eauix opened this issue Apr 2, 2024 · 5 comments
Closed

Slopes acting weird in some situations #2885

Eauix opened this issue Apr 2, 2024 · 5 comments
Assignees

Comments

@Eauix
Copy link
Contributor

Eauix commented Apr 2, 2024

SuperTux version:
build "SuperTux-v0.6.3-1154-g3c243e77d" from 2024-04-01 21:37

System information:
Windows 10, 64 bit

Expected behavior

Tux walks and slides normally on slopes

Actual behavior

Tux only acts normally if he's small and the level is not flipped.
Behavior 1 - Big Tux gets stuck in an inclinated crawling/ducking animation
Behavior 2 - Big Tux starts to jitter on the slope as if starting to fall multiple times
Behavior 3 - Tux swims as if the slope was full of water

Steps to reproduce actual behavior

Behavior 1 - Release the [Down] button while you are sliding on a slope
Behavior 2 - Walk off the slope after reproducing behavior 1 and then slowly walk over the slope again
Behavior 3 - Flip the level upside down
Video with all behaviors being reproduced

@Brockengespenst
Copy link
Contributor

At least for behavior 1 #2810 should provide a fix.
The other things look indeed very weird.

@MatusGuy MatusGuy self-assigned this Apr 3, 2024
@Eauix
Copy link
Contributor Author

Eauix commented Apr 4, 2024

One more thing, I found out that the swimming thing doesn't only happen when the level is upside down, it happens whenever the player hitbox is inside a slope hitbox, which is especially noticeable with the unisolid slopes

@Brockengespenst
Copy link
Contributor

Brockengespenst commented Apr 24, 2024

Regarding the slopes: I might be wrong, but I think the changes to the collision system in c2cc19b#diff-c1529ab5a98940b5cd63f179a8ce537a83df9f7e19349fc16f78afdb22ec8097 seem to have a negativ impact on Tux' behavior on the slopes.
If I understand the change correctly, the logic of the function has been changed. If is_free_of_tiles() is called with tiletype = Tile::WATER, the first check for tile.get_attributes() & tiletype will fail for a slope. In the old implementation, it would continue with the next tile. In the current implementation, the next checks are done as well, especially if (tile.is_slope ()), and that might lead to if (collision::rectangle_aatriangle(&constraints, rect, triangle)) returning true, which causes the whole function to return false (= it is not free of tiles type water). This should not happen, as we already know from the first check, that this tile is not water.

@MatusGuy
Copy link
Member

i know this and the solution is to improve the is_free_of_tiles function because it's limited and unnecessarily hard to comprehend. It feels like it was only meant to check for solid tiles.

@MatusGuy
Copy link
Member

i have reopened #2886

@Eauix Eauix closed this as completed Apr 29, 2024
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

3 participants