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

Attempting fix for #2565 #2586

Closed
wants to merge 1 commit into from
Closed

Conversation

nihal111
Copy link
Member

@nihal111 nihal111 commented Nov 2, 2016

Contains

Potential fix for #2565

How to test

Look at issue for details on how to reproduce.

This doesn't really work out well, and is probably not a good way to solve this problem. Could use some help on how to fix.

Another thing that can be done is that CROUCHING can be remembered, so that after swimming, the character returns in crouched position (However this will change player's height in water which is undesirable). But this will also solve the second part of #2565

@GooeyHub
Copy link
Member

GooeyHub commented Nov 2, 2016

Uh oh, something went wrong with the build. Need to check on that

@Cervator
Copy link
Member

Cervator commented Nov 3, 2016

Can confirm the original bug (at least the crouch-swimming, loading a save seemed OK to me) and that this fixes it, but yeah it doesn't seem like this would be the way to do it :-)

As written this will conflict with #2515 (pinging @coty91!) which overhauls swimming and may be a better architecture to base this fix on top of. It makes me think about movement modes in general and how switching to swimming should probably just reset crouching, yet doing by triggering a button event seems wrong somehow.

Also, interestingly, probably swimming should affect the player's shape anyway - at least for a human a regular swimming stance (while actively moving) is more like a prone stance than standing or crouching, while treading water would be more like standing. Yet a swimming prone would leave the player's eye height the same as treading water, while a landed prone would indeed lower the eye height dramatically. Ahh challenges! :-)

Gets even more fun if you consider other creatures. A crocodile would be prone by nature and that stays unchanged on entering water, whether just floating or actively swimming. And Chessandgo is working on a centaur ...

So maybe crouching and prone should be a subtly different system anyway, yet still reset/change when entering water. Lots of possibilities, but none that are super quick to approach.

In any case I think we need to bake in more flexibility in changing the player's shape during movement, buttons being clicked or not.

@Cervator Cervator mentioned this pull request Nov 3, 2016
@nihal111
Copy link
Member Author

nihal111 commented Nov 3, 2016

@Cervator Yup, this even breaks a test as you can see.
And I can confirm that if you crouch and save and load the save game your standing height turns to half of what it was earlier.
Sending a ButtonEvent was the quickest way around this, since otherwise I would need to @share LocalPlayerSystem, but is surely not a proper way. It doesn't work smoothly either, I guess there is some lag between the event being sent and height being changed (i.e if you aim for the bottom of the water block in a 1-block deep pool, you might get stuck and would have to jump out). A probably better way would be to change the height before the movement is done, once it is realized that the next step takes you in water.

@rzats rzats added the Type: Bug Issues reporting and PRs fixing problems label Nov 3, 2016
@rzats rzats removed the in progress label Dec 20, 2016
Copy link
Contributor

@flo flo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate your effort to try to fix this, but simulating a button press is simply the wrong method.

Do you plan to work on this further or can we close this PR?

@nihal111
Copy link
Member Author

Let's close this PR for now. I'd get back to this soon :)

@nihal111 nihal111 closed this Jan 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issues reporting and PRs fixing problems
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants