Client-Server-Client Replication Sync

Hey, I seem to have trouble with syncing between the client, my replication goes like this:

(Green is Client, Red is Server)
Client sends event to server to shoot, at the same time the client also locally shoots a projectile.

https://gyazo.com/e11f697e74ed6dffe0f1ad22b3a8bc44.gif

As you can see in the gif, the client is correctly placed (obviously), while the server is just behind it and went doing sharp turns will not even be in the same trajectory as the client one, how can I sync them together?

Currently I have a module, it has 2 functions: Server “Creation”, Client “Creation”, the server one detects the hit and damages etc., the client is just for visuals.

I have read this post: Projectile Replication
Although it says that I should detect immediately if the player hit the target, but with travel time how is that possible to determine?

1 Like

You could send to the server which direction you are in when you activated it

2 Likes

I could, but wouldn’t that then be a bit more exploitable, maybe by players being able to send different positions of their place?

You wouldn’t have to send position, direction would be enough to counteract the slow direction update while still keeping server side position

So if I were to send the server my player position, I still have to consider that moving also is off-sync, I might as well just send my character position then?

Lend off some security for performance.

You can do whatever you want but that’s not what it looked like you wanted, but sure. Different games handle it differently. Some try to adjust what the player sees, some rely on client info but do sanity checks etc. It’s a design choice you’ll have to make.

Oke, thanks gullet, for now i’ll just put away security over performance and accuracy, for now i’ll take that risk!