Server and Client have different movement speeds and rotation speeds

INTRODUCTION:
Hi to everyone, this is a recurring problem I have with all the games I tried to develop.
I have been looking for the answer for ages, and now it’s my try to make a topic directly by myself, so thanks to everyone willing to help!

OK WHAT WE GOT:
-Orient rotation to the movement (since it automatically replicates seems wiser to use this)
-Character movement replicated ON

BEHAVIOUR

Basically the code is working as i would like, the only exception is that the rotation speed is faster on the Clients than on the server, and this is not even coded, i don’t know how to fix it.
Maybe speed is faster too, but (it even feels like the server is drifting on ice, and the client has a good reaction).

Thanks again to everyone who took the time!

Is it the exact same blueprint actor / blueprint character used in the video demonstration?

1 Like

YES, This is all there is:
(mostly yes) (i added some colors and comments so its easier to diagnose)

I will add that this is the BP_PlayerController, it Is not the character blueprint.
Also on the Character Blueprint on Begin Play —> Set Movement Mode: Flying
Nothing else.

Here is another video of the behaviour: looks like the server has inertia, and the client doesnt, i dont even know whats happening!

Hi Elias i have replied to you, thanks for the answer and taking your time!

The issue with the rotation speed being faster on the clients than on the server is likely due to network latency or differences in the processing speeds between the client and the server. If you are using a pawn and not a character blueprint, they might be processed differently.

In a multiplayer game, the client sends input to the server, which then updates the game state and sends it back to the clients. The difference in the time it takes for the server to receive the input, update the game state, and send it back to the clients can cause differences in the speed of the rotation.

You can resolve these issues in a variety of ways:

  • Synchronize the tick rate of the server and clients: Make sure that the server and clients are running at the same tick rate, which is the frequency at which the game updates its state.
  • Implement client-side prediction: Client-side prediction is a technique where the client predicts the results of its inputs before it receives confirmation from the server. This can reduce the perception of lag for the player.
  • Use interpolation: Interpolation is the process of estimating the position and orientation of an object between two updates. You could use interpolation to smooth out the movement and rotation on the client side.
  • Adjust the replication rate: You can adjust the replication rate, which is the frequency at which the server replicates the state of the game to the clients, to reduce the impact of network latency.

Please note that implementing some of these are a tedious task. I suggest trying to use the character blueprint to see if that resolves the issue.

Also, thank you for formatting your post and making it very clear and easy to read!

1 Like

Elias, I thought your reply would actually result in the solution.
What we got is:
The tick rate on the client and the server are the same.
Is not only the rotation the problem, as I work around that but still the server experiences Acceleration, while the Client gets instant acceleration, on the Add Movement Input*. (server feels like its skating on ice, gets inertia while client doesn’t)*
-Tried making all the code on the Character Blueprint but still doesn’t work.
I do not have any idea how to implement client-side prediction, but I have a feeling the problem comes from somewhere else, any ideas?

Thanks for the time u are amazing

I have this issue as well using a pawn. I’m currently working through it, and will try to post an update if I solve the issue. I believe tick rate will come into play for the solution.

To me - this continues to be a basic problem, with no real solution I’ve seen out there on the internets. @EliasWick s post is helpful (thanks for that), but does not resolve the issue for the OP or myself. It could be that it is not one problem, and therefor hard to diagnose.

Currently for my setup - it works fine if I only have one player in any server mode. Listen, stand alone, or client. As soon as I add a second player - it is double the speed approximately. These are the hoops I’ve gone through to try to get a consistent update rate across client and server players: