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

Make player movement more smooth #322

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

vainiovano
Copy link
Contributor

Current problems:

  • The controlled player doesn't stop moving very quickly
  • The server's position update sending rate is still too high

The physics calculation in the server and in clients should be similar
so that movement prediction could work. This change may improve movement
prediction.
The movement prediction code for the main player is very ugly and will
break when the player walks through the door with a button. I don't know
how this should be done properly in Godot.
@github-actions
Copy link

HOW TO REVIEW:

  • Test multiplayer (client and host)
  • Check build status
  • Check UI
  • Check the code
  • Check build artifacts

@@ -159,8 +161,9 @@ func run_physics(motion):
velocity.x = lerp(prev_velocity.x, 0, 0.17)
if velocity.y == 0:
velocity.y = lerp(prev_velocity.y, 0, 0.17)
# TODO: provide a delta value to this function and use it here
velocity = move_and_slide(velocity)
var collision = move_and_collide(velocity / 60)
Copy link
Contributor

Choose a reason for hiding this comment

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

what is the reason for this being divided by 60?

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

Successfully merging this pull request may close these issues.

2 participants