Class SceneDrip
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
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
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
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
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
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
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
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
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
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
MostPuddle
The largest puddle's radius, metres (7 bits of centimetres).
public const float MostPuddle = 1.27
Field Value
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
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
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
SpatterSeconds
How long the spatter of a drop's landing is in the air, seconds.
public const float SpatterSeconds = 0.32
Field Value
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
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
FallSeconds(float)
Seconds a drop takes to fall height metres (the inverse of FallenMetres(float)).
public static float FallSeconds(float height)
Parameters
heightfloat
Returns
FallenMetres(float)
Metres a drop has fallen seconds after it lets go (with the air's drag).
public static float FallenMetres(float seconds)
Parameters
secondsfloat
Returns
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
Returns
IntervalOf(uint)
The seconds between a drip's drops (on the even beat), from its seed.
public static float IntervalOf(uint seed)
Parameters
seeduint
Returns
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
Returns
LandingOf(uint)
What a drip's drops land on (3 reads as rock).
public static SceneDripLanding LandingOf(uint seed)
Parameters
seeduint
Returns
LeastIntervalFor(float)
The shortest interval a drip falling height metres may have (InFlight), seconds.
public static float LeastIntervalFor(float height)
Parameters
heightfloat
Returns
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
seeduint
Returns
PuddleOf(uint)
The radius of a drip's puddle, metres; 0 where it has none.
public static float PuddleOf(uint seed)
Parameters
seeduint
Returns
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
seeduint
Returns
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
Returns
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
hashuintintervalfloatpuddleRadiusfloatlandingSceneDripLanding
Returns
SpeedAt(float)
How fast a drop falls seconds after it lets go, m/s.
public static float SpeedAt(float seconds)
Parameters
secondsfloat