Hey there,
Recently im splashing around with custom water (might have seen me around the forums )
Everything works great, but the problem comes when its multiplayer.
Ok, so I’ll explain my process below.
Each player has a localscript named “Ocean” in their backpack. This script makes the ocean wave according to the servers time (using workspace:GetServerTimeNow()) to make sure that the waves are same for all the players. I could have done it on the server but it takes time to replicate and appears jittery. Now, the waves work perfectly fine for all players even with high ping (I tested with 2 accounts both having 200ish ping, and the waves were 99% synchronized)
Now - boats.
First I thought about giving the load of the boats to the server, but then the player wouldn’t see his boat float correctly because the bodyposition will take time to replicate from the server.
So instead, I make each player simulate his own boat. 1 boat has 5 points where the wave height is sampled, which is very low and the impact is not even noticeable.
Now, the boat is floating correctly for the player.
But only the players boat. The problem is that each player only sees his or her boat floating correctly, boats of the other players are completely desynced once again because it takes time to replicate from player2 → server → me
As you can see in the below video, my boat is floating nicely on the waves.
But when I get my alt, his boat isnt correctly on the waves.
The impact isnt very much here, but when I tested with my friend (he was in Netherlands) the impact was terrible.
You can see in the video that my alts boat goes up when its not supposed to and goes down late, which makes it look sinking.
And on the other hand, my alts boat is floating correctly for him while my main’s boat isnt.
How would I overcome this impact? I have seen games such as Fishing Simulator use custom water + waves and boats too, and they were perfectly in sync.
Thanks for help.