Been fiddling with new water stuff recently but didn’t really found anything hinting that this system intends to support replication. Does it? Will it in future? If not then at least the wave generation should be synced and we could rep the simulated actor location ‘manually’ I guess?
ps. why there’s still no sub forum for multiplayer related stuff?
You can’t really expect to sync physics over the network with 100% accuracy (probably true for any movement).
That said, the system is based on a pre-built function.
As long as you sync game time the two clients will solve the math the same way. It should also already be frame independent.
As far as water interaction, splashes etc. That’s done at a local level with vector fields and particles in fortnite. You should aim to do it the same way.
Modify the material and pipe in the correct time variable instead of using the time node.
Change the CPP to use the same time to calculate and pluck wave height.
Then you have very little chance for things to go completely out of sync.
Let me also add, that Lag or time difference between clients won’t matter here.
So long as the wave material and the wave physics use the same unit of measure - then objects affected by buoyancy and the wave will always look to be in sync for everyone.
They can happen later than they do on server because of lag, but they will still be in sync.
So if the boat is a network replicating pawn, you need to account for that… set it’s client Z based on the reading of the physics, not on the network data.
Thank you! I’ll give that a go tomorrow. In the mean time I have also found the cvar r.Water.OverrideWavesTime I can adjust. This manually sets the time of the wave - it however only accepts integers and not floats.
How can I use the network code like system for an Ocean that’s build in niagara and Materials? Can I just use this blueprint node “get world time” - or whatever it was called- and turn it into a user parameter?
Again, normally you don’t.
Each client has its one loosely syncd simuation.
This can be pretty spot on if you only have the clients respect the server given game time (or any authoritative client in case of P2P), so you rarely get artifacts unless the commections drop for a client.
You need to look into what time that returns.
My guess is that its completely client dependent.
Each client has its own non-replicated instance of game… and not every game necessarily starts at the same time.
Again, this topic / considerations were all specifically for multiplayer server to client setups.
If you have a single player game you can use the local time without any issue.