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.
For what I’ve been playing with (two clumsy ships) should be good enough to simulate buoyancy on server and rep it to clients, problem is that ship will hang in air if ocean waves go out of sync
The only way that the waves would go out of sync is it you don’t sync whatever time variable is in use to run the waves along with the buoyancy… to do one, means you automatically can do the other.
Time is relative and all, but you do have just 1 ocean that uses 1 time to and x/y loc to return buoyancy right?
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.
For the system you add with the plugin that is what this topic is talking about, you would have to create your own class in cpp and override the default behavior.
Extend gastner wave wave generator simple.
And then change the class in the water body settings.
Possibly, the engine lest you right click and create a child of that via BP too.
You have to play around with it.
Changing the wave generating algorithm or the wave source might be all that’s needed.
At least check to see if there is any existing multi-player options for it.
If not, override the class and set the time yourself. Also make sure the material uses the same value.
You may need to modify it to get it to.
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.
Yes but if the clock is not synchronized they’ll eventually drift off again.
Check the link I gave. It explains and brings examples of how bad the network clock actually is.
The only reason to use it here is that at least it will get everyone on the same variable eventually.
And that individual clients won’t notice hiccups with it.
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.
So I don’t have to change anything about the Niagara Time node? . I thought that once I have followed this: Unreal Engine - A non-destructive and better synced network clock - Devtricks I would have to replace the time Inputs in Niagara and Materials with this new Blueprint node shown at the and of the text tutorial or am I completely wrong pls help? And thanks for your time in advance!!