Cold Start
README.md
preseed.tides.state — the TIDES shared contract
Everything that crosses a lane boundary in part 9 ("THE FARJAN"), as pure
functions of part-local t and nothing else. No state, no side effects, no
entity lookups, no ctx.
local State = require("preseed.tides.state")
State.ship(t) --> { pos = {x,y,z}, forward = {x,0,z}, speed, headingDeg }
State.sea(t) --> { windSpeed, windDirection, choppiness, amplitude,
standingWaveRatio, foamDecay, significantHeight }
State.weather(t) --> { squall01, coverage, cloudBase, cloudTop, wetness, rain01 }
State.light(t) --> { sunElevDeg, sunAzimuthDeg, timeOfDay, sunColor, sunIntensity,
ambientColor, ambientIntensity, keyOcclusion01, exposure }
State.palette(t) --> { skyHorizon, skyZenith, skyGround, cloudLit, cloudShadow,
waterBody, foam, fogColor, hullRed, upperworksWhite,
antifoul, bootTop, cabinEmissive }
Why pure
Hot-reload rebinds a module's function bodies without re-running its module-level chunk. Module-level mutable state in a shared file therefore keeps the old build's values while running the new build's code, and the bug looks like it is in whichever lane read it last. A file of pure functions cannot do that.
It is also what makes the wake derivable. Because ship(t) is pure, the wake at
time t is exactly the locus { ship(t - a) : a in [0, 26] } — sample it and a
scrub, a seek or a hot-reload all produce the identical wake. An accumulating
wake is empty after every seek, and this demo is scrubbed constantly.
No lane may add module-level mutable state to this file.
Ownership
| Function | Owner (may retune the numbers) | Readers |
|---|---|---|
ship | SEA (track & speed) | CAMERA, SEA, FERRY |
sea | SEA | SKY, CAMERA |
weather | SKY | LIGHT, SEA, FERRY |
light | LIGHT | SKY, SEA, FERRY |
palette | LIGHT | everyone |
A lane needing a new field appends it. Nobody renames or removes one.
Fixed facts
- Axes:
+X= ahead (bow),-X= astern,+Y= up,-Z= port,+Z= starboard. The sun sits just off her starboard bow. - Music: 192 BPM, 4/4 —
BAR= 1.25 s. Thirty seconds is exactly 24 bars. Nothing changes on a number that is not a multiple of 1.25. pos.yis the calm-water datum, not her true height.preseed.Buoyantowns her vertical; read the entity for her realy.ProceduralSkyowns the sun's direction viatimeOfDay.sunAzimuthDegis the intended bearing the clouds are lit against, not an instruction to write a direction onto theLight.