# lowWater.ui.flow
Low Water's screen flow on menusKit: the title (Continue / New Game / Settings / Quit over a title camera on the drained bed), pause, settings, game over on this player's death (Continue from last save / Restart / Main Menu) and credits. Story listens with on("newGame" | "continue" | "restart" | "quit" | "title", fn) and calls credits() at the ending or gameOver() itself.
# story.props
The small story objects of Low Water, built while the scene builds: the gatehouse key ring with the radio, the shift log book, fuses, the lift fuse panel, the upgrade pickups (battery pack, crepe soles, whip antenna, first aid tin), notes, memos, tape reels and the save-lamp terminal cabinet. Each is a named group of bulkheadKit primitives at real size: a slot the polish pass replaces in place with the real model. Controls the building slices already model (breaker cabinets, valve wheels, the mimic panel, the hoist lever, the phone) get an empty marker so the prompt sits on their geometry.
- `build(parent, name, kind, at, yaw?)` builds one; `isSlot(kind)` says whether it draws geometry of its own.
- Called from `lowWater.story.entry.build`.
# story.creature
The Lowman, Low Water's one monster, on stalkerKit (aiKit brain, navKit movement, SecondWind health). Called by `lowWater.story.flow`.
- Kinds (`defineKinds`, every peer): `lowman` (turbine hall and village: drawn to torch light, stalks, hunts the last-known spot), `lowmanListening` (galleries: nearly blind, hears 2.8x as far, so walking slowly and keeping the torch off matter), `lowmanChase` (finale: sees everything, never retreats, runs just under a sprint).
- `phase(name)` (host only, idempotent): `hall`, `hallEnd`, `gallery`, `galleryCalm`, `galleryEnd`, `villageReveal` (seen standing by the church, then gone), `villageHunt`, `towerCalm`, `finale`, `end`.
- Nav maps per area (`MAPS`), baked once on the host by `bake` / `prebake` ahead of each encounter.
- `setEnabled(false)` keeps it hidden (the end-to-end check), `breakOff()` sends it to a lair after a kill, `state()` reports the phase, maps and its stalkerKit info.
The body is stalkerKit's `pursuer` for now. The reference (`design/references/creature_silhouette.png`) wants a tall gaunt figure draped in river weed and dripping silt; stalkerKit has no such body style yet (reported to the plan agent as a stalkerKit gap).
# fx
Tidewater's water effects for gameplay, each in the seven looks and usable without any other
part of the kit:
```lua
local Fx = require("tidewater.modules.fx") -- inside the package: require("~.modules.fx")
Fx.splash("plop", { x, y, z }) -- pebble
Fx.splash("body", pos, { size = 1.2, sync = true }) -- person, played on every peer
Fx.splash("spray", pos, { wind = { 8, 0, 0 } })
local mist = Fx.mist(pos, { width = 8, sparkle = 0.6 }) -- continuous: :set(opts) / :stop()
local bow = Fx.emitter("bow", { position = p, dir = d, speed = 9 })
local stop = Fx.autoSplash() -- everything entering water splashes, exits drip
```
One-shots: `plop`, `body`, `droplets`, `spray`. Continuous (`Fx.emitter`, or `Fx.splash` for
`duration` s): `bow`, `spindrift`, `mist`, `drips`, `bubbles`, `wake`. The look defaults to the
look of the Tidewater water at the point, else `opts.look`, else realistic. Every one-shot rings
the water through the ripple field (`ripple = false` skips it). `sync = true` sends the effect
to every peer on the `tidewater.fx` channel; `Fx.autoSplash` / the `Splashes` component play
automatic splashes on the body's owner only, synced, so nothing is doubled. `Fx.classify`,
`Fx.lookFor`, `Fx.windFor`, `Fx.warm`, `Fx.stats` and `Fx.stopAll` round it out.
# story.steps
The spine of Low Water as data, read by `lowWater.story.flow` (runtime), `lowWater.story.entry` (build) and the end-to-end check (`lowWater.story.e2e`).
- `LIST`: every step of the night in order, from the gatehouse keys on the road to the truck at the end. Each has an `id` (world flag `lw.<id>`, cue `lw_<id>`), a `chapter` (1 crest, 2 control house, 3 turbine hall, 4 galleries, 5 village, 6 tower and finale), the `objective` line shown while it is current, `how` it completes (`use`, `lore`, `save`, `area`, `parts`), where (`at`, `size`), the control's look (`prop`, `label`, `hold`), the `early` line a press gives before its turn, `xp`, and the scriptedEventsKit `beats` it sets off.
- `UPGRADES`: the four progression pickups (saveKit unlocks): heavy-duty battery, crepe soles, long whip antenna, first aid kit.
- `LORE_PROPS`: where each note, tape and scrawl sits.
- `get(id)`, `order()`, and the helpers `spot`, `conn`, `savePos` over `lowWater.layout`.
Coordinates all come from `lowWater.layout`; the only ones written here are the office set's phone and reel-to-reel and the tower deck the lift lands on.
# story.flow
Low Water's flow of play at runtime, started on every peer by `lowWater.story.entry.start` (the scene entrypoint's `onLoad`).
- **Steps to cues.** Each step in `lowWater.story.steps` becomes a scriptedEventsKit cue `lw_<id>` (once, players = all), gated by the previous step's flag, which sets the world flag `lw.<id>`, gives XP and plays the step's beats. The host decides every fire, so in co-op both players see the same lights, sounds, messages and creature. Area steps are area triggers; use steps fire from interactKit `use` events on `Story_<id>`; the shift log fires on loreKit's `read`; the first save fires on the control-office SaveTerminal.
- **Objective always visible.** `refresh()` (on every flag change and every 2 s) writes the first unfinished step's line to the HUD through `Horror.objective`, with a chapter card on each new chapter, and switches off the prompts of finished controls. A press before its turn answers with the step's `early` line.
- **Pacing.** Nine scaresKit scares placed through `Scares.place`, gated by tensionKit's slowBurn director (essential only where a beat depends on them), plus the story's own moments: the crest lamps dying one by one, the phone, the mimic panel, the bell, the flood wave.
- **The creature.** `lowWater.story.creature` phases from the beats: first hunt by light in the hall when power returns, by sound in the galleries as the water rises, the reveal by the church, the hunt for the lift fuse, the finale chase.
- **Radio.** Messages (`lowWater.story.lore.RADIO`) play as subtitles with static once the radio is picked up; the radio itself is `lowWater.core.omen` (equipped through `lowWater.story.progression.apply`), and its first spike in each chapter teaches the rule for that area.
- **Water.** `lowWater.core.flood`: gallery 1 floods when the valve shuts; the reservoir refills when the hoist is thrown.
- **Death and co-op.** SecondWind deaths call `saveKit.died`, flash, send the creature back to a lair and call `lowWater.ui.entry.showGameOver` if the presentation slice defines it; respawn is at the last save lamp (Lifeline spawn on each SaveTerminal). With two or more players the health model is `downed` (20 s bleed-out, partner revives in 3 s).
- **Continue / new game.** `continueGame()` restores lights, water and the creature's phase from the flags and puts the player at their last save lamp; `newGame()` resets the world's story state (upgrades and XP stay).
- **Ending.** The truck: fade, the closing radio call and lines, `progression.finished()`, `onEnding` listeners, then `rollCredits()` through `lowWater.ui.entry.showCredits(spec)` or menusKit's `showCredits`.
- `state()` is everything the end-to-end check and a HUD need.
# Low Water
A complete first-person survival horror game, for one player or two in co-op, built almost entirely from installed kits. Install this package and you get the whole game: its three scenes, its level, its story, its tuning, its art direction and its sound. Every system it runs on (flashlight and battery, failing lights, scripted events and scares, the tension director, the creature that hunts by light and sound, notes and tapes, saving, menus, weather, water) comes from the kits it declares.
Version **1.0.17**.
## The game
Storm night, October 1974. The Varne valley dam has gone silent, and its reservoir has been drained for the first time in forty years, uncovering Hollin Varne, the village that was flooded to build it. You are the relief engineer sent up the mountain road when the night shift stopped answering. Something came up out of the mud with the village.
Six areas, walked one into the next:
1. **The access road and the dam crest** in a rainstorm, the sodium lamps dying one by one.
2. **The control house**: the shift office, the shift log, the mimic panel, a safe room and the first save lamp.
3. **The turbine hall**: four dead generators. Reset the section breakers and the power comes back hall by hall, while the Lowman hunts your light.
4. **The inspection galleries and the spillway tunnel**: black water on the floor, rising behind you, and a Lowman that hunts by sound.
5. **The drained reservoir and the drowned village**: fog, mud, the church of St Brannoc and its bell. The reveal.
6. **The intake tower**: throw the gate hoist so the water comes back, then run for the truck. A real ending, then credits.
A first playthrough takes 25 to 40 minutes. A clear objective is always on screen. Nine authored scares are each chained to the story beat that guarantees you are there, so every one of them fires.
**Controls:** WASD move, mouse look, **F** flashlight, **V** shake a dying flashlight, **B** swap battery, **G** radio, **E** use, **Esc** pause. Gamepad and touch work too, and every action can be rebound in Settings.
**Choices that matter:** the Lowman hunts by your light and by your noise. Turning the flashlight off and keeping quiet are real choices, and the radio in your left hand crackles louder as it closes in.
**Progression:** XP for every step, and four upgrades kept between nights (a heavy-duty battery pack, crepe soles that carry half as far, a long whip antenna that warns earlier, a first aid kit).
**Co-op:** a second player joins the same night. Each player has their own flashlight, fear, health, radio and HUD; both see the same doors, lights, water, scares and creature. A downed partner can be revived.
## Play it
Install the package; its scene `lowWater.scenes.main` is the game. Make it your world's startup scene (`startup_scene = "lowWater.scenes.main"` in `.world_settings`) and press Play: the game starts on the title screen.
## How it is put together
| part | what it holds |
|---|---|
| `scenes/main` | the one scene every player shares: the interior areas, the player, the HorrorDirector, the storm, the shared reservoir |
| `scenes/exterior`, `scenes/village` | the heavy exterior (crest, dam, valley, tower; the drained bed, village and church), additive scenes each player loads beside main |
| `layout` | every area's bounds and connections, spawn, save lamps, key spots, creature anchors and lairs, light circuits and water volumes |
| `core` | area streaming (each player's view shows its area and neighbours), the outdoor scene loader, the radio adapter on omenKit, the water adapter on floodKit |
| `exterior`, `interior` | the level: set pieces as scene modules, lights on eerieLightsKit circuits, Tidewater water, Cloudburst fog and indoor volumes |
| `story` | the night: 19 steps as scriptedEventsKit cues, the scares, the Lowman (stalkerKit kinds and encounter phases), lore, progression, New Game and Continue, the ending |
| `ui`, `audio` | the menusKit look, title, pause, settings, game over and credits, the horrorKit HUD palette, the hands, ambience, music and voices |
The guides inside the package go further: **How Low Water is put together** and **Example: make a survival horror game from the horror kits, with Low Water as the worked example**.
## Built on
| kit | version | used for |
|---|---|---|
| horrorKit | 1.0.21 | flashlight, eerie lights, scripted events, scares, tension, the creature, lore, safe rooms, save lamps, HUD (and the kits it brings: saveKit, interactKit, inventoryKit, controlsKit, SecondWind, Lifeline, soundstage, juiceKit, aiKit, navKit) |
| omenKit | 1.1.2 | the radio that warns the Lowman is near |
| floodKit | 1.0.4 | the rising gallery water and the refilling reservoir |
| cloudburst | 1.6.11 | rain, lightning, wind, fog, dry interiors |
| tidewater | 1.2.22 | every water surface |
| graphicsPresets | 1.1.1 | the graphics quality setting |
| menusKit | 1.4.5 | title, pause, settings, game over, credits |
## Tests
- `storyFlow` (test suite): the story's steps, objectives and writing rules.
- `lowWater.story.e2e`: `require("lowWater.story.e2e").run()` in play, as the host, plays the night from New Game to the credits (every step, every objective, the tower lift, the ending, the credits, XP) and checks that all nine scares fired. Last run: 53 of 53.
## Changelog
- **1.0.17**: on Cloudburst 1.6.11, whose rain and thunder sounds are no longer copies inside the kit: they are installed from the worlds they were made in (light and heavy rain, rain on a slate roof, and three thunder claps). Same storm, same sound; the copies Cloudburst 1.6.7 carried are gone.
- **1.0.16**: on floodKit 1.0.4, which states Tidewater 1.2.22. Until now floodKit 1.0.3 still named Tidewater 1.2.19, so the game carried a second, older Tidewater beside the one it plays with; that copy is gone. Same water, same finale.
- **1.0.15**: on Tidewater 1.2.22 (Tidewater FX 1.1.11). In the finale floodKit writes the surge spray's rate every frame; the spray (Tidewater FX spindrift) fell off the device and cooked its whole graph again on the CPU at each write, 4 to 5 ms of script a frame on desktop and 12 to 24 ms in the browser. It now takes those writes on the device. Same spray, same look (pictures media/speedround14, before and after from the same two cameras).
- **1.0.14**: the crest truck's windscreen really draws now, in play. Since 1.0.12 the crest module built it as a plain box, but the exterior scene's saved build (scenes/exterior scene.json and its authoring state) still held the 1.0.10 recipe with a 3 cm bevel on 6 cm glass, and play loads that saved build. The exterior scene is rebuilt from the current crest module here; in play the "could not be made" line no longer appears.
- **1.0.13**: the main scene loads whole again in a fresh client. omenKit 1.1.1 was built on an older @builtin, so installing it placed an old copy of the quick geometry nouns (deps/07158574/versions/29f1a966...), and the main scene build had `mergeGeometries` from both copies: the scene loaded PARTIAL for players since at least 1.0.7. On omenKit 1.1.2 (current @builtin) only one copy is left.
- **1.0.12**: the truck's windscreen on the crest draws again: its 6 cm glass is a plain box now, like the grille beside it. Rounded, its bevel could not be built and every load logged an error.
- **1.0.11**: tried to fix the windscreen by rounding it less (3 cm to 2 cm); the error stayed.
- **1.0.10**: really carries floodKit 1.0.3 and omenKit 1.1.1. In 1.0.9 the pull request merge wrote the older floodKit 1.0.1 and omenKit 1.1.0 files into the release, so 1.0.9 played with floodKit 1.0.1. Both are installed again here.
- **1.0.9**: on floodKit 1.0.3, whose surge starts a ripple ring effect at most every 0.6 s (it asked for six or seven a second, the finale's biggest cost), and Cloudburst 1.6.7, whose landing map is cast under a time budget and whose scene fog is read four times a second. 1.0.8 was never published: this release carries its Cloudburst update too.
- **1.0.7**: on Tidewater 1.2.19, whose sea passes only waves at least 3 mm high to physics, so floating things take less physics time. Nothing else changed.
- **1.0.6**: on horrorKit 1.0.21 (saveKit 1.3.21 with its package.yaml, controlsKit 1.4.9) and menusKit 1.4.5, the releases that no longer need the engine's deleted zui UI library; the world entrypoint loads its dark theme through `ui.loadTheme`. 1.0.5 notes were published without a package change.
- **1.0.4**: the exterior and village are walkable from the first frame of every boot, not only once warm (a safety floor under the crest/road, the bridge and the low ground, always built, since the real terrain loads as a deferred additive scene that takes real seconds, and the old fallback was switched off at authoring time whether or not that terrain had actually arrived); the title screen closes for certain on New Game, Continue, Restart and Retry, instead of trusting a heuristic that could skip it; horrorKit 1.0.19 (its barsKit dependency copy carries barsKit's own Showcase component again, so nothing installed differs from what it was published with).
- **1.0.3**: the outdoors is back (after the move into this package the terrain scene module required itself, so the exterior scene was saved nearly empty: no dam, road or tower, and players fell through on the road); New Game starts on the road with ground underfoot; the title screen shows only the menu (the held radio and torch, the interact prompt and the save banners hide while a menu is up, on omenKit 1.1.1's `Omen.setHidden`); faster: area streaming walks only the areas that change, only the two splash kinds the game shows are kept ready (each ready splash ran its effect graph every frame), the storm waterfall keeps only its mist, High shadows reach 90 m; on Tidewater 1.2.16 (its underwater pass compiles again); the reuse review rates every package used, 1 to 5.
- **1.0.2**: first public release (1.0.0 and 1.0.1 were never released with the game in them).
- **1.0.0**: first release.
# Tidewater FX
Version 1.1.11.
Water effects for any Zero game or kit, with or without a water kit: a splash when something
falls in (automatic, sized by the body and how hard it hits: a pebble plops, a person throws a
crown and a column), droplets, spray and spindrift off breaking waves, foam, a wake behind boats
**and** swimmers, waterfall mist, drips, bubbles under water, footsteps in puddles and shallows,
fish jumps, rain splashes, and rings on the water (a GPU ripple field plus visible ring
particles). Seven looks: **realistic**, **crystal** (tropical clear), **cartoon**, **painted**
(ink), **lowpoly** (retro), **pixel** and **toy** (glossy plastic, for toy-style games).
Every effect finds the water through the engine's `Physics.water`, so it lands on any water that
declares itself there: Tidewater's, the engine's `Water` component, terrain lakes, another kit's.
Tidewater depends on this package; this package depends on nothing but the engine.
## Quick start (2 minutes)
1. Put a `Splashes` component on any one entity in your scene (a manager, the water):
```lua
entity.find("GameManager").component.add("Splashes", { look = "" }) -- "" = the water's own look
```
Now anything that falls into water splashes, whatever comes out drips, every character
splashes footsteps in shallows and leaves a wake when it swims, and when a weather kit says it
rains, the water round the camera splashes with raindrops. Splashes are sent to every peer.
2. Put a `Wake` on each boat (its +Z is the bow):
```lua
boat.component.add("Wake", { width = 1.6, length = 4.5 })
```
3. Call effects yourself:
```lua
local Fx = require("tidewaterFx.modules.fx")
Fx.ripple(point, 0.5) -- a ring on whatever water is there
Fx.splash("plop", point, { size = 1, sync = true }) -- every peer sees it
local mist = Fx.mist(poolCentre, { width = 6 }) -- continuous; mist:stop()
```
4. Press Play. Effects are particles on the engine's procgen simulation: **they only run while
the game runs** (in edit mode an effect holds its frame).
## API (`require("tidewaterFx.modules.fx")`)
| Call | What |
|---|---|
| `Fx.splash(kind, point, opts?)` | one-shot: `plop`, `body`, `droplets`, `spray`, `footstep`, `fishJump`, `rainSplash`, `ring` (aliases: `pebble`, `stone`, `person`, `jump`, `puddle`, `rain`, ...). Continuous kinds play for `opts.duration` s. opts: `size` (1 = the kind's natural size), `look`, `dir`, `wind`, `ripple = false`, `snap = false`, `sync = true`. |
| `Fx.ripple(point, strength, opts?)` | a ring: strength 0..4 (raindrop 0.1, stone 0.5, person 1). Goes into the ripple field every Tidewater-style water shader samples, and from 0.25 up also plays a visible ring lying on the surface (`opts.visible` forces it either way). `sync = true` for every peer. Answers false off water. |
| `Fx.emitter(kind, opts)` | continuous `bow`, `spindrift`, `mist`, `drips`, `bubbles`, `wake`, `foam`; handle `:set(opts)`, `:stop()`. Shortcuts `Fx.mist`, `Fx.spray`, `Fx.drips`, `Fx.bubbles`. |
| `Fx.autoSplash(opts?)` | splash anything entering water (what `Splashes` runs). Answers a stop function. |
| `Fx.watchCharacters(opts?)` | footsteps, entry splashes, swimmer wakes for every `CharacterController`. |
| `Fx.watchRain(opts?)` | rain splashes on water round the camera while `weather.rain` > 0. |
| `Fx.warm(kinds?, count?, { looks?, sizes? })` | build plays ahead (see Known limits). |
| `Fx.setLookProvider(name, fn)`, `Fx.setDefaultLook(look)` | how a water kit tells effects which look its water has. |
| `Fx.surfaceAt(point)`, `Fx.stats()`, `Fx.snapSize(size)` | helpers. |
| `Fx.stopAll(filter?)` | stop live emitters and wakes (and a wake's laid foam); `{ scene = name }` or `{ owner = entity }` narrows it. Answers how many stopped. |
**Emitters never outlive what started them.** Each emitter remembers the scene that was active
when it started (`opts.scene` overrides) and, given `opts.owner` (an entity or id; `root` counts
too), that entity. A scene unloading stops its emitters; an owner despawning stops its own within
a second. `Wake` passes its boat as the owner. `Fx.stats()` counts them as `unloadStopped` and
`orphaned`.
Components: **`Splashes`** (`everything`, `look`, `minSpeed`, `scale`, `drips`, `sync`,
`characters`, `rain`) and **`Wake`** (`width`, `length`, `minSpeed`, `spraySpeed`, `fade`,
`look`, `bowSpray`, `ripples`, `intensity`; read `status`).
### Without a dependency: named values
A kit that must not depend on this package writes **named values** on any entity; this package
listens on every peer and plays them:
```lua
values.set(myEntity, "water.ripple.strength", 0.6) -- optional, default 0.5
values.set(myEntity, "water.ripple", vector.create(x, y, z))
values.set(myEntity, "water.splash.size", 1.5) -- optional, default 1
values.set(myEntity, "water.splash.plop", vector.create(x, y, z)) -- any one-shot kind
```
Each write is one request. Declare the value with `replicate` on a synced entity and every peer
hears it. Nothing happens (and nothing breaks) when the package is not installed.
### Weather
Rain, wetness and wind come from any weather kit that publishes `weather.rain` (0..1),
`weather.wetness`, `weather.wind` named values (Cloudburst does), read by
`tidewaterFx.modules.weather`; a game with no weather kit calls
`require("tidewaterFx.modules.weather").set({ rain = 0.6 })`.
## Looks
`realistic` lit beads with sun glints and scattering spray; `crystal` glassy, mostly see-through
beads with a turquoise rim and hard glints; `cartoon` solid white blobs with an inked outline;
`painted` brush-dabbed bands with paper grain; `lowpoly` flat-shaded octahedron chunks and
hexagon cards; `pixel` square pixels, two tones, stepped fade; `toy` glossy moulded-plastic droplets in two candy bands with a hard highlight (also `plastic`, `toybox`, `bathtub`). An effect takes `opts.look`, else
the look of the water it lands on (a registered look provider; Tidewater registers its water's
look), else the default look.
### Every effect in every look
Each look has its own effect styling, not only its own water: the same splash, wake and ripple
drawn in all seven looks, in play, each held at the same moment of its life (splash at 0.6 s,
ripple at 0.8 s, wake segments at 1.2 and 1.65 s), on a small pool in that look.
Order: realistic, crystal, painted, cartoon / lowpoly, pixel, toy.



## Multiplayer
`sync = true` splashes are sent by the caller to every peer (`Splashes` sends each entry splash
from the body's owner only, so it is seen once per player). Wakes, footsteps and swimmer wakes run
on every peer from the replicated transforms, so nothing is sent for them.
## What changed in 1.1.11
- **Spindrift stays on the device when a game moves it.** Its graph worked out the wind's speed and the direction across the wind with Luau maths on its `wind` input, so the play fell off the device and every write of `rate` (or `wind`) cooked the whole graph again on the CPU: about 170 ms of CPU per cook on desktop, spread over the frames after it. floodKit writes the rate of its surge spray every frame as the water speeds up and slows, so Low Water's finale cooked spindrift 180 times in a few minutes (4 to 5 ms of Luau a frame on desktop, 12 to 24 ms in the browser). Fx now works out `across` and `speed` from the wind itself and hands them to the graph as inputs, so the play stays on the device and a write is a write, not a cook. Same spray, same look; measured in Low Water's finale (tower deck, storm at ultra), browser engine CPU p50 117.6 / 133.3 / 53.5 ms with the old graph against 104.7 / 109.7 / 39.1 ms with this one, alternated in one session. On desktop the Luau cook row goes (4 to 5 ms a frame to none) but the whole frame stays within the machine's swing, as the device run of the spray costs the engine about what the cook did there.
- **`Fx.inputsFor(kind, opts, look)`** answers the inputs a play is handed, what Fx fills in included.
## What changed in 1.1.10
- **Built against the current engine library** (`@builtin` 9b32baa), released with Tidewater 1.2.17 so a world installing them gets an engine library whose `depth` shader module holds the three-argument `zero_linear_depth_through` that Tidewater's underwater view calls. No change to what the effects draw.
## What changed in 1.1.8
- **One ready play per kind, not three.** The `waterfx` effect's `pool` setting was 3, so every
entry a water body warmed (or played once) was topped up to 3 kept plays, and every kept play
runs its graph each frame (platform issue 01M80B3VZP1AQR343JKBWDTTBV): 9 plays (body, footstep,
droplets) ran every frame anywhere in a level with water, also far from it. The pool is now 1;
a kind warmed for bursts (the rain splash and ring ask for 2) keeps exactly what it was warmed
for (`runWarmJob` sizes the entry). Measured in the Hold Your Breath world (Brinefall's med bay,
native desktop, 1920 x 1080, dev build, shared machine): dropping those plays took about 2.7 ms
of engine CPU off every frame.
## What changed in 1.1.7
- **Readying splashes no longer holds the game below its frame rate for a minute.** `Fx.prime`
used to build and keep every one-shot kind (8, plus a second rain splash, ring and plop) and
six continuous kinds the first time a player came near water. Every kept play runs its effect
graph each frame (platform issue 01M80B3VZP1AQR343JKBWDTTBV), and each build is seconds of graph
cooking, so a player wading into an indoor lake paid for it. Measured in the Hold Your Breath
world (Brinefall's flooded lab, native desktop, 1920 x 1080, dev build, shared machine; engine
CPU per frame, 4 s windows): before, 11.7 ms at rest, then 19 to 38 ms for about 35 s while the
13 plays were built, and still 19 to 23 ms a minute later with 13 ready plays and 4 parked ones.
After, same spot, same session kind: 9 to 11 ms for the whole minute (p95 under 17.3 ms), with
3 ready plays and 1 parked drips play. Now `Fx.prime` readies what that water
makes: the body splash, footsteps and droplets (Fx.autoSplash, swimmers), drips (a body leaving
the water), and the rain splash and ring only while it rains. Spray, fish jumps, mist, foam,
spindrift, bow spray, bubbles and wakes are built the first time they play (the waters that
make them start their own emitters, which park for reuse). `opts.kinds` names the one-shot
kinds to ready, `opts.full = true` readies everything as before, `opts.lean` is unchanged.
- **Warm builds are spaced** 0.75 s apart (`WARM_GAP`), so the frames between two builds stay free.
## What changed in 1.0.10
- **Parked and warming effects now cost nothing.** A continuous emitter that is stopped (or primed and parked far
below the world at y -5000, ready for reuse) used to keep simulating with its rate at zero, forever: a water body
priming its look left six such loops (mist, bubbles, foam, spindrift, drips, bow) running every frame. A parked
play is now paused once its last particles are gone (at once when it is parked far below the world), and resumed
when it is taken over, so the first real use still shows on the next frame. Each warming play is paused the moment
it has built, and every warming play is stopped at the end of its job even after an error. `Fx.prime` skips a
continuous kind already live or parked in that look (no second drips build). Measured in Tsukimichi: procgen
generators still updating each frame 14 -> 7, their average cost 1.81 -> 0.32 ms.
## Cost (measured here, desktop, heavily shared engine)
- A one-shot play: ~0.07 ms CPU per frame while it plays; GPU particle capacities plop 50, body
204, droplets 30, spray 68, bow 400, spindrift 560, mist 600, drips 320, bubbles 400, wake 600.
- Ripple field: 256² over 64 m round the camera, ~0.04 ms GPU per frame.
- A ready (warmed) play shows on the next frame: body, plop, droplets, ring and rainSplash all
advanced 0.05 s after the call. A play built on the spot waits for the GPU: 1-10 s on a quiet
machine, and several minutes (mist about 400 s, bubbles about 450 s) on this machine while its
GPU queue ran 80-90 s behind.
## Known limits
- **An effect played before it is readied shows late: engine #26227** (a new play draws nothing
until a long hidden warm-up through its whole graph finishes). `look` is a build input: each
look is its own build; every other input (`size`, `width`, `rate`, ...) is live, so one ready
play of a kind in a look serves every size. Tidewater calls `Fx.prime(look)` the first time a
player comes near water of that look: since 1.1.7 only the splashes that water makes (body,
footstep, droplets, the rain kinds while it rains, and drips started out of sight and parked);
`Fx.prime(look, { full = true })` readies every kind as before.
Measured on a busy desktop: one-shots ready 0 to 8 s after the water was built, continuous kinds
30 to 38 s after; from then on every effect drew within 0.05 s of being triggered, every time.
An effect triggered before that waits for the engine (more than 8 s on the same desktop). A game
with a look of its own calls `Fx.prime(look)` at load, behind a loading screen if it can.
*(world tracker #1)*
- **A stopped endless play does not go back to the pool: engine #26226.** Worked around here: a
stopped mist, drips, bubbles, foam, spindrift or bow spray is parked (emission to zero) and the
next of its kind and look takes it over with no build. *(world tracker #2)*
- **Effects do not animate in edit mode**: the engine holds effect plays until play.
*(world tracker #3)*
- **After a shader or effect edit, live materials and pooled plays keep the old build: engine
#26228.** Rebuild the water (reload the scene once it has finished loading) before judging it.
- Ripple-field rings show only on water whose shader samples the field (Tidewater's waters) and
within 64 m of the camera, or of `require("tidewaterFx.modules.ripples").setFocus(x, z)`; on
other water `Fx.ripple` plays ring particles instead *(world tracker #5)*. In the realistic look
a field ring is a gentle bend in the reflections; the ring particle is the part you see from a
distance. On **puddles** a few millimetres of water bend too little light for a field ring to
read, so a hit of a stone's strength or more (0.2 and up) on a puddle also plays the visible
ring, even while rain rings fill the pool (`documentation/media/r8_puddle_impact_rings.jpg`:
impacts on the rainy street's puddles, strong and gentle). The engine's
`'tidewater_ripple_field' ... is not a resident GPU texture` warning is spurious: the field is
bound and resident.
- Rain rings on Tidewater water are drawn by the water shader from `weather.rain`, whatever the
camera; rain splash particles fall only within `radius` of the active camera.
- At most 40 one-shots and 48 emitters at once from this module (and the engine bounds each
entry), so loops cannot pile plays up.
- **A burst can start late.** The effect keeps up to `pool: 4` plays per entry (counting the ones
playing), and a pool that runs dry refills itself at the front of the warming queue; a play
while all of them are out builds a fresh one on the spot (engine #26227). Warm the kinds you
burst with `Fx.warm(kinds, n, { looks = {...} })` so `n` plays are ready.