Syncing Ball Movement with Client and Server

I am developing a ball game and am having issues syncing the client to the server, the issue is that for the client the ball, for it to look smooth, I am creating a simulated ball for each client, the issue is that when the ball has made impact, that client ball needs to be removed so that they can see where the actual server ball is, the issue is when I try to sync the two, theres a large delaty thats very visible, and it often stutters.

I have three videos where I’ve tried different methods. The first method was that the client owns the ball, with network ownership, server checks to make sure the calulations are correct, and it plays.
This works well for the client who threw the ball, but all other clients see it as laggy or teleporting. You can see this in the Gameplay with multiple players and inside the practice video with dummies. The ball works perfectly for the client who threw the ball, but it is absolutely terrible for others. As you see in the video with other players, when a ball is thrown at me, it is stuttering or seems to just teleport.

The second method is all clients make their own ball, the issue I am having with this is trying to sync it, as when the ball ends, as you can see in the video where I am by myself in the non dummy practice area, after the ball finishes and switches to the server by deleting its ball and making the server visible, theres a giant stutter or it teleports trying to sync with the server, its very notciable and looks terrible.

What I have tried:

I have added a damper to try to counter it by slowing down the ball or speeding it up to match the server position, but it is still not great.

I have tried to tween the balls location via the client ot match then make the server ball visible while deleting the local ball, same issue arrivies with it looks like it teleports

This is a big issue and I am stuck at this part because without being able to get a good synchronization, it will be really difficult to dodge balls that are coming for you and will seemly give players unexpected deaths while also looking really bad, can anyone that has done this before assist or guide me on what they did to solve this? I have read other dev post and none of them seem to have this specific issue I am having.

External Media External Media External Media

Thank you.

1 Like

https://devforum.roblox.com/t/early-server-authority-access/3630543

Thank you, hopefully they will allow me to use this

Oh sorry I’m pretty sure they aren’t accepting submissions right now but this is set to be released publicaly by December and will redefine network ownership

1 Like

What I ended up doing is:
Keep the client ownership of the ball when throwing, and switch to server after it hits, while having the server do the math to ensure lag or exploiting isn’t making impossible hits. The reason for this is it is guaranteed to be smooth for the thrower which is more important than simulating other players shot

For other players originally I had them simulate a ball and try to follow the server ball, this proved to be delayed if the player wasn’t standing still, so instead they simulate their own shot, which can sometimes be off just by a small amount, but it isn’t noticeable. I also have an additional function that adds delay for the server as sometimes the client will reach quicker than anticipated and will appear to stutter, but this isn’t a big deal so far.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.