Liquids

Every water query tells what the water is made of: a Liquid Type (UPulseWaterLiquidType). Buoyancy and boats float with its density, and games read its tags, e.g. to burn a player in lava or to start a fishing minigame in a lake.

Liquid types

Create one with Add > Pulse > Water > Liquid Type (or New in the Pulse window). The plugin brings three in /PulseWater/Liquids: DA_PulseWater_Water (the default, 1025 kg/m^3 like sea water), DA_PulseWater_Lava and DA_PulseWater_Swamp.

Property What it does
Density kg/m^3. How strongly the liquid carries floating objects and boats: fresh water 1000, sea water 1025, lava about 3100.
Viscosity 0 (water) to 1 (very thick). Slows movement in the liquid and the flow of the fluid simulation.
bSwimmable Whether characters can swim in it.
DamageTag The damage the liquid stands for, e.g. Pulse.Water.Damage.Burn for lava. Information only: Pulse Water deals no damage, the game or a bridge does.
Tags Tags of the liquid, returned by queries with the Tags flag.
Color, Turbidity, FogDensity Look of the liquid from inside: the underwater view fades to Color, FogDensity per meter (0.12 for water), Turbidity (0..1) takes away caustics and light shafts.

Where the liquid comes from

  • Ocean: LiquidType on the ocean actor (SetLiquidType at runtime). Empty uses Default Liquid Type of the project settings (Project Settings > Pulse > Water).
  • Water bodies: LiquidType on the lake or river. Empty uses the default liquid.
  • Environment zones: LiquidType on a zone changes the liquid of the ocean where the zone weighs at least 0.5, e.g. a lava sea around a volcano. The zone with the highest priority wins. Lakes and rivers keep their own liquid.

Like everything that changes queries, liquids must be the same on the server and on every client.

Tags

Queries with EPulseWaterQueryFlags::Tags fill FPulseWaterQueryResult::Tags with:

  1. the WaterTags of the water body, or of the ocean when no body answers,
  2. the WaterTags of every environment zone that weighs at least 0.5 at the location,
  3. the Tags of the liquid.

Without the flag the result has no tags, because copying them costs a little time for every queried point.

FPulseWaterQueryResult Result;
Water->QueryWater(Location, Result, EPulseWaterQueryFlags::Tags);
if (Result.LiquidType && Result.LiquidType->DamageTag.IsValid())
{
    // The game decides what the liquid does
}

Status of a query

FPulseWaterQueryResult::Status is Water, NoWater or NotLoaded. bHasWater is the same as Status == Water. NotLoaded means the terrain or the water at the location is not streamed in yet. Buoyancy and boats then hold still instead of falling through ground that is still missing, splashes wait, and the hull takes no water through such leaks.


This site uses Just the Docs, a documentation theme for Jekyll.