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

New move code: Only snap to collision box only on fall #11367

Closed
wants to merge 1 commit into from

Conversation

SmallJoker
Copy link
Member

@SmallJoker SmallJoker commented Jun 19, 2021

Fixes #11261

I did not mark this as trivial because there might (as always) someone depend on this snapping behaviour already when jumping up.

To do

This PR is Ready for Review.

How to test

  1. Testing mod:
minetest.register_on_joinplayer(function(player)
	player:set_physics_override({
		sneak_glitch = true,
		sneak = true,
		new_move = true,
		jump = 2,
	})
end)
  1. Stack a few slabs (like below) and rotate them accordingly to make the effect more apparent:

@SmallJoker
Copy link
Member Author

@NeroBurner @RichardTry Does this work as you'd expect?

@NeroBurner
Copy link
Contributor

It works half of the time. During the jump while going up it works as expected. After reaching the top and starting falling down the "teleport" comes into effect

@SmallJoker
Copy link
Member Author

Yes, that seems entirely as intended so that you could adhere to nearby nodes to prevent falling down. Modifying that would imply a breaking change to the gameplay.

@RichardTry
Copy link
Contributor

RichardTry commented Aug 8, 2021

The correct behavior seems to be like this: Sneak prevents you from falling just if you touching (standing on) ground (edge), sneak should not prevent you from falling if you "fly" over the edge.
P.S. I can't compile this PR with up-to-date IrrlichtMt

@NeroBurner
Copy link
Contributor

@RichardTry yes I think that's what I would expect

building works for me using IrrlichtMt as a subdirectory (also when rebasing the PR commit on current master)

git clone --depth 1 https://github.com/minetest/irrlicht.git lib/irrlichtmt

@RichardTry
Copy link
Contributor

RichardTry commented Aug 8, 2021

I found out that sneaking "teleports" me to the top of node, no matter which collision box it has. This should be the reason of a problem.

But I still can't compile:

src/client/content_cao.cpp:23:10: fatal error: ITextSceneNode.h: No such file or directory
   23 | #include <ITextSceneNode.h>

@SmallJoker
Copy link
Member Author

SmallJoker commented Aug 9, 2021

To test this PR, you'll either need an Irrlicht mt1 clone or you could apply the patches to current master (it's literally a 1-liner change!). example script.
Anyway, I'll rebase.

@erlehmann
Copy link
Contributor

I was not able to find a way where this actually changes gameplay while trying for a few minutes.

I'd be wary of changinng this though – if anything relies on it, it is most likely parkour maps, where this change may turn hard jumps into impossible jumps without anyone noticing.

@erlehmann
Copy link
Contributor

I think I figured it out: Snapping when jumping up is probably a part of the “sneak jump” feature, which allows players to jump/teleport on a node that is normally too high to jump on if they press sneak, therefore having a way to “jump a bit more”. This is mainly used with fences and walls.

TL;DR: Please do not merge this.

@Zughy
Copy link
Member

Zughy commented Jun 12, 2022

@SmallJoker the issue you had mentioned in the very beginning it's been closed as "Not a bug" + Erlehmann comment. Should I close this?

@Zughy Zughy added the Action / change needed Code still needs changes (PR) / more information requested (Issues) label Jun 12, 2022
@SmallJoker SmallJoker removed Testing needed Bugfix 🐛 PRs that fix a bug labels Jun 12, 2022
@SmallJoker
Copy link
Member Author

SmallJoker commented Jun 12, 2022

@Zughy Whereas it might not be a bug, I consider this as a movement improvement. Snapping is only relevant to get onto nodes while falling, hence it should only happen in that case.

@erlehmann Actually you're too late about this. By rough bisecting using the Win64 builds, I found that Minetest 5.2.0 is the last version where a full node + 0.5m slab could be climbed.
EDIT: Can be fixed using the acceleration fix PR + f32 position_y_mod = 0.01f * BS; in localplayer.cpp.

@Zughy Zughy removed the Action / change needed Code still needs changes (PR) / more information requested (Issues) label Jun 12, 2022
@SmallJoker
Copy link
Member Author

SmallJoker commented Jun 16, 2022

(After thinking about this more...) this is a wrong implementation idea. Holding sneak acts like grabbing to the top surface of a node, hence snapping makes sense for upwards movements. If even, it should be the opposite: no snapping when falling down because the body's center of mass is too far away from the edge to have a chance to grab the node.

@SmallJoker SmallJoker closed this Jun 16, 2022
@SmallJoker SmallJoker deleted the sneak_tp_fix branch August 26, 2024 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sneaking while jump causes teleporting
6 participants