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

Player can land inside of slanted fungi #125

Open
Kuma-Boo opened this issue Mar 28, 2023 · 2 comments
Open

Player can land inside of slanted fungi #125

Kuma-Boo opened this issue Mar 28, 2023 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@Kuma-Boo
Copy link
Collaborator

Describe the bug
If the player collides with a slanted fungus in the right way, the game doesn't register them as on the ground properly. It's not a softlock, as you can get out by holding either left or right.

To Reproduce
Go to tutorial 1 room 3.
Use the hover nozzle underneath the slanted fungus.
Land inside of it.

Expected behavior
Mario should either fall to the ground or be snapped to the fungus.

Video of the bug

8mb.video-bK3-6ap2dlQZ.mp4

System Information

  • OS/Browser: Windows
  • Game version: v0.2.0 (Editor)
  • Other specs: N/A

Additional context
This can also be performed by walking off the higher side and holding back into the platform.

@Kuma-Boo Kuma-Boo changed the title Fungus floor Player can land inside of slanted fungi Mar 28, 2023
@nyanpasu64
Copy link
Contributor

Hypothesis: you hover in tilted mushrooms, because there's code that recognizes when you just barely miss a jump to a ledge above you (Mario's position >= y position of ledge - a bit), and snaps you upwards to the y position of the ledge.

The problem arises when the ledge is slanted, and the code uses the y-position of the center of the ledge, even though the higher side of sloped floors is higher than the center, and needs Mario to be higher to either almost or fully clear it.

The code should detect when you're either just below the y position of your current x position, or (more leniently) your position projected along the normal (perpendicular) vector is just below the plane's surface. Then it should snap you to the y-position at your current x position, or (smaller jump but also moves you horizontally) project your position along the normal to the plane's surface. Afterwards, it may be necessary to eject Mario further upwards, so his entire floor collision points (not just bottom center) are located above the floor.

@GTcreyon
Copy link
Contributor

GTcreyon commented Apr 9, 2023

In general, I think the SafetyNet class should be deprecated and replaced with a player-centered solution using raycasts. SafetyNet is clunky and hard to adapt, and a raycast solution would allow the player to walk up shallow stairs instead of getting stuck.

@GTcreyon GTcreyon added the bug Something isn't working label Apr 9, 2023
@GTcreyon GTcreyon added this to the v0.2.0 milestone Apr 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants