Table of Contents

Class SceneDrip

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

Water dripping from a cave's roof (2026-10-20, caves livened; Drip): how often a drip falls, how its drops fall, when each lands, and how its seed carries the puddle under it. One definition read by the client's drops and puddle rings (CaveDrips and its shader, which repeats FallenMetres(float), JitterOf(uint, long) and the ring constants), its sound (CaveDripPresenter) and the cave dressing that bakes the drips.

public static class SceneDrip
Inheritance
SceneDrip
Inherited Members

Remarks

Shared by every player. Drop k of a drip lands at (k + jitter(k)) · interval + phase seconds of the shared motion clock (WorldMotion.Seconds), the jitter a hash of the drip and k within ±Jitter of the interval: irregular, as a real drip is, yet the same moment on every screen and in every ear. Nothing is integrated frame to frame; ClockAt(double, uint, out long, out float) reads the clock in double precision, so the drops never drift however long the world has run.

The fall. A drop of 4–5 mm falls with the air's drag on it: v(t) = vt tanh(g t / vt), so y(t) = (vt² / g) ln cosh(g t / vt), close to free fall over the first metre or two and at its terminal TerminalSpeed down a high vault's thirty. The cave dressing keeps every drip's interval at least FallSeconds(float) / InFlight, so no more than three of its drops are ever in the air at once.

Fields

CycleModulus

The drop numbers the client hashes a jitter for are taken modulo this (exact in a float).

public const long CycleModulus = 65536

Field Value

long

Gravity

Gravity, m/s², and a falling drop's terminal speed in still air (a 4–5 mm drop), m/s.

public const float Gravity = 9.81

Field Value

float

InFlight

The most a drop's fall may last, in intervals: four landings in a row span at least 3 − 2·Jitter intervals, more than this, so at most three drops of a drip are ever in flight at once (the client draws three: the drops due next).

public const float InFlight = 1.8

Field Value

float

IntervalShift

The bits of a seed: its own hash (phase and jitter) 0–11, the interval's step 12–19, the puddle's radius in cm 20–26, the landing 27–28.

public const int IntervalShift = 12

Field Value

int

IntervalStep

The shortest interval between two drops of a drip and the step it is stored in, seconds (8 bits: 0.4–13.15 s).

public const float IntervalStep = 0.05

Field Value

float

Jitter

How far a drop's moment may stray from the even beat, as a share of the interval either way.

public const float Jitter = 0.2

Field Value

float

LandingShift

The bits of a seed: its own hash (phase and jitter) 0–11, the interval's step 12–19, the puddle's radius in cm 20–26, the landing 27–28.

public const int LandingShift = 27

Field Value

int

LeastHeight

The highest roof a drop is let fall from, metres, and the lowest (under it a drip is a seep down the rock).

public const float LeastHeight = 0.6

Field Value

float

LeastInterval

The shortest interval between two drops of a drip and the step it is stored in, seconds (8 bits: 0.4–13.15 s).

public const float LeastInterval = 0.4

Field Value

float

MostHeight

The highest roof a drop is let fall from, metres, and the lowest (under it a drip is a seep down the rock).

public const float MostHeight = 60

Field Value

float

MostPuddle

The largest puddle's radius, metres (7 bits of centimetres).

public const float MostPuddle = 1.27

Field Value

float

PuddleShift

The bits of a seed: its own hash (phase and jitter) 0–11, the interval's step 12–19, the puddle's radius in cm 20–26, the landing 27–28.

public const int PuddleShift = 20

Field Value

int

RingSeconds

A ripple ring's speed over the puddle (capillary-gravity waves' least, ~0.23 m/s), m/s, and how long one shows, s.

public const float RingSeconds = 1.3

Field Value

float

RingSpeed

A ripple ring's speed over the puddle (capillary-gravity waves' least, ~0.23 m/s), m/s, and how long one shows, s.

public const float RingSpeed = 0.24

Field Value

float

SpatterSeconds

How long the spatter of a drop's landing is in the air, seconds.

public const float SpatterSeconds = 0.32

Field Value

float

TerminalSpeed

Gravity, m/s², and a falling drop's terminal speed in still air (a 4–5 mm drop), m/s.

public const float TerminalSpeed = 8

Field Value

float

Methods

ClockAt(double, uint, out long, out float)

Where a drip is in its beat at a moment of the shared motion clock: cycle the number of the drop whose even beat last passed (modulo CycleModulus), into the seconds since that beat. Exact in double, so the clock's size never blurs it.

public static void ClockAt(double seconds, uint seed, out long cycle, out float into)

Parameters

seconds double
seed uint
cycle long
into float

FallSeconds(float)

Seconds a drop takes to fall height metres (the inverse of FallenMetres(float)).

public static float FallSeconds(float height)

Parameters

height float

Returns

float

FallenMetres(float)

Metres a drop has fallen seconds after it lets go (with the air's drag).

public static float FallenMetres(float seconds)

Parameters

seconds float

Returns

float

Hash(uint, uint)

A PCG-style mix of two words; the shader's FishDripHash is the same.

public static uint Hash(uint a, uint b)

Parameters

a uint
b uint

Returns

uint

IntervalOf(uint)

The seconds between a drip's drops (on the even beat), from its seed.

public static float IntervalOf(uint seed)

Parameters

seed uint

Returns

float

JitterOf(uint, long)

A drop's stray from the even beat, as a share of the interval in [−Jitter, Jitter]: a hash of the drip's own bits and the drop's number (modulo CycleModulus). The shader's FishDripJitter is the same.

public static float JitterOf(uint seed, long cycle)

Parameters

seed uint
cycle long

Returns

float

LandingOf(uint)

What a drip's drops land on (3 reads as rock).

public static SceneDripLanding LandingOf(uint seed)

Parameters

seed uint

Returns

SceneDripLanding

LeastIntervalFor(float)

The shortest interval a drip falling height metres may have (InFlight), seconds.

public static float LeastIntervalFor(float height)

Parameters

height float

Returns

float

PhaseOf(uint)

Where in its beat a drip's drops fall, seconds after a whole interval of the clock.

public static float PhaseOf(uint seed)

Parameters

seed uint

Returns

float

PuddleOf(uint)

The radius of a drip's puddle, metres; 0 where it has none.

public static float PuddleOf(uint seed)

Parameters

seed uint

Returns

float

RingLifeOf(uint)

How long a drip's rings show, seconds: RingSeconds, or less for a quick drip, so no more than three of its rings (the last landed, the one before, the one due) are ever on its puddle.

public static float RingLifeOf(uint seed)

Parameters

seed uint

Returns

float

SecondsToLanding(uint, long, float, int)

Seconds from now until drop cycle + offset lands (negative: since it landed), from the beat ClockAt(double, uint, out long, out float) read.

public static float SecondsToLanding(uint seed, long cycle, float into, int offset)

Parameters

seed uint
cycle long
into float
offset int

Returns

float

Seed(uint, float, float, SceneDripLanding)

A drip's seed: hash's low 12 bits (its phase and jitter), its interval, its puddle and its landing.

public static uint Seed(uint hash, float interval, float puddleRadius, SceneDripLanding landing)

Parameters

hash uint
interval float
puddleRadius float
landing SceneDripLanding

Returns

uint

SpeedAt(float)

How fast a drop falls seconds after it lets go, m/s.

public static float SpeedAt(float seconds)

Parameters

seconds float

Returns

float