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

Remove hackish and not multiplayer ready crouch visuals. #2961

Merged
merged 2 commits into from
Dec 21, 2017

Conversation

flo
Copy link
Contributor

@flo flo commented May 25, 2017

Contains

This removes the constant camera up/down movement in multiplayer when you crouch.

It also makes it so that while "default croaching" is enabled with key "x", presseing the temporary croach button "ctrl" will make the character temporarly stop crouching. This is analog to how it is for running.

This change removes all the hackish existing player height and eye height modificaitons during crouching. The old code had the following issues:

  • the client ordered the server to change the eye height based on possibly outdated eye height values it had received previously from the server
  • character height and eye height change got triggered by client instead of being a result of movement mode change
  • client triggered redundant movement mode changes that would also
    automatically result from movement input
  • movementDebugCommands were used to do eye height and height modification. The commands are hackish too and not really something that should be used in non debug code.
  • the player height change triggered a teleportation of the player which messes up further with the movement prediction system

How to test

Start a headless server and join as client. Then try crouching. Movement speed should be slightly slower while crouching.

Issues with old code:
- client triggered redundant movement mode changes that would also
  automatically result from movement input
- movementDebugCommands were used to do eye height and height modification
- eye height was set via server based on values received by client
- character height and eye height change got triggered by client instead of
  being a result of movement mode change
- the player height change triggered a teleportation of the player
  which messes up further with the movement prediction system
@flo flo force-pushed the crouchingMode branch from db03cab to 79fd7fa Compare May 25, 2017 10:34
@flo flo added Type: Bug Issues reporting and PRs fixing problems Multiplayer Affects aspects not visible in Singleplayer mode only labels May 25, 2017
@GooeyHub
Copy link
Member

Hooray Jenkins reported success with all tests good!

1 similar comment
@GooeyHub
Copy link
Member

Hooray Jenkins reported success with all tests good!

@nihal111
Copy link
Member

I do agree that most of the code was 'hacky' and not ready for multiplayer. However, this change simply destroys the point of "crouching" which is reduction of height. The shift (Run/Walk toggle) button probably would do the exact same thing as crouching now.

If you want to remove this for the sake of removing the multiplayer bug or if you plan to initiate a movement refactoring rework soon, I don't mind going ahead with this. Otherwise, it is a step in the opposite direction and simply undoes things.

@flo
Copy link
Contributor Author

flo commented May 25, 2017

I think the main intention of crouching was to have a "do not fall of edge" feature which was not implemented yet anyway.
The size reduction is not something that will be needed often / at all.

The current code just solves it in the wrong way. Having it there just gives other developers bad examples of how to do stuff.

@Cervator
Copy link
Member

I agree the code was problematic in multiplayer, but it did work really well in single player. The crouching for height differences is also desirable imho :-)

Could we live with a workaround for multiplayer (disable crouching entirely if needed) along with some big visible TODOs while keeping it functional as-is in single player? Or is that too "code smelly" ? I don't know who might have time to finish this since it isn't part of GSOC which will eat most of our time.

Or would it be better to park the code elsewhere entirely and wrap it into the overall movement refactoring whenever we get somebody active on that area?

Copy link
Member

@skaldarnar skaldarnar left a comment

Choose a reason for hiding this comment

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

The code smell of the current implementation is quite huge IMHO. Reverting the changes sounds reasonable, as crouching as it is currently mostly just affects the eye height in single player, nothing more.

I've got confused by the up-and-down-flickering in multiplayer, and I think it would be better to (at least) turn it off.

I don't mind reverting all of this and keep notes for a later movement refactoring. The code is not lost as we can simply look at this PR. So, I vote for merging this.

@portokaliu
Copy link
Contributor

I think crouching actually allows you to pass through 1x1 areas (like if we had vents or small tunnels). It would be useful if we ever wanted to make adventure maps with secrets, traps or w/e else.

Completely removing it for now is ok, but the idea is good and we should get back to it when possible.

@GooeyHub
Copy link
Member

Hooray Jenkins reported success with all tests good!

@skaldarnar
Copy link
Member

Could be a really cool issue to work on right after GSOC. Movement refactoring is a bigger topic, so we could try to get students, mentors, and anybody interested work together on this right after the coding period ended, to not loose the focus and drive we just gained.

@syntaxi
Copy link

syntaxi commented Oct 2, 2017

Seeing as it's raising bugs like #3108 I think it would be good to merge this and then make it some kind of gsoc task

@GooeyHub
Copy link
Member

GooeyHub commented Nov 5, 2017

Hooray Jenkins reported success with all tests good!

@oniatus
Copy link
Contributor

oniatus commented Nov 5, 2017

Fixed the conflict and gave it a short test.
This change is more like a sneak than a crouch but it works and my personal bias is to have a working feature with clean code rather than a broken one with more bad code behind.

I suggest to merge this PR, then close #2555, #2651, #3108 and continue on #1075 (it is the only one with a bounty) with the requests from the named issues.

Full list for crouching for me would be:

  • Multiplayer support (host & connected client)
  • 1x1 holes enterable
  • Visual Feedback in eye height
  • Falling of ledges support
  • Toggle/Untoggle + temporary button (as is with this PR)
  • Leave 'LocalPlayerSystem' cleaner instead of making it worse.

For the last point it would make sense to clean up the system first (after this PR) which is something i can work on.
I will leave this PR open until next weekend for extra feedback (ping @Cervator @jellysnake @skaldarnar @nihal111 @flo) then merge and continue as proposed if no one raises an objection 😉

@oniatus oniatus merged commit 9168c3a into MovingBlocks:develop Dec 21, 2017
@oniatus
Copy link
Contributor

oniatus commented Dec 21, 2017

Left it open a bit longer :)
I will now update the issues. The follow-up will be #1075.

@flo
Copy link
Contributor Author

flo commented Dec 28, 2017

Thanks for merging

@Cervator Cervator added this to the Alpha 9 milestone Feb 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Multiplayer Affects aspects not visible in Singleplayer mode only Type: Bug Issues reporting and PRs fixing problems
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants