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.
[Example Video][3]
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.
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.
Alright, so I tested it with an integer to count the launches and found that the number is the same. The server ran ~300 launches in 10s, and so did the client. Although this test doesn’t show much because all of the launching happens on the server and I don’t know of a way to measure how many launches the client actually executed within that time.
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.
Fair enough. Maybe the people who made Sky Noon would be willing to share with you how they handle problems like this since they make heavy use of grappling hooks in their game
Another idea: what if you used a Timeline node?