Multiplayer checklist
Work through this list before you ship a networked game with Dynamic Real Water. Each item says what to do and why. The full picture of what replicates is in the multiplayer model.
1. Set up the level
Section titled “1. Set up the level”- Place one BP_DynamicRealWater in the level. It replicates and is always relevant on its own. There is no multiplayer setting to turn on.
- Place water bodies, rivers, Shoreline Obstacles and River Rock Markers in the level, not per player. They replicate by themselves.
- Do not move water bodies or edit river splines during play. Their placement and a river’s spline points are not replicated, so clients would keep the old shape.
- Leave the water clock alone unless you need it. By default every client follows the server’s game time, so the waves match without any setup. See The water clock.
2. Floating actors
Section titled “2. Floating actors”- Give each floating actor a DRW Physics Body and a DRW Buoyancy component. The Buoyancy component turns on replication and Replicate Movement for its actor, and the server does the floating. There is nothing to turn on.
- Add DRW Smooth Replication to floating actors that players watch move: crates, buoys, barrels, debris. Without it, clients run the engine’s own physics replication, and floating bodies can look less steady on clients than on the server.
- Match Send Rate Hz on Smooth Replication to how often the actor is sent (its Net Update Frequency). The default is 30.
- Do not add Smooth Replication to skeletal meshes, ragdolls, characters, or actors whose floating body is not the root. It switches off physics on the root and moves the whole actor. For rigs of several simulating meshes, rely on the Physics Body’s Replicate Body State instead (on by default).
- Check relevancy distance. DRW does not change it for floating actors: they use the actor’s Net Cull Distance Squared. Raise it on actors that players must see move from farther away.
- Sleep When Out Of Sight works in multiplayer. It runs on the server and takes every player’s view into account. If something other than a DRW boat drives a body that uses it (AI thrust, a scripted path), call Keep Awake on the server every tick while it does.
3. Boats
Section titled “3. Boats”- Use BP_Dinghy, BP_Runabout or your own DRW Vessel Pawn. Leave Enable Multiplayer on (DRW Vessel, Network). Turning it off stops the boat from replicating.
- Pick a Net Update Rate (default 30 Hz, range 1 to 60). Raise it for fast boats if the motion on clients looks coarse; it costs bandwidth per boat.
- Board through the server. Give player pawns a DRW Vessel Possession component and call Request Possess Vessel, or a DRW Seat Occupant component and call Request Occupy Seat and Request Vacate Seat. These send the request to the server. Calling Occupy Seat on a seat from a client changes only that client.
- Bind On Vessel Possessed on the server. It fires only there. On the driving client, check the boat itself instead, for example with Is Locally Controlled.
- Keep custom input actions in range. The server checks every input message: Throttle, Steering, Bow Thruster, Stern Thruster and Foil Angle must stay within -1 to 1, and the other controls within 0 to 1. DRW clamps most controls, but not Throttle and Steering. If a custom input mapping scales those beyond 1 (for example a Scalar modifier above 1), the check fails, and Unreal disconnects a client whose message fails validation.
- Build client speedometers from Smooth Replication. On clients, Get Speed, Get Speed Knots, Is Planing and Get Movement State are not updated, and the player driving a DRW Vessel Pawn (such as BP_Dinghy or BP_Runabout) does not receive Get Movement Output. Read Calculated Speed (cm/s) from the boat’s Get Replication component instead. Is In Water works everywhere.
- Expect the driver to feel the round trip. The server simulates the boat and the driver sees it through Smooth Replication, so input shows up after the network round trip plus the interpolation delay (default 0.1 s). Lower Interpolation Relative Time for a more direct feel at the cost of more extrapolation on a poor connection.
4. Change the water during play
Section titled “4. Change the water during play”| You want to | Do this |
|---|---|
| Change the sea state or the look | Call Set Ocean Preset, Set Ocean Wave Data or Set Ocean Visual Data on the server. Every machine blends to it. Called on a client, nothing happens (the node still returns true). |
| Change one look setting | Put it in a Visual Data asset and switch with Set Visual Data on the server. Many look settings, such as Roughness, Specular and Foam Color, do not replicate on their own. |
| Swap the ocean foam textures | Call Set Foam Textures on the server. |
| Change a river | Set the river settings on the server, then call Rebuild Hydraulics on the server. Clients rebuild by themselves. Fill Level and the obstacle detection settings do not replicate. |
| Switch a surface mask | Call Set Mask Enabled, Set Mask Mesh, Set Mask Buoyancy or Set Mask Underwater Effects on the server. Calls from clients are ignored. |
| Drive the water clock | Call Set External Time on the server. Play sequences with a DRW Water Time track on the server, for example with a Level Sequence Actor that has Replicate Playback on. See Cinematics. |
| Show a scripted splash to everyone | Call Spawn Splash At Location on every machine, for example from a multicast event. It only acts on the machine that calls it. |
5. Per-player graphics settings
Section titled “5. Per-player graphics settings”These settings are per machine. Put them in your graphics menu and call them on the local machine:
- Set Ocean FFT Resolution (or Set FFT Resolution on the ocean). It causes a one-frame hitch, so call it when the player confirms the menu, not every frame. A wave preset sets its own FFT Resolution when it is applied, so apply the player’s choice again after a wave preset changes.
- Set Water Quality on the ocean. Lower tiers draw fewer wave cascades; physics is not affected.
- Set River FFT Enabled on each river. Off removes the river’s ripple detail and costs no GPU time, for example while the player is far away.
- The DRW Underwater component each player gets is local too. Pick a Blueprint child of it in Underwater Component Class (Project Settings, Plugins, Dynamic Real Water) to change its settings for the whole project.
6. What not to do
Section titled “6. What not to do”- Do not make preset, river, obstacle or surface mask changes on clients. Make them on the server and let them replicate.
- Do not drive the water clock on a client. While connected, a client always follows the server’s clock.
- Do not change water look settings one by one on the server and expect clients to see them. Use a Visual Data asset.
- Do not put Smooth Replication on skeletal meshes or on multi-body rigs.
- Do not move Shoreline Obstacles continuously. The rebake takes a few frames; move, then rebake.
- Do not resize or move lakes and pools, or reshape rivers, during play.
7. Test it
Section titled “7. Test it”In the editor
Section titled “In the editor”-
Open the Play settings, set Number of Players to 2 or more and Net Mode to Play As Listen Server or Play As Client. Several PIE windows in one editor process work.
-
Turn on the editor’s network emulation and test with realistic latency and packet loss. This is where you see whether your Smooth Replication and Net Update Rate settings hold up.
-
In every window, print Get Water Time (from Get DRW Water Time Subsystem) and Get Time Source. The times should agree closely, and every client should report the server’s source.
-
Stand two players at the same spot and compare the waves. Drop a crate next to a boat and check that both ride the same wave in every window.
-
Change the ocean preset on the server and check that every window blends to it.
-
Board a boat from a client, drive it, and leave it. Check that the boat moves smoothly in the other windows and that you return to your own pawn when you leave.
Late join
Section titled “Late join”The important case is a player who joins a match that has been running for a while, after things changed.
-
Launch two standalone game instances, for example by starting Standalone Game from the editor’s Play menu twice.
-
In the first, open the console and run
open YourMapName?listen. -
Play for a few minutes. Change the ocean preset, move a Shoreline Obstacle and call Rebake Shoreline, board a boat, and occupy a seat.
-
In the second instance, run
open 127.0.0.1to join. -
Check on the new client: the current preset is applied at once, the waves match the host’s, the ocean already has foam, the moved obstacle’s surf is where it is now, the boat and the seat show their occupants, and floating actors sit where the host has them.
If you drive the water clock with Set External Time or a sequence, run the same test while it is active: the late joiner should snap to the server’s time once when it connects.
Replays
Section titled “Replays”If your game records replays, record a match (demorec MyReplay, then demostop) and play it back (demoplay MyReplay). The water should show the same waves as the match, and jumping in the replay should move the water to the recorded time.
Dedicated servers
Section titled “Dedicated servers”If you ship dedicated servers, test on one as a separate pass (Net Mode, Play As Client starts one in the background), with the same checks as above.