The water clock
Everything that moves in Dynamic Real Water runs on one clock, the water time, counted in seconds. The ocean, the rivers, the foam and the ripples all read the same value every frame. Because of that, a crate dropped next to a boat rides the same wave as the boat, a sequence with a DRW Water Time track renders the same waves every time, and every player in a match sees the same sea.
You never have to set the clock up. It runs on its own from the game time, and you only touch it when you want something else to drive the water: a sequence, or a clock of your own such as a rewind system.
What follows the clock
Section titled “What follows the clock”| System | What the water time drives |
|---|---|
| Ocean | The wave motion (wind waves and swell), the foam and the surf on the shoreline. |
| Rivers | The river’s ripples, its turbulence and the foam that drifts with the current. |
| Lakes and pools | Lake waves, and the caustics of lakes and pools that are connected to a river. |
| Ripples, wakes and splashes | The rings and foam that floating and moving objects leave on the water. |
| Water queries and buoyancy | Get Water Surface At Location and every Buoyancy component see the surface at the current water time. Buoyancy also follows how fast the clock runs (see Clock speed). |
Where the time comes from
Section titled “Where the time comes from”The clock has three sources. Get Time Source tells you which one drives the water right now; it returns an EDRWWaterTimeSource.
| Source | What drives the water | When it is active |
|---|---|---|
| World | The game time of the world (the server’s, in multiplayer). It stops while the game is paused and slows down with time dilation. | By default, whenever nothing else drives the clock. |
| Sequencer | The time of a DRW Water Time track in a Level Sequence. | While a sequence evaluates a DRW Water Time section. During networked Play In Editor it is also the time you scrub in the Sequencer editor. |
| External | The value you pass to Set External Time. | From your first Set External Time call until you call Clear External Time. |
When more than one is active, a DRW Water Time track wins over External time, and External time wins over World time. The Sequencer track and its Play Rate and Time Offset curves are covered in Cinematics.
Driving the water from your own clock
Section titled “Driving the water from your own clock”Use External time when your game has its own notion of time: a simulation that steps at its own rate, a replay or rewind system, or a slow-motion effect that should only affect the water.
-
In the Blueprint that owns your clock, add the Get DRW Water Time Subsystem node. In multiplayer, do this on the server.
-
On Event Tick, call Set External Time on the subsystem with your clock’s value in seconds. The water follows that value.
-
When you want the water back on game time, call Clear External Time. The source returns to World.
Set External Time keeps the last value you passed. If you stop calling it, the water holds still at that time; it does not return to World time until you call Clear External Time.
Pausing the water
Section titled “Pausing the water”There are two ways to stop the water, depending on whether gameplay should stop with it.
- Pause the whole game. World time stops while the game is paused, so the water stops with it and resumes exactly where it left off. In multiplayer, pausing on the server stops the water on every client.
- Stop only the water. Call Set External Time with the current Get Water Time value and keep passing that same value (or call it once: the water holds the last value). Gameplay, physics and preset blends keep running. To resume without a jump, start advancing your value again from the frozen time.
Ripples, wakes and splashes run on the water clock too, so they freeze while the water is stopped. Ocean preset blends (Set Wave Data, Set Visual Data, Set Ocean Preset) count game time instead, so a blend that is running finishes even while the water is frozen.
Clock speed
Section titled “Clock speed”Get Water Time Rate returns how fast the water runs compared with game time: 1 is normal speed, 0 is stopped. It eases toward a new speed over a fraction of a second instead of switching at once, and it stays between 0 and 1: water running faster than game time reads 1, and water running backward reads 0.
Buoyancy follows this speed in two places: the push of river currents (including the outflow a river pushes into a lake or the sea), and the sideways push of wave slopes. Floating objects stay afloat when you stop the water, but currents stop pushing them and wave slopes stop pushing them sideways. At half speed both pushes are halved.
A jump is any time the water time moves backward or skips ahead instead of running smoothly, for example when you scrub a sequence, call Set External Time with a new value, call Clear External Time, or a client snaps to the server’s clock.
- Ocean foam is rebuilt after a jump. The ocean recreates Foam Pre Roll Seconds of foam (Grid Manager, DRW Foam, advanced; default 2 s, range 0 to 10 s; shown while Enable Foam Accumulation is on), so you see settled foam instead of foam that starts from nothing. The same rebuild runs when the ocean starts. Set it to 0 to turn the rebuild off.
- Ripples, wakes and splashes are cleared after a jump. Outside Sequencer, a small step back or a short skip (such as a frame hitch) does not clear them; while Sequencer drives the clock, any step back or larger skip does.
Multiplayer: the server owns the clock
Section titled “Multiplayer: the server owns the clock”In a networked game the server’s clock wins. Whatever drives the water on the server (World, Sequencer or External), every client follows it, including its speed changes and pauses. DRW sends the clock to clients by itself: there is nothing to place, enable or replicate.
On a client, Get Water Time returns the server’s time as that client follows it, and Get Time Source returns the server’s source.
Clients follow the server’s clock smoothly, so network jitter does not make the waves jerk. A client snaps straight to the server’s time when the server’s water time jumps, or when the client has fallen far behind (for example after a long hitch). When the server stops the water, clients stop it too.
Players who join late
Section titled “Players who join late”A joining client shows the waves of the server’s game time until it receives the server’s water clock. With the default World source the two agree, so the handover is barely visible; if the server drives the water with Sequencer or External time, the client snaps once to the server’s water time.
The ocean rebuilds its foam when it starts and after every jump, so a late joiner sees settled foam rather than none. Ripples and wakes made before the player joined are not sent to them.
Replays
Section titled “Replays”The water clock is recorded with a replay. During playback the water follows the recorded clock, so the replay shows the waves as they were in the match, and Set External Time has no effect while it plays. Jumping to another point in the replay moves the water to the recorded time there.
The waves repeat every 1,024 seconds
Section titled “The waves repeat every 1,024 seconds”The ocean’s waves (wind waves and swell) repeat every 1,024 seconds (17 minutes 4 seconds) of water time: water times 1,024 s apart show the same waves. Foam and the shoreline surf are not part of this loop. It matters when you match shots by water time, or build a background that loops.
In the editor
Section titled “In the editor”In the level editor viewport the ocean animates only while Animate In Editor is on (Grid Manager, DRW Ocean Spectrum, default off; shown when Enable FFT is on). A DRW Water Time track drives the waves in the editor either way, so scrubbing a sequence always shows the right waves.
During networked Play In Editor, scrubbing a sequence that has a DRW Water Time track in the Sequencer editor drives the PIE server’s water clock, so every PIE window shows the scrubbed waves.
Blueprint functions
Section titled “Blueprint functions”All five functions are on the DRW Water Time Subsystem, under the DRW Water Time category. Get it with the Get DRW Water Time Subsystem node. Full signatures are in the subsystems reference.
| Function | Inputs and outputs | Notes |
|---|---|---|
| Get Water Time | Returns the water time in seconds (double). | On a client, the server’s time as this client follows it. |
| Get Water Time Rate | Returns a float from 0 to 1. | 1 = normal speed, 0 = stopped. Eases toward a new speed over a fraction of a second. |
| Get Time Source | Returns an EDRWWaterTimeSource: World, Sequencer or External. | On a client, the server’s source (World until the server’s clock arrives). |
| Set External Time | Seconds (double). | Switches the source to External (unless a DRW Water Time track is playing) and shows that time. Call it every frame while you drive the clock. No effect on a connected client. |
| Clear External Time | None. | Returns the water to World time, unless a DRW Water Time track is playing. |