FFT Waves

HoloOcean worlds have FFT wave settings that can be configured, either with the scenario or real time with commands. The FFT waves will impact the buoyancy of the surface vessel and the movement of underwater vehicles while they are close to the surface.

Sea state 1 on pier harbor

Sea state 1 on pier harbor map.

Sea state 4 on pier harbor

Sea state 4 on pier harbor map.

Example image

Sea state 9 on pier harbor map.

Configuring FFT Waves

Holoocean worlds have a FFT wave configuration and command. This allows you to define the FFT waves in the simulation before running or to do more precise changes during a simulation. The waves go under "waves" in the scenario’s ocean block, keyed by the wave model: "fft" for FFT waves. Without it the water is calm, and FFT waves don’t spawn.

In a Scenario

To setup FFT waves in your config file, you can either define a sea state or define various wave parameters.

Sea State Config:

This config introduces FFT waves into the world which can then be modified with commands during simulation.

config = {
    "name": "waves",
    "world": "OpenWater",
    "main_agent": "sv0",
    "ocean": {"waves": {"fft": {"sea_state": 0}}},
}

Wave Parameters Config:

config = {
    "ocean": {
        "waves": {
            "fft": {
                "sea_state": 2,
                "wind_directionality": [0.5, 0.5, 0.5, 0.5],
                "wind_tighten": [0.5, 0.5, 0.5, 0.5],
                "wind_direction": 180,
                "foam_threshold": 0.1,
                "boat_buoyancy": 0,
                "wave_force": 1.5,
                "max_influence_depth": 5
            }
        }
    },
}

{"calm": {}} instead of {"fft": {...}} gives calm water, the same as leaving waves out.

Every FFT wave setting can be given in the scenario. The settings that take one value per cascade (wind_directionality, wind_tighten, long_wave_cutoff, short_wave_cutoff, choppiness, amplitude, patch_length) take a list of four values, or one number to use for all four cascades. An unknown setting or an invalid value raises a HoloOceanException, and nothing is sent.

sea_state sets the wind speed from a table (see Sea State values), so a wind_speed given with it replaces the sea state’s wind speed.

Every setting is described in the FFT Wave API.

During a Simulation

env.ocean.waves.set_parameters() takes the same settings as the scenario:

env.ocean.waves.set_parameters({"sea_state": 6})

env.ocean.waves.set_parameters({
    "wind_speed": 4,
    "wind_direction": 180,
    "wind_directionality": [1, 1, 1, 1],
    "wind_tighten": 0,
})

These changes need FFT waves in the scenario; without them they raise a HoloOceanException.

While you are able to change every parameter regarding FFT waves, the best ones to change are sea_state or wind_speed, wind_direction, wind_directionality and wind_tighten, as they have the most influence while retaining realism.

Note

env.fftwaves and its fft_sea_state(), fft_wave_scalars(), fft_wave_cascades() and single-setting setters (set_wind_speed() and so on) still work but are deprecated: use env.ocean.waves.set_parameters(). fft_wave_scalars() and fft_wave_cascades() take the engine’s names (WindSpeed); set_parameters() takes the snake_case names (wind_speed). env.fftwaves.set_sea_state() has been removed, because it used its own sea state table; use env.ocean.waves.set_parameters({"sea_state": n}). The top-level fft_waves scenario key still works but is deprecated: use "ocean": {"waves": {"fft": {...}}}. Setting the waves both ways is an error.

Default Values

  • Amplitude: 168000.0, 64000.0, 4000.0, 240.0

  • Wind Directionality: 1.0, 1.0, 1.0, 1.0

  • Choppiness: 1.5, 1.5, 1.5, 1.5

  • Patch Length: 10.0, 28.0, 432.0, 2000.0

  • Short Wave Cutoff: 0.0001, 0.002, 2.0, 30.0

  • Long Wave Cutoff: 1.0, 0.25, 0.125, 0.04

  • Wind Tighten: 1.0, 1.0, 1.0, 1.0

  • Foam Injection: 1.0

  • Foam Threshold: -0.25

  • Foam Fade: 0.1

  • Foam Blur: 2.0

  • Wind Speed: 0.0

  • Wind Direction: 0.0

  • Repeat Period: 1000.0

  • Roughness Power: 0.5

  • Num Roughness Samples: 128

  • Wave Speed: 9.8

  • Boat Buoyancy: 1 (true)

  • Wave Force: 1

  • Max Influence Depth: 10

  • Generate New Mesh: 0

Sea State values

Sea states are preset wind speeds, in m/s, that approximate the WMO sea state code

  • SS0: 0

  • SS1: 3

  • SS2: 5

  • SS3: 6

  • SS4: 8

  • SS5: 11

  • SS6: 13

  • SS7: 16

  • SS8: 20

  • SS9: 30

Worlds Without FFT waves

Worlds from before HoloOcean 2.4.0, or custom worlds that haven’t implemented FFT waves, cannot display waves during simulation. If you do not include FFT waves in your config, HoloOcean behaves as before. If you do include FFT waves, your agent will experience wave buoyancy without any of the wave visuals. To see FFT waves, update your worlds to version 2.4.0 or later.

Buoyancy Configuration

When using FFT waves, you may still want to use the old buoyancy system so that you can have the visuals of large FFT waves and calm water for underwater agents. This can be done by adding the buoyancy config. Without this config option, the buoyancy will default to the mesh based system compatible with FFT waves.

"ocean": {"waves": {"fft": {"sea_state": 4}}},
"buoyancy": 0,
Bounding Box Buoyancy (``0``)

Bounding box buoyancy is the original buoyancy system used by holoocean. This is still used by default when running holoocean without FFT waves and cannot be changed. When running FFT waves you have the option to enable this system. As this was not created with FFT waves it is largely incompatible, but still could have some use cases in specific situations.

Mesh Based Buoyancy (``1``)

Meshed based buoyancy is the default system when using holoocean with FFT waves. This buoyancy system was made to be compatible with FFT waves and is configurable to your needs.

Note

Mesh based buoyancy is an estimation and may not reflect real world buoyancy interactions. To change how this buoyancy affects your agent, change the values of the “max_influence_depth” or “wave_force” parameters either in the config or with commands.

Adding FFT Waves to a Custom Level

FFT Waves are functional through a joint CPU and GPU implementation. In Unreal there is a Niagara system that is located in content at FFT_OceanWaterWave/Effects/FX_OceanWaves. This along with the other folders within FFT_OceanWaterWaves make up the visualization of the FFT waves, all of which is done on the GPU. To add FFT waves to a custom level, please follow the instructions here: Adding FFT Waves.

The best way to change the parameters of your FFT waves is through the config and the commands. However, if you decide that you want to change the default parameters you must change them in your world’s FX_OceanWaves, and in the c++ file OceanFFTData.h. If you decide to add/remove any variables from this file then make sure to mirror your change in OceanFFTCalculator.ispc or else Unreal may crash.

Adding Custom Agents

With the addition of FFT waves, when FFT waves are turned on a new buoyancy system is used. This new system uses a mesh based approach to calculate the buoyancy experienced by an agent. To add a new agent, follow the instructions in developing agents: Adding Agents