Launch Character behaves differently on client vs server
I have a game where players use a grappling beam to fly around an arena. Right now, I have it set up so that characters add themselves to a list on the server whenever they click and remove themselves from that list when they release click. (The launch location and speed are set by some other code and there's no problem there)
Then, the server goes through the list and launches each character towards their desired location:
(The delay was an attempt to make the launch speed independent of framerate)
Both servers and clients are launched by this correctly, but the clients do not accelerate as quickly as the server does.
Note: The left side is the server, and it shows the velocity of each player when they grapple. The server reached a velocity of ~10000, but the client only got to ~4500
If anyone could help me figure out why this would happen, that'd be great.
asked Jun 06 '18 at 09:42 PM in Blueprint Scripting
I may have found a workaround, albeit in a cheap and dirty way. I increased the delay at the beginning of the tick to .2 and multiplied each launch speed by 6. Now, the client should fly at the same speed unless its ping is above 200 ms because the launch command is called less frequently than the client receives network updates (If I understand it right). I start to see slight slowdowns after that, but I don't want to increase that delay any more so it'll have to do.
Maybe it is because of the round trip delay between server and clients making it so that the clients execute fewer Launches. You could count them in a variable incrementing it once for each launch to find out.
another possibility is that the clients have a slower Tick (framerate). There might be a way to normalize this by factoring in the delta time.
This appears like the same problem of stuttering movement when people replicate a pawn that doesnt have charactermovement prediction and smoothing for network play, only instead of stuttering with the world position it stutters with the Launches? Maybe.
answered Jun 06 '18 at 10:30 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here