# riceAndShine.exits
Rice and Shine's own exit kinds for Sealed Orders contracts, defined once when the module is required (the tutorial scene's build and entrypoint require it; any level using these kinds should too, before its contract is checked).
- `culvert`: crawl out through a drain under a wall (3 s). Used by Morning Drill's drain under the south wall.
- `monkGate`: walk out of a guarded gate; only a player wearing disguiseKit role `monk` is let through, otherwise the exit is refused and the HUD shows why. Used by Morning Drill's front gate.
- `Exits.roleGate(id, role, def)`: define another gate kind that lets only one role out (def: title, verb, leaving, refusal, seconds, icon).
A kind's `canUse(exit) -> (ok, reason?)` is asked by Sealed Orders (assassinationKit client) before it offers an exit.
# riceAndShine.hud
Per-tick glue for Rice and Shine's HUD finish, called from `riceAndShine.game`'s `RS.tick` (four times a second):
- applies the player's settings (`riceAndShine.settings`: volume, look speed, inverted look), so a freshly loaded level's camera rig and mixer pick them up;
- has each level drawn in ink into navUiKit's minimap once its contract begins (`riceAndShine.inkMap`).
# audio
Rice and Shine's sound, run on every peer for that peer's own player. `RS.tick` (riceAndShine.game) calls `Audio.tick(dt)` every frame; the work inside runs at 4 Hz and only fades voices per frame.
- **Festival (Obon night):** bon-odori taiko and shinobue heard from the yagura (spatial), crowd murmur along the main and market streets and round the dance ring (spatial emitters), river water along the town's river (emitters read from the town plan), night insects that rise in quiet lanes as the crowd falls away; the town kit's distant matsuri bed dips in the lanes.
- **Morning Drill (dawn):** the town kit's dawn bed (birds, roosters, breeze) as soundstage's base ambience, wind in the bamboo grove (spatial), distant drill shouts from beyond the walls every 9-19 s.
- **Player:** soundstage footsteps on the town kit's earth/tatami surfaces (cadence follows speed), softer when crouched, cloth rustle on crouch and on steps.
- **Music:** a low tension layer that rises with disguiseKit heat (being watched) and the stealthKit alert, and falls back gently; a resolve cue when the phase becomes `debrief`. soundstage's stock music (which stealthKit's Director drives) is kept silent in levels. The kill's ink sting stays assassinationKit's.
- **Settings:** `Audio.applySettings({ master, music, effects })` sets the engine mixer (effects covers sfx, ui, ambience, voice). riceAndShine.settings calls it.
- **UI:** `Audio.ui("open" | "close" | "click" | "hover")` plays paper sounds.
- `Audio.report()` reads back what plays, for checks.
Clips live in `riceAndShine.sounds` (generated with the engine's audio generation), plus `soundstage.beds.ss_bed_night` and sengokuTownKit's `sk_bed_town_dawn`. Live voices are kept in riceAndShine.audioState so an edit while playing does not leak them.
# riceAndShine.look
The game's art direction inside the levels: the title art's sumi-e ink and wash, made live.
`RS.tick` calls `Look.tick()` every frame; it checks once a second and writes only what differs:
- inkBlocks' **brush-and-wash** look (tapered brush line, tonal ink washes that dissolve into mist, paper grain) in **sepia** ink, tuned per contract in `Look.TUNING` (a soft dawn for Morning Drill, a deep moonlit night for the festival).
- The **stealth** role set without its colour glazes; enemies keep a vermilion line, the player a sumi line (`Look.ROLE_LINES`).
- The cast: the local player `hero`, each contract target `boss`, guards `enemy` (the contract's named guards, and watchers named Ashigaru, Bodyguard, Sentry, Guard, Patrol, Gatekeeper or Instructor), every other disguise watcher `friendly`, lanterns `asRendered` so they glow warm.
- stealthKit's Director has its `roles` switched off at runtime, since it re-gives every watcher `enemy`.
The HUD is drawn after the style stack and is never inked.
Undo: `require("~styleKit.StyleKit").clear()` and `require("~styleRoles.StyleRoles").clear()` put the frame back exactly as rendered; remove the `Look.tick()` call in `riceAndShine.game` to stop it coming back.
# dress
Draws every player in their disguise on every peer: hides the avatar's own mesh, builds a humanBodyKit body in the role's outfit and livery under it, and poses it from the avatar's motion and the Wearer (carrying, sneaking, working, a drawn sword, a quick change). Also dresses NPCs that carry an Outfit. Bodies are local, so nothing extra crosses the network.
# riceAndShine.stealthHud
The stealth HUD a Rice and Shine player reads to play by hand, in the washi look: the takedown card ("Tap F – knock out · Hold F – kill", the reason when refused, and "Hold F – finish him" over a knocked-out contract target, which it carries out), the spotted strip (who saw you and why, hunting / searching), and the controls line. `RS.tick` (riceAndShine.game) calls `H.tick(dt)` every frame on every peer.
# theme
The five looks (`scifi`, `fantasy`, `cartoon`, `pixel`, `minimal`) and the drawing helpers every widget uses, so one setting reskins all of them.
A theme is a palette plus a few shape rules: corner style, edge weight, drop shadow and font. Widgets never pick colours themselves. They ask the theme for `panel`, `accent`, `text` and so on, and draw with `T.panel`, `T.text`, `T.bar`, `T.ring`, `T.check`, `T.badge` and `T.pixelBox`. Use `T.get(name)` to read a theme and `T.register(name, def, base?)` to add your own, which `Nav.setTheme` then accepts. `T.textWidth` and `T.fit` measure text and shorten it to fit.
assassinationKit.moment: the kill moment, the accident visuals and the kit's sound. Called by the HUD (accident `fx` events, mission events), by the client (direct kills), by the screens (button sounds) and by a scene's entrypoint (ambience and music beds). Everything runs on the peer that calls it; the mission's events already reach every peer, so nothing is sent.
## The kill moment
`Moment.kill({ entity = body, text = "The net gives way...", mine = true })`
- **The killer's screen**: a 0.7 s time slow (`engine.holdTimeScale(0.3)`, released on the wall clock), a camera push (field of view in by 7 degrees and back over 1.6 s), a heavy shake at low intensity, impactFrames' `inkSplash` in sepia ink on parchment (`Moment.INK`, `Moment.PAPER`, `Moment.ACCENT`; never red, never black), sepia ink droplets, wash and paper flecks at the body (juiceKit vfx, look `soInk`), the ink sting, and a title card with the accident's text.
- **Players within 40 m**: a lighter stroke, the ink at the body, a light shake, the sting quieter. No time slow, so nobody else's simulation is touched.
- **Everyone else**: the title card only.
A staged kill's moment waits for its accident to land (the load hitting the pier, the glass breaking, the railing going): `mission.stagedKill` broadcasts an `fx` event of kind `kill` with the text, and the HUD hands it here.
## Accident visuals (`Moment.accident(ev)`)
| kind | what is seen and heard |
|---|---|
| heavyDrop | a cargo net of crates (concealKit's crates under a rope net with slings, a hook and the snapped line) falls from crane height, lands in dust with a rumble; cargo crash sound |
| poison | the glass slips, tumbles and breaks with a glint; glass shatter and the body slumping |
| sabotage | a railing section tips over and drops into the water with a splash; wood crack and splash |
| riggedSwap | a snap and a small ink burst; spring snap |
| impersonate, lure, guardAway, doorOpen | a quiet cue: a faint ink puff and the opening motif |
## Sound
- `Moment.sound(name, { volume?, pitch?, at? })`: one of `Moment.SOUNDS` (inkSting, cargoCrash, glassSlump, railSplash, riggedSnap, openingCue, intelChime, stepDone, oppReveal, exitWhoosh, gradeStamp, uiClick, uiHover, paperRustle). `at` makes it spatial. Each sound has a short gap so a burst of events never stacks it.
- `Moment.uiSound(name)`: screen buttons: `click`, `hover`, `open` / `select` (paper rustle), `stamp` (debrief grade), `leave` (exit whoosh).
- `Moment.hudEvent(name, ev, c, pub)`: intel chime, step tick, opportunity reveal, done tick, and a lighter moment for another player's direct kill nearby.
- Phase cues: the contract ambience loops on the select and briefing screens (ducking the harbour beds), a paper rustle as they open, the grade stamp on the debrief.
- `Moment.beds({ ambience = clip, calm = clip, tense = clip, ambienceVolume?, musicVolume? })`: looping beds; the music cross-fades calm to tense while stealthKit's alert is raised and for 14 s after a kill. `Moment.stopBeds()`, `Moment.bedState()`.
Channels: `sfx`, `ui`, `music`, `ambience`, so `audio.setChannelVolume`, `audio.setMasterVolume` and `audio.setMuted` (a settings screen) reach every sound here.
# ClimbMover
Mantle, wall climb and ledge hang for a character body that walks on the built-in `CharacterController`. Put it on the same entity as the controller: the player body a scene's `PlayerPrototype` names, or an NPC. It needs nothing else; with `Locomotion` on the body too it turns the visible model to face the wall during a move.
```luau
body.component.add("climbKit.ClimbMover", {})
wall.attribute.set("climbable", true) -- walls you want climbable
```
## How it drives the character
It runs just ahead of the controller (`executionOrder = -150`) and reads the controller's input bus (`inputX`, `inputZ`, `inputJump`), so the player's map (keyboard, gamepad, touch) and an AI writing the bus both trigger it.
While a move runs it switches the controller off (`enabled = false`) and writes the body's position itself, so the controller's gravity and wall push-out never fight the pull-up. The local player's body reads its `move` / `jump` controls from the controller's `inputMap` while the controller is off; other bodies read the bus their driver keeps writing. When the move ends the controller is switched back on and handed the exit velocity through its own bus: a one-frame jump whose `jumpForce` is the vertical speed (0 to stand, up for a kick-off) and `inputX` / `inputZ` across. Nothing the controller held before the move (a jump's rise, a fall) carries over. `jumpForce`, `jumpBuffer` and `Locomotion.moveDeadzone` are restored afterwards.
Only the peer that owns the body runs it.
## Triggers
| Situation | Move |
|---|---|
| Grounded, jump pressed, moving toward a top ≤ `reach` above the feet | mantle |
| Grounded, walking into an obstacle ≤ `walkReach` (`autoMantleWhileWalking`) | mantle |
| Airborne, moving toward a top ≤ `reach` (`autoMantleInAir`) | mantle |
| Falling faster than 2.5 m/s past an edge `hangDepth` ± 0.4 m above the feet | hang |
| Pushing into a `climbable` wall (blocked, or airborne, or jump) | climb (mantles instead if the top is in reach) |
| Climbing, head past the top | mantle over |
| Climbing down onto ground | stand |
| Climbing/hanging + jump | kick off (`kickOffSpeed` out, `kickOffUp` up) |
| Climbing/hanging + jump while pulling away, or hanging + back | drop (the edge let go of is not caught again until the body lands or 1.5 s pass) |
| Hanging + forward (once the stick has eased off since the catch) or jump | pull up |
| Hanging + sideways | shimmy |
A mantle needs a top no steeper than `maxTopSlope`, room for the standing capsule on it, and a clear way straight up and then over (an eave overhanging the body blocks it until the body stands clear of the edge).
## Fields
| Field | Default | |
|---|---|---|
| `mantleEnabled` / `climbEnabled` / `hangEnabled` | true | turn each move on or off |
| `reach` | 2.3 | highest top above the feet a jump mantles onto (m) |
| `walkReach` | 1.2 | highest top walking into it steps up onto |
| `autoMantleWhileWalking` | true | walk-up without a jump press |
| `autoMantleInAir` | true | grab ledges in reach while airborne and moving toward them |
| `minLedgeHeight` | 0.45 | lower tops are left to the controller's step |
| `probeDistance` | 0.6 | how far ahead of the body to look for an edge (m) |
| `maxTopSlope` | 42 | steepest top it lands on (deg) |
| `mantleMinTime` / `mantleMaxTime` | 0.35 / 0.6 | mantle duration, scaled by height |
| `climbSpeed` | 1.6 | m/s up, down, sideways on a wall |
| `wallGap` | 0.05 | gap kept off the wall |
| `kickOffSpeed` / `kickOffUp` | 3.5 / 4.0 | jump off a wall or ledge |
| `shimmySpeed` | 1.1 | sideways along a ledge |
| `hangDepth` | 2.0 | feet below the ledge top while hanging |
| `regrabDelay` | 0.4 | seconds before grabbing again after letting go |
| `autoClimbDwell` | 0.3 | seconds of holding forward against a climbable wall from the ground before the climb starts by itself (players and NPCs alike; 0 turns it off) |
## Telemetry (synced, read-only in practice)
`state` (`idle` / `mantling` / `climbing` / `hanging`), `progress` (0..1 through a mantle), `ledgeHeight`, `ledgeSlope`, `wallNormalX` / `wallNormalZ`, `climbX` / `climbY` (climb input, -1..1).
## Events (synced)
`onMantleStart { height, slope, duration }`, `onMantleEnd { height }`, `onClimbStart { normalX, normalZ }`, `onClimbEnd { reason }` (`top`, `ground`, `jump`, `drop`, `lost wall`, `overhang`, `no way up` (pinned with nowhere to go for a second: a dead end, a pocket under an eave; or held going nowhere for 2 s), after which that wall is not climbed again for 3 s; `blocked below` (from 1.1.30) when a stick held down or away takes the feet no more than 5 cm lower in 0.5 s with ground within 2.5 m below: the foot of a wall over a plinth), `onHangStart { height }`, `onHangEnd { reason }` (`ground` when a hang sunk below the floor stands on it, `over lip` when pushing up from a lip climbs over it, `no way up` when held going nowhere for 2 s), `onKickOff { speed }`.
Climbing over a lip or a narrow shelf fires `onMantleStart`, then `onMantleEnd` and `onClimbStart` as the climb goes on up the wall above; climbing over from a climb fires no `onClimbEnd` first, and from a hang `onHangEnd { reason = "over lip" }` comes first. The move goes out from under the lip, up past it, then back in to the wall.
```luau
local climb = entity(bodyId).component.get("ClimbMover")
climb.events.onMantleStart:connect(function(e) playClip("mantle", e.duration) end)
```
## Methods
- `tryMantle(dirX, dirZ, exclude?, opts?) -> boolean`: pull up onto a ledge in that horizontal direction now, if there is one (AI, scripted sequences). `opts` widens the search for one call (see `Ledge.applyMantleOpts`): `minHeight` (-1 to reach; a negative value steps across onto a floor at or a little below the feet, as from a rope or pole top onto a deck), `maxHeight` (0 to reach), `probeDistance` (0.1 to 2 m) and `skipRiseCheck` (skips the room-straight-above check only when the body rises at most 0.3 m, and lets that step duck 0.3 m under something over the head on its way across; the landing must still fit a standing body). A step across fires `onMantleStart` with a height of 0 or less.
- `release()`: let go of whatever move is running and stand.
## Added in 1.1.0
| Field | Default | |
|---|---|---|
| `hangCatchSpeed` | 2.5 | fall speed (m/s) above which an edge dropped past is caught as a hang |
| `cornerShimmy` | true | shimmy round outside and inside corners |
| `cornerTime` | 0.3 | seconds a corner turn takes |
| `ledgeTopY` | (telemetry) | world height of the edge hung from / mantled onto |
| `ledgeEntity` | (telemetry) | entity of the ledge hung from / mantled onto, the lip being climbed over; "" once the controller is handed back |
- Event `onCorner { inside, normalX, normalZ }` (synced).
- `tryHang(dirX, dirZ, exclude?) -> boolean`: catch an edge in that direction as a hang now.
- `tryClimb(dirX, dirZ) -> boolean`: start climbing the climbable wall in that direction now.
- Climbability goes through `ledge.isClimbable`, which reads the `climbable` attribute first (true or false) and then any registered climb rules (`Ledge.addClimbRule`).
- On every peer other than the owner the visible body turns toward the synced wall normal while a move runs.
## 1.1.2: control schemes that drive the bus
While a move runs, the controller is switched off, so ClimbMover reads what drives the body itself. It now reads the controller's input bus (`inputX` / `inputZ` / `inputJump`) first, for every body including the local player's, and falls back to the player's own input map only when nothing is on the bus. A control scheme that drives the character through the bus and turns the controller's own map off (such as controlsKit's `ControlsMover`) now climbs, hangs and shimmies with no extra wiring.
The bus is read the way the controller reads it: units per second, so a full push is the controller's `moveSpeed`. A scheme that writes a slower speed reads as a partial push (pulling up and dropping need more than 0.6 of a full one). A bus that carries only a jump keeps the direction from the player's own map that frame.
## 1.1.4: overhangs and ignore lists
- Climbing up into an overhang (an eave, a balcony) no longer sticks: the body stops at that height and can still shimmy sideways out from under it, climb down or jump off.
- `tryMantle(dirX, dirZ, exclude?)` and `tryHang(dirX, dirZ, exclude?)` take an optional list of entity ids the ledge search ignores: the rope or pole the body is holding, whose own top is not the ledge to pull onto.
# core
The state the kit shares on one peer: settings, the registries of areas, watchers, wardrobes, work spots, wearers and outfits, the event bus, the scene's players, role and rule lookups, and the area test (`areaAt`). Used by every part of disguiseKit; games use `disguiseKit.api` instead.
# riceAndShine
The game layer of **Rice and Shine**, a sengoku-era ninja assassination sandbox built on Sealed Orders (assassinationKit) and the Tsukikage castle town.
- `riceAndShine.game` — `RS.setup()` configures Sealed Orders (letter grades, scroll briefings, notice-board select) and repaints the kill moment in sumi ink on washi paper; `RS.player(at, facing)` builds the shinobi player prototype (body, climbKit rooftop climbing, orbit camera) and its spawn in a scene build.
- `riceAndShine.Game` — the component every level places once; it runs `RS.setup()` on each peer when play starts.
Levels: `scenes/tutorial.scene` (Morning Drill) and `scenes/festival.scene` (Lanterns of Tsukikage). Contracts live in `contracts/`.
# disguiseKit
**Social stealth disguises for any multiplayer Zero world.** Put on the clothes of a social role (a porter, a monk, a cook, a foot soldier) and you can walk where that role belongs without the guards caring, as long as you act the part. Wrong clothes in the wrong place, or acting out of character, and the watchers nearby start to notice you: a little notice sign over each one's head shows how close they are to calling you out. Some people see through a disguise up close: a foreman knows every porter on his crew, a captain knows his soldiers, a head of house knows the staff. Lose yourself in a knot of workers or at a job and the watchers further off stop noticing. Take clothes from a laundry line, a clothes chest, a robe rack or someone you knocked out, with a quick change.
Every player wears their own disguise and is judged by their own machine; everyone sees everyone else's clothes change, a player who joins late included. Keyboard, gamepad and touch.
Version **1.0.44** (`DK.VERSION`). Play it in the **Dockhands** level in this world.
## Quick start
This works as written in a brand-new world.
**1. Install** `disguiseKit.package` into `/source` (search ZeroMind for "disguiseKit" or "add disguises to my stealth game"). Its dependencies (townsfolkKit, humanBodyKit, aiKit, concealKit, interactKit and theirs) come with it.
**2. Add to `scenes/main.scene/build.luau`**, at the very end of `function content()`, just before its `end` (a new world's scene already has the ground, the light and the player):
```lua
local DK = require("disguiseKit.api")
local Hide = require("concealKit.api")
local NK = require("navKit.api")
-- the ground the foreman can chase you on (baked when play starts)
entity.spawn("NavMap").component.add(NK.MAP, { kind = "grid", size = { x = 40, y = 6, z = 40 } })
-- switch the kit on: everyone arrives dressed as a fisher
DK.setup({ startRole = "fisher", signStyle = "inkBrush" })
-- a staff-only store north of the spawn, and a foreman watching its door
DK.area({ 0, 0, 14 }, "staff", { size = { 12, 5, 10 }, label = "The Store" })
local foreman = Hide.guard({ 0, 0, 10 }, { name = "Foreman", yaw = 180 })
DK.watcher(foreman, "foreman")
foreman.component.add("disguiseKit.Outfit", { role = "porter", variant = "rust", prop = "none" })
-- a porter's coat on a laundry line, a sack pile and a place to drop the sack
DK.wardrobe({ 4, 0, 4 }, "laundryLine", "porter", { yaw = 90 })
DK.workSpot({ -4, 0, 4 }, "pickup", { cargo = "sack" })
DK.workSpot({ -2, 0, 14 }, "dropoff")
```
**3. Press play.** You stand in fisher's clothes; the badge top left says *Fisher · Public street · you belong*. Walk into the store: the badge turns *out of place*, and the foreman's ink-brush sign starts to close the longer he watches. Let it close and he calls you out and gives chase. Now walk to the laundry line and **hold E** to change into the porter's coat, **press F** at the sack pile to shoulder a sack, and walk in again: a porter with a sack belongs in a store. Get within 4 m of the foreman, though, and his sign starts closing anyway: he knows his crew, and you are not on it. Change `signStyle` to `"paperLantern"`, `"woodPlaque"`, `"pixel"`, `"minimal"` or `"comic"` and every sign changes.
The `main` scene of this world is that quick start pasted into a new world's scene.
## How it works
| piece | what it is |
|---|---|
| `Disguises` component | one per scene on a plain entity: switches the kit on and holds its settings (`signStyle`, `startRole`, keys, blend range...) |
| `Area` component | ground that says which roles belong: `kind` (public, workyard, staff, guards, innerCourt, forbidden) or `allow` |
| `Watcher` component | someone who notices: `kind` (guard, foreman, captain, headOfHouse, abbot, onlooker) |
| `Wardrobe` component | a laundry line, clothes chest or robe rack with one role's clothes |
| `WorkSpot` component | a job to blend in at (sweep, tend, fish, haggle, drawWater, kneel, pray) or goods to pick up and drop off |
| `Outfit` component | dress an NPC (an aiKit guard) in a role's clothes, the same body a disguised player gets |
| `Wearer` component | spawned for you: what each player wears, synced to everyone |
| `SharedRules` component | spawned by the host: who belongs where and which rules are on, the same for every player |
| `disguiseKit.api` | the one interface: `local DK = require("disguiseKit.api")` |
| two guides | the how-to and a worked example level (below) |
| `disguiseKitTests` test suite | 25 tests: a player judged by watchers, blending in crowds and at work spots, multiplayer clothes and shared rules, the catalogue and the rules (below) |
| `add-disguises-to-a-level` workflow | a guided run that adds disguises to a level step by step (below) |
**Judging.** Each player's own machine judges that player against every Watcher, every frame: can the watcher see them (range, view cone, walls, hidden in a concealKit spot), and if so, what is wrong. Each suspicious behaviour that applies adds its weight to that watcher's meter, faster up close; when nothing is wrong the meter drains after a moment. A full meter calls you out: your cover is blown, aiKit guards nearby are sent after you (`AI.alert`) and their own senses see you again. Nobody can catch you for the first `catchGrace` seconds (1.5) after you are called out, so a foreman who sees through you at arm's length gives you a moment to run (0 makes the catch immediate). Stay out of every watcher's sight for `loseSeconds` (7) or change clothes unseen and your cover comes back.
**Cover.** While your cover holds, the kit hides you from aiKit guards' own senses (`AI.setConcealed`) on every peer, so the disguise, not raw line of sight, decides whether guards care.
## Roles
Ten roles, each in three looks (a fixed livery: hat and cloth colours) so a disguised player can match the crew around them, plus the player's own clothes (`own`). Bodies come from humanBodyKit (1.1.0 added the soldier, retainer, cook and tea servant outfits, fixed liveries and the sword for this kit).
| id | label | looks | normal for the role | carries |
|---|---|---|---|---|
| `farmhand` | Farmhand | straw, ochre, olive | goods | |
| `porter` | Porter | indigo, rust, brown | goods | |
| `soldier` | Foot soldier | black, indigo, red | a drawn blade, running | spear |
| `samurai` | Retainer | charcoal, wine, olive | a drawn blade | |
| `monk` | Monk | saffron, grey, ochre | | |
| `teaServant` | Tea servant | rose, sea, plum | goods | tray |
| `merchant` | Merchant | teal, crimson, saffron | | |
| `entertainer` | Entertainer | magenta, turquoise, scarlet | climbing, running | |
| `cook` | Cook | white, indigo, ochre | goods | |
| `fisher` | Fisher | faded, sand, rust | goods | |
| `own` | Own clothes | travel, dark | | |
`DK.defineRole({ id, label, outfit, variants = { { id, label, hat, colors } }, normal, cargo, prop, townsfolk })` adds your own.
## Areas
| kind | who belongs | priority |
|---|---|---|
| `public` | everyone, own clothes too | 0 |
| `workyard` | farmhand, porter, fisher, cook, soldier, retainer, merchant | 10 |
| `staff` | porter, cook, tea servant, farmhand, soldier, retainer | 20 |
| `guards` | soldier, retainer | 30 |
| `innerCourt` | retainer, tea servant, monk | 40 |
| `forbidden` | nobody | 50 |
Change who belongs with **one setting**, and every player sees the change, late joiners included:
- one area: `DK.setAreaAllow("The Store", "porter, fisher, cook")`, or edit the Area's `allow` field in the inspector during play. Name the area the way the badge shows it (its `label`, here the quick start's "The Store"; in Dockhands, "Salt Warehouse"), by its entity name, or pass its entity; case and extra spaces do not matter, and a label several Areas share changes all of them. `"*"` lets everyone in, `"none"` nobody, `nil` goes back to what the Area says. A name no Area has is an error that lists the areas there are;
- every area of a kind: `DK.tuneArea("staff", { "porter" })`;
- read it back: `DK.areaAllow("The Store")`, `DK.sharedRules()` (whose `areas` are keyed by each Area's entity name).
These go onto the synced `SharedRules` record the host owns; a player who is not the host sends the change to the host. An Area's `allow` set while building the level is part of the scene, the same for everyone. Ground outside every Area counts as `defaultArea` (public).
## Suspicious behaviour
| id | what | weight |
|---|---|---|
| `trespass` | standing where the disguise does not belong | 0.32 |
| `run` | sprinting | 0.42 |
| `climb` | jumping, climbing, dropping | 0.55 |
| `sneak` | moving crouched in plain view (C / pad B / Sneak) | 0.38 |
| `carryBody` | carrying or dragging a knocked-out person (concealKit) | 1.4 |
| `bladeDrawn` | walking with a drawn blade (X / pad Y / Blade) | 0.9 |
| `oddCargo` | hauling goods in clothes that never carry anything | 0.25 |
Switch any rule per role: `DK.setRule("monk", "run", false)` (running monks are fine now), `DK.setRule("*", "climb", false)` for everyone, `nil` to go back to the role's default. `DK.tuneRule("run", { weight = 0.6 })` changes a weight; `DK.configure({ pace = 0.8 })` makes every watcher quicker.
## Watchers
| kind | range / cone | sees through (within) | when the sign fills |
|---|---|---|---|
| `guard` | 16 m / 120° | nobody | calls you out |
| `foreman` | 14 m / 130° | porter, farmhand, fisher (4 m) | calls you out |
| `captain` | 18 m / 120° | soldier, retainer (4 m) | calls you out |
| `headOfHouse` | 13 m / 140° | tea servant, cook, entertainer (4 m) | calls you out |
| `abbot` | 12 m / 140° | monk (4 m) | calls you out |
| `onlooker` | 11 m / 150° | nobody | runs to tell the nearest guard |
Seeing through a disguise only happens inside the recognise distance (4 m): further off, a foreman judges a porter like any guard would, by place and behaviour. A Watcher's own fields override its kind (`range`, `fov`, `recognise`, `knows`). `DK.defineWatcher` adds a kind.
## Blending in
- **A crowd:** walking inside a townsfolkKit `TownGroup` (`TF.isInGroup`), or in among two or more townsfolk of your disguise's trade within 3.2 m, or any three people.
- **Work:** working at a `WorkSpot` whose `roles` include your disguise.
Inside a crowd, watchers farther than `blendRange` (4.5 m) stop noticing you **even in clothes that do not belong there**: a monk in among the porters on a work yard goes unseen by a guard 8 m off. Acting out of character (running, climbing, sneaking, a drawn blade, carrying a body) still gives you away inside a crowd, and stepping out of it starts the meters again. Working at a `WorkSpot` whose `roles` take your disguise hides you the same way (a cook sweeping a yard cooks do not belong in), and a spot for another trade does not. Up close (inside `blendRange`) watchers judge you as usual, and someone who knows your role's faces catches you within 4 m.
## Getting clothes
- **Wardrobe** (`laundryLine`, `clothesChest`, `robeRack`, `coatStand`, `tailorsTable`; each drawn in the colours of the look it holds): hold E (interactKit prompt, pad X, Interact on touch), or hold Act (F, pad RB, the Act button on touch). Act is always on a phone screen, where the engine may fold its Interact button into the "..." menu.
- **A knocked-out person:** stand by a downed townsperson (townsfolkKit) or a knocked-out guard (concealKit) and hold F (pad RB, Act on touch). Their clothes are their townsfolk role, their `Outfit`, or what you set with `DK.setClothes(entity, role, variant)`.
- **From code:** `DK.dress("porter", "indigo")`.
A watcher who sees you change gains 0.6 on their meter; the others forget who they were watching.
## Notice signs
Eight styles, swapped for the whole game by the Disguises component's `signStyle` (or `DK.setSignStyle` on one peer):
| id | look | suits |
|---|---|---|
| `inkBrush` | a brush circle that closes; a red seal with an eye when it does | painted, ink, woodblock |
| `paperLantern` | a lantern filling with amber then red light | painted, realistic, night |
| `woodPlaque` | a hanging wooden tag whose carved eye opens | realistic, painted, low-poly |
| `pixel` | an 8-bit eye over a segmented bar | pixel, retro |
| `minimal` | a thin ring filling around a dot | minimal, sci-fi |
| `comic` | a wobbling burst whose squiggle becomes a stare | toon, comic |
| `hanko` | a square red seal that inks in from the bottom; a stamped eye when it closes | painted, woodblock, ink |
| `radar` | a sweep that widens as they notice you, pulsing red on a call-out | sci-fi, modern, minimal |
Each player sees only the signs about themselves. A sign sits just over its watcher's head and keeps a readable size at any distance (34 to 66 UI points). When signs would overlap (two soldiers side by side at a door), they share one row, side by side in the order their watchers stand across the screen, each with a thin leader line down to its own watcher's head, so no leader crosses another sign. The signs draw on a screen of their own (`disguiseKitSigns`) in the always-on-top UI band, layer 920 by default (the Disguises field `signLayer`): over HUD chrome such as saveKit's XP bar and level-up banner (layer 900), under modal panels (940 and up), and that screen never takes a click. Drawn over the banner is not drawn on it: saveKit (1.3.15 and later) states the banner's rect in `ui.safeArea().controls` while it shows (and 1.3.18 and later its "Saved" flash too), and the signs step clear of it like any other control; when the nearest step clear is taken, a sign tries the spots beside every obstacle and takes the nearest free one. A sign stays close to the person it belongs to: its box never stands further from its watcher's head than 30% of the screen's shorter side (180 UI points at most; 117 on a phone either way up), so it never steps round the HUD to the far edge of a narrow screen. A sign never covers a panel, a control or another sign, at any screen size: a shared row with no free place splits into single signs that each find a place of their own, a sign that still has none drops its name tag and shrinks to the smallest size, and one that finds no place even then is not drawn that frame (the badge and the call-out message still say who saw you). A leader line that would cross a panel or a control is left out. Signs and their name tags stay fully inside the screen (clear of the edges and the top band), and they step out from under the badge, the prompt, toasts, every on-screen control in `ui.safeArea().controls` and any panel a level names with `DK.hudKeepClear`. interactKit's take / hide prompts are kept clear the frame they appear: the kit reads the rects interactKit reports in `lastFrame().rects` (interactKit 1.6.6 and later; an older one is read from what it drew the frame before), and the HUD redraws at once when a prompt appears or goes, a message changes or the cover blows. The badge states its own rect as the control `disguiseKitBadge`, so other screens can keep clear of it. A watcher off the screen's edge has its sign wait at that edge. `DK.hideSigns(owner, true)` hides every sign while a level shows a result screen. Once a watcher is more than curious and within 22 m, a name tag (the Watcher's `label`, else the kind's) shows under the sign.
## Controls
| | keyboard | gamepad | touch |
|---|---|---|---|
| sneak (toggle) | C | B (east) | Sneak button |
| draw / sheathe blade | X | Y (north) | Blade button |
| act: change at a wardrobe, take clothes from a body, work, pick up / drop goods | F (hold to change or take clothes) | RB | Act button |
| change at a wardrobe, hide, carry bodies | E (interactKit / concealKit) | X (west) | Interact |
Keys are Disguises fields (`sneakKey`, `bladeKey`, `actKey`). The kit follows the device class the engine itself presents (the one its own Jump / Interact column follows). On a touch screen it shows Sneak, Blade and Act buttons in a column just left of the engine's bottom-right controls, sized to the screen (52 to 72 points), and the hint line names those buttons instead of keys. The hint line stands at the bottom middle when that is free; otherwise it takes the lowest free row the screen's stated rects leave (the badge, a level's panel, an XP bar, the engine's and the kit's touch controls), wrapping onto two lines when no row is wide enough, and the notice signs keep clear of it. It looks in the bottom half first and higher up only when the bottom half is full.
On a phone held upright (narrower than 600 points and taller than wide) the kit lays out for the space it has, in play and when you are called out:
- the badge stays left of the engine's Menu button and wraps its lines instead of growing under it (which used to push it, and the level's panel under it, down the screen);
- the kit states the player's head and coat (the middle of the picture, where the follow camera keeps the player: about 0.38 to 0.58 of the screen's height and its middle 36%) as a rect in `ui.safeArea().controls`, owner `disguiseKitPlayer`, so saveKit's XP bar (1.3.16 and later) steps up above it and the player's hat and coat stay in view; a level's own HUD can keep clear of it the same way;
- the hint line uses a short form ("Act: work · Sneak · Blade · drag to look"), wraps inside its box and keeps clear of the player, so it sits under the player beside the touch buttons;
- messages (the kit's call-out line and anything a level sends through it) wrap to the screen's width and take the first free place clear of the badge, the panels, the bar, the player and the buttons;
- notice signs draw a little smaller and without name tags, and never over a panel or a button: they stand clear of the player too, and only cover the player when no other place on screen is free.
Every button and panel has its own space and everything stays inside the screen's edges. Landscape phones, tablets and desktops lay out exactly as before. Checked at 844 x 390 and 390 x 844 (phone), 1180 x 820 and 820 x 1180 (tablet) and 1920 x 1080. Act is always there, dim when there is nothing to act on. The kit reads the engine's control rects from `ui.safeArea().controls`, and it states its own column there too (owner `disguiseKitTouch`, via `ui.setControlRegions`), so a level's HUD can keep clear of both. On touch, the act prompt sits in the free band along the top of the screen (right of the badge and objectives, left of the engine's Menu), so it never covers a wardrobe's own interactKit prompt and its "Hold to use" line in the middle of the screen.
The kit's own props (wardrobes and work spots, with everything under them) and the local player's body with whatever it carries (a sack on the shoulder, a tray, a blade) go on the local orbit camera's `cameraIgnore` list, so a washing line, a sack pile or the load you carry no longer pulls the camera into the player's head. A level can add its own see-through colliders (Dockhands adds the island's palm trunks); the kit keeps whatever is already on the list.
## Multiplayer
- Each peer spawns one synced `Wearer` for its own player and is its owner; other peers and late joiners receive it and dress that player's body from it (bodies are local: same outfit, look and seed on every peer). The host removes Wearers of players who left.
- Each player is judged on their own machine, so two players in different disguises are judged by their own clothes and behaviour; meters and signs are per player.
- Cover is a synced field; every peer hides covered players from its aiKit guards, so it is right on whichever peer runs the guards.
- Who belongs where and which rules are on live on one synced `SharedRules` record ("Disguise Rules") that the host spawns and owns. `DK.setAreaAllow`, `DK.tuneArea`, `DK.setRule` and an Area's `allow` edited during play all write it (a player who is not the host sends the change to the host), and every player, late joiners included, judges against it. Checked with two players: opening the warehouse to fishers on the host reached a player who joined afterwards, and closing it from that player reached the host.
- Wardrobes are synced entities (uses are counted by their owner); the Areas, Watchers and work spots themselves are scene content every peer loads from the same scene.
- A player who joins late is kept out of the floor. The engine puts a joining player where another player stands (engine issue #26431), often before the joining machine has built the ground there (a deck, a pier or a yard a scene script or a kit makes as it loads), so the newcomer would drop through it. From the moment this peer's player appears until it has stood on solid ground, clear of everyone, for 3 seconds (at most 60), the kit watches for a body inside another player, or stuck 1 to 4 m under a floor it stood on a moment before, and sets the player down on solid ground beside the others, never through a wall or a rail. A ceiling or a roof over a player set down indoors is never taken for that floor. While the floor is not solid on the newcomer's machine yet, the newcomer is held at the other player's floor height, about a metre in front of them, with gravity off, and is not counted as climbing while held; a newcomer with no ground at all under them yet is held where they appeared until there is. `require("disguiseKit.runtime").arrival.trace` lists its latest decisions; the event `arrivalFixed` fires on each set-down.
## Events (this peer's player)
`DK.on(name, fn)`: `dressed`, `noticing`, `suspicious`, `recognised`, `blown`, `coverRegained`, `caught` (the kit shows "*name* caught you!" on the message line first; a handler that posts its own message replaces it) (a watcher reached you after you were called out), `areaChanged`, `blended`, `unblended`, `workStarted`, `workStopped` (`delivered = true` at a drop-off), `reported`, `changing`. A `blown` event's `reason` is the first thing the watcher saw wrong, as `DK.meters()` words it (`"doesn't belong here"`, `"doesn't know your face"`...), or nil; the toast the player sees is a whole sentence, such as "Foreman Oka sees through your disguise!" or "Door Guard A calls you out: you have a blade out!" (`require("disguiseKit.runtime").shoutText(name, reason)`).
## API reference (`local DK = require("disguiseKit.api")`)
| call | what it does |
|---|---|
| `DK.setup(opts?)` | a Disguises component on a new entity; opts are its fields |
| `DK.area(pos, kind?, opts?)` | an Area (`size` {x,y,z} or {w,h,d}, `radius`, `allow`, `label`, `priority`, `yaw`) |
| `DK.watcher(entity, kind?, opts?)` | make an entity a Watcher |
| `DK.wardrobe(pos, kind?, role, opts?)` | a synced wardrobe with its interactKit prompt (`variant`, `uses`, `yaw`) |
| `DK.workSpot(pos, kind, opts?)` | a WorkSpot (`cargo`, `roles`, `label`, `yaw`) |
| `DK.setClothes(entity, role?, variant?)` | whose clothes a body wears, for taking them |
| `DK.dress(role, variant?)` | dress this peer's player now |
| `DK.status()` | `role, variant, cover, area, areaLabel, belongs, behaviours, blended, inGroup, working, cargo, blade, sneak, heat, watchers` |
| `DK.meters()` | this player's meter on every watcher: `level, state, sees, distance, reasons` |
| `DK.wearers()` | every player's clothes (any peer) |
| `DK.reset()` | clear meters and restore cover (a level restart) |
| `DK.areaAt(pos)`, `DK.belongs(role, pos)` | the ground at a point |
| `DK.setAreaAllow(area, allow)`, `DK.areaAllow(area)` | who belongs in one area, for every player (area = its entity or name) |
| `DK.tuneArea(kind, list?)` | who belongs in every area of a kind, for every player |
| `DK.setRule(role, rule, on?)`, `DK.ruleOn(role, rule)` | switch a suspicious behaviour per role (`"*"` = all), for every player |
| `DK.sharedRules()` | the shared overrides: `{ areas, kinds, rules }` |
| `DK.tuneRule`, `DK.tuneWatcher`, `DK.defineRole`, `DK.defineWatcher` | tune weights and watcher numbers or add roles and watcher kinds, on the calling peer (call them from code every peer runs) |
| `DK.setSignStyle`, `DK.signStyle`, `DK.signSvg(style, level, state?, t?)` (markup, width, height; `t` in seconds plays the sign's motion) | signs |
| `DK.hudKeepClear(owner, rects)`, `DK.hideSigns(owner, hidden?)` | rects (`{ x, y, width, height }` in `ui.screenSize()` points) the signs keep clear of, and hiding the signs while a result screen shows, on this peer |
| `DK.badgeRect() -> { x, y, w, h }?` | where this peer's badge stood on the last frame (nil while hidden), so a level can lay its own panel out under it instead of where the badge would have to step out of its way |
| `DK.configure(opts)`, `DK.settings()` | any setting, on this peer |
| `DK.roles()`, `DK.role(id)`, `DK.areas()`, `DK.rules()`, `DK.watcherKinds()`, `DK.signStyles()` | the catalogue |
| `DK.on(name, fn)`, `DK.eventCounts()` | events |
| `R.beginTrial(entity, wearerFields)`, `R.trialPlace(pos)`, `R.trialFrame(dt)`, `R.endTrial()` (`require("disguiseKit.runtime")`) | run the real judging for a stand-in player in any mode, for tests and tools |
## Guides
- **How to add disguises to my stealth game** (`disguiseKit.package/how-to-add-disguises-to-my-stealth-game`)
- **Build a disguise level like Dockhands from an empty world** (`disguiseKit.package/build-a-disguise-level-like-dockhands-from-an-empty-world`)
Open one with `zero guides read <path>`, the `guides` tool or the Docs panel.
## Tests
`disguiseKitTests` (in the package) holds 26 tests, and the ones that matter most exercise play itself: they run the kit's own per-frame judging (`R.beginTrial` / `R.trialFrame` / `R.endTrial` in `disguiseKit.runtime`) against a stand-in player.
- **Judging**: the right clothes in the right place pass a guard 6 m off; the wrong clothes are seen trespassing, the meter climbs and a full meter blows your cover; a drawn blade is noticed in the right clothes; a player behind the guard or past his range is not seen; a foreman lets his porters pass at 6 m and 4.5 m, sees through them at 3 m, and never sees through a soldier.
- **Blending**: a monk among three townsfolkKit porters goes unnoticed by a guard 8 m off, is noticed once he steps out of the crowd, and is noticed inside it with a drawn blade; a cook working a spot that takes cooks blends on ground cooks do not belong on, a spot for porters only does not hide him.
- **Multiplayer**: another player's synced `Wearer` dresses their body on this peer, the body follows each change of clothes, a peer that starts from nothing (a late joiner) builds the current clothes, and the body goes when the player does; a `SharedRules` record as it arrives from the host decides who belongs, and a change another peer sends is written into it by its owner. A suite runs in one engine, so these check this peer's side of the sync; the two-machine run (a second client joining late, rules changed from both sides) was done by hand.
- **Screen layout**: at a phone held sideways (844 x 390) and upright (390 x 844), a tablet both ways (1180 x 820, 820 x 1180) and a desktop window (1280 x 720), six watchers' signs placed among the badge, the objectives, the message line, the hint line, the XP bar and the touch buttons never cover any of them or each other.
- **Data and rules**: areas named by the label players see (any case) or their entity name, the catalogue (10 roles with two or more looks, 6 area kinds, 7 rules, 6 watcher kinds, 6 sign styles drawing every state), who an Area admits, the shared-rule calls, errors naming what is known, and box, round and overlapping areas.
Run it in edit mode:
```lua
tools.use("tests", "run", { suite = "disguiseKitTests" })
```
## Workflow
`add-disguises-to-a-level` walks a person or an agent through adding disguises to a level they already have, one phase at a time: switch the kit on, mark the areas and who belongs, place watchers (one who sees through a role), wardrobes and work spots, pick a sign style, play to check that the wrong clothes are noticed and the right ones are not, and run the test suite. Start it with `zero workflow start --name add-disguises-to-a-level` (optional args `level`, `theme`, `startRole`, `signStyle`).
## What it costs
Measured in Dockhands on the desktop engine (2026-11-15), with the profiler's per-component script times:
| | per frame |
|---|---|
| the whole kit with Dockhands' 5 watchers (judging, every player's and NPC's body, the HUD) | about 1.9 to 3.8 ms, depending on how much is on screen |
| each extra watcher, all of them looking at the player | about 0.034 ms (20 more watchers: 3.81 ms to 4.51 ms) |
| a body change (a quick change, a new player) | one spike of up to about 80 ms on the frame the new body is built, hidden under the change's bow |
Line-of-sight rays are cached per watcher for 0.15 s, the HUD redraws 30 times a second, and bodies drop detail beyond 25 m and 55 m from the camera. Each frame reads the camera and concealKit's body list once for all bodies, and it checks the avatar mesh a body hides once a second, not every frame. A sign's drawing steps a dozen times a second and with the meter in 1/24 steps, so a sign that has not changed rebuilds the same markup. Most of a Dockhands frame is the engine drawing the island and the ocean, not the kit.
### In a web browser
Played in a real browser tab on a normal machine (2026-11-15, disguiseKit 1.0.9): about **15 frames a second at the pier with the porter crowd** (about 67 ms a frame, with spikes) and about **20 at the beach spawn**. Profiling showed that most of that was not the kit but the island's ocean: tropicalKit made it at the engine's `high` tier, a 276,664-vertex surface sent to the renderer again every frame (about 10 ms of CPU even with nothing moving). Dockhands now makes its ocean at `medium` (9,089 vertices; it looks the same from the pier). In the desktop engine that took a frame at the pier from 58.6 ms to 22.0 ms and at the beach from 51.1 ms to 29.6 ms, measured with other clients sharing the machine.
The browser has **not been re-measured since that change**, so this README does not claim 30 frames a second there. Taking those 10 ms off the measured browser frame gives an estimate of about 50 to 55 ms (18 to 20 frames a second) at the pier, and more if the browser's script costs shrank by the same share as the desktop's. The kit's own share is 1 to 3 ms of the frame. If you build your own level on tropicalKit, pick a lighter ocean for the browser (tropicalKit 1.2.1 has an `oceanQuality` setting for this; its `auto` default already picks `medium` in the browser).
## Built on
townsfolkKit 1.1.0 and humanBodyKit 1.1.0 (Living Lanes), aiKit (guards' senses), concealKit (hiding, knock-outs, bodies), interactKit (prompts). Nothing in them is copied here.
## Version history
- **1.0.44**: touch screens. New setting `touchButtons` (default "sneak,blade,act") picks which of the kit's own touch buttons show; new setting `ownSneak` (default true) set false leaves Sneak to the level's own control, driven with `DK.setSneak(on, slow?)`; the touch buttons and notice signs keep clear of controlsKit's on-screen buttons. Defaults keep the previous behaviour.
- **1.0.43**: no behaviour change. Built on townsfolkKit 1.2.7, which moved its own interactKit from 1.6.3 to 1.6.7. Until then a world installing disguiseKit (or stealthKit, which builds on it) got interactKit at two commits on one path, and the install dropped the files that differ between them (package.yaml, README, api, hud, prompts, gallery scene), so interactKit failed to load. Every kit in the closure now pins interactKit 1.6.7. Also humanBodyKit 1.2.2, concealKit 1.2.9, aiKit 1.3.20, controlsKit 1.4.7 and the current @builtin, so no engine module it places is older than what a world on the current engine holds.
- **1.0.42**: no behaviour change. Built against the current releases: interactKit 1.6.7 (the release this world holds; 1.0.41 recorded an older interactKit commit, so a world that also had concealKit's interactKit got two interactKit copies and a fresh install could land one without package.yaml or api), controlsKit 1.4.7 (1.0.41 pinned a second controlsKit at 1.4.3, and two controlsKit copies in one world fight over the keys), concealKit 1.2.9, aiKit 1.3.20, navKit 1.5.7 (built on the current engine, so no partial engine-module copies) and @builtin 1279747.
- **1.0.41**: `DK.signSvg(style, level, state?, t?)` takes an optional time in seconds that plays the sign's own motion, and returns the drawing's width and height. Three-argument calls draw exactly as before. Asked for by stealthKit, whose notice meters offer every disguiseKit sign as a meter look and animate it.
- **1.0.40**: Dockhands runs concealKit 1.2.7, released from Out of Sight's main line. 1.2.6 fixed guards walking past a body that was woken and knocked out again (a guard now forgets a body once it stands up, so the next knock-out is a new find); 1.2.7 changed documentation only. No disguiseKit changes beyond the version.
- **1.0.39**: Dockhands runs concealKit 1.2.5, released from Out of Sight's main line. Its thick-bush hiding spot uses a new model (`art/shrub.bundle` replaces `art/bush.bundle`; `Media.MODELS.bush` resolves the new one) and its docs are updated; no API change. Dockhands places no thick bush, so nothing in the level looks different. The reuse review names concealKit 1.2.5. The kit's `C.VERSION` says 1.0.39 to match package.yaml; no other change to the kit's own code.
- **1.0.38**: Dockhands runs concealKit 1.2.4, released from Out of Sight's main line. It is documentation only: the camp guide's little game now also ends with CAUGHT when a guard sees you in the open, not only when one drags you out of a hiding spot. The reuse review names concealKit 1.2.4. The kit's `C.VERSION` (in `core.module`, shown as `DK.VERSION`) still said 1.0.33; it now says 1.0.38, so the code, the README and package.yaml agree. No other change to the kit's own code, nor to concealKit's.
- **1.0.37**: Dockhands runs concealKit 1.2.3, released from Out of Sight's main line. It is documentation only: the camp guide lays a grass field under the whole level (a new world's starter ground ends at z = 25) and says to come up to the fallen log from its long side to stash a body. The reuse review names concealKit 1.2.3. No change to the kit's own code, nor to concealKit's.
- **1.0.36**: Dockhands runs concealKit 1.2.2, released from Out of Sight's main line: a new `hideDozer` guard preset (not used here), `Hide.alarms.level(nil)` returns nil instead of erroring, and concealKit's docs now set aiKit's `quietSpeed` to 3 so walking is quiet and running is heard (Dockhands keeps its own setting). The reuse review names concealKit 1.2.2. No change to the kit's own code.
- **1.0.35** (1.0.34 is the same without this entry): Dockhands runs concealKit 1.2.1, released from Out of Sight's main line (it ran 1.1.7 from a side line): every hiding and carrying action on keyboard, gamepad and touch, thrown bodies fly, carried and dragged bodies are held at the shoulder and the hands. The world is on @builtin 33551d3 and the reuse review names concealKit 1.2.1. No change to the kit's own code.
- **1.0.33**: a richer, steadier kit. A notice sign stays close to its own watcher: never further from the head than 30% of the screen's shorter side (180 points at most), so on a phone it no longer steps round the HUD to the far edge; a sign with no free spot within reach shrinks and, failing that, waits a frame. saveKit's "Saved" flash is kept clear like the rest of the HUD (saveKit 1.3.18 states it). Every role has three looks (new: soldier red, monk ochre, tea servant plum, merchant saffron, entertainer scarlet, cook ochre, fisher rust), two new wardrobes (`coatStand`, `tailorsTable`) and two new sign styles (`hanko`, `radar`), all swapping the same way as the others. A catch shows "*name* caught you!" on the message line even in a level that adds nothing for it. Dockhands' door guards face across the doorway, as the guide's do, so stepping into the warehouse is watched. The Dockhands guide is rewritten where its first builder stumbled: which way `yaw` points and how wide a guard sees, the ledger component made and added by its full name in order, telling the player on the message line, and what happens when a friend joins. Dockhands' camera trick that hides small props in the way of the view is its own package now, **viewClear**. Built against interactKit 1.6.7 and saveKit 1.3.18, both released from their own worlds, and the engine library b45137c.
- **1.0.32**: review fixes on top of 1.0.28 to 1.0.31 (pull request #11). The arrival safeguard only lifts a body through a floor it stood on a moment before, so a late joiner set down beside a player indoors is no longer lifted onto the ceiling or the roof of a room 1 to 4 m high; and a newcomer held at deck height is no longer counted as climbing (it was, after 0.3 s of the hold, so the guards could start to notice a player who had only just joined). The Dockhands guide says the door guards' signs close as you step through the doorway into the warehouse (the doorway itself is Dock Yard, where a fisher belongs), and step 7 reads in order again. Checked in Dockhands: one step inside the door a fisher was called out by guards facing across the doorway in 4.6 s and never noticed by guards at yaw 90; the step 7 Ledger posted both of its messages on a real catch and at the desk; two players, the first on the pier deck, as *Known limits* describes. 26/26 tests pass.
- **1.0.31**: a player who joins late never sees the inside of a deck. While the floor where the engine put them is not solid on their machine yet (their copy of the level is still building), the newcomer is held at the other player's floor height, 0.9 m in front of them, with gravity off, and set down on the floor beside them once it is solid; a newcomer with no ground at all under them yet is held where they appeared until there is. 1.0.30 let them sink under the deck until the floor appeared. The spot search no longer counts the newcomer's own body as an obstacle, and `runtime.arrival.trace` notes every 5 s while a hold lasts. Checked with two clients, the first player standing still on the pier: lowest point 1.36 m (the deck), set down 0.9 m beside them at 49 s, settled at 53 s; the first player alone is never moved. 26/26 tests pass.
- **1.0.30**: a player who joins late is kept out of the floor in every level, not only in Dockhands. The engine puts a joining player where another player stands (engine issue #26431), often before the joining machine has built the ground there; in a level built from the Dockhands guide the newcomer sank under the pier and kept falling under it for good. The runtime now watches this peer's player from the moment it appears until it has stood on solid ground, clear of everyone, for 3 seconds (at most 60): a body inside another player, or stuck 1 to 4 m under the floor above it, waits until that floor is solid on this machine and is set down on it beside the others, never through a wall or a rail (`runtime.arrival.trace`, event `arrivalFixed`). Checked with two clients, the first player standing on the pier: set down on the deck 0.9 m beside them 11.4 s after joining, once the joining machine had built the pier. The *Known limits* entry no longer says joining while nobody stands on the spawn point avoids the problem (it does not). 26/26 tests pass.
- **1.0.29**: guide fix only, no behaviour change. The Dockhands guide (step 7) adds the Ledger component by its registered name, `scenes.main.Ledger`: the bare `"Ledger"` ran in play, but `zm push` refused the world because that reference resolves to no asset it holds.
- **1.0.28**: guide fixes only, no behaviour change. In the Dockhands guide (step 5) the two door guards face each other across the doorway (yaw 180 and 0) instead of out of it (yaw 90): a `hideSentry` sweeps about 50 degrees either side of its yaw, so facing out neither sweep reached the doorway and a fisher standing in it was never seen, where the guide says their signs close. Step 7 shows the win and the catch on the kit's message line and hides the signs on a win, instead of a `print` the player never sees.
- **1.0.27**: no behaviour change. The reuse review now rates every installed package, the ones other kits pulled in included, at the version this release runs (saveKit 1.3.17 and interactKit 1.6.6 are this world's copies with their changes sent upstream as open pull requests), and the world moved to the engine library a85225d.
- **1.0.26**: nothing on screen covers anything else during a call-out, the touch buttons included, at every size. A stricter check (every panel, sign, message and button against every other, each frame from the call-out to six seconds after) found what the sign-only check missed, and each is fixed: the message line finds a free row around the badge on every screen (on a phone held sideways it ran over the badge's right edge); signs, the message line and the hint line keep off interactKit's prompts the frame they appear; the HUD redraws at once when a prompt, message or cover changes instead of at its next tick; a level panel laid out under the badge has its whole column kept clear while the badge grows its CALLED OUT line; and the badge only steps aside for things at the very top edge of the screen, so it and the panel under it no longer chase each other down the screen. In Dockhands the level runs after the kit each frame, and its "thrown off the dock" message goes through the kit's message line on every screen (the red box covered the objectives on a tablet). Checked by being called out for real twice at each of 844 x 390, 390 x 844, 1180 x 820, 820 x 1180 and a 1920 x 1080 desktop window: no overlap in any measured frame.
- **1.0.25**: a notice sign never covers anything else on screen, at any size. On a phone held sideways (844 x 390), a call-out by several watchers at once could settle a shared row of signs on the objectives panel or the Sneak / Blade / Act buttons, because only a phone held upright split a crowded row; now every screen does, a sign with no free place left drops its tag and shrinks, and one that still finds none is not drawn rather than drawn over a panel. Leader lines no longer cross panels or controls. The placement is `require("disguiseKit.hud").placeSigns`, and a new test checks it at five screen sizes. The badge carries the widget id `dkBadge`. Checked by being called out for real twice at each of 844 x 390, 390 x 844, 1180 x 820, 820 x 1180 and 1280 x 720: no sign on a panel, a control or another sign in any frame. The late-joiner limit now says what a second player joining beside a player on the pier sees.
- **1.0.24**: a phone held upright, called out by several watchers at once, keeps everything readable: the badge no longer grows under the Menu button and pushes everything down; the hint line wraps inside the screen (it ran off the left edge and under Menu as one long line; a label's wrap is a prop, which the kit's text helper had put in the style, so nothing wrapped); notice signs no longer settle on the level's objectives panel; and the player's hat and coat stay in view, because the kit states the player's place in the picture and saveKit's XP bar steps above it. Notice signs anchor through `ui.fromViewport`, as the engine's screen-coordinates guide says. The hint line and the message line carry widget ids `dkHint` and `dkToast`. In Dockhands: on a phone held upright the level's own red message ("thrown off the dock") goes through the kit's message line instead of sitting on the objectives. Landscape phones, tablets and desktops measure exactly as before.
- **1.0.23**: on a phone held upright nothing overlaps and nothing runs off screen. Built on saveKit 1.3.16 (released from Save Point for this): its XP bar used to run off the right edge and sit on the engine's Jump button and the kit's Act button; it now narrows to the screen and steps up above the touch buttons. The kit's hint line, which only looked in the bottom half of the screen and so vanished once the bar moved up, now looks higher when the bottom half is full and sits just above the bar. Landscape phones, tablets and desktops are unchanged (measured: same positions and sizes).
- **1.0.22**: built against the engine library @builtin 087ed85 (a world on an older one is hidden from players). The reuse review no longer names a library version that goes stale with every engine release. No behaviour change from 1.0.21.
- **1.0.21**: a work spot redraws its mat in edit mode too, so a level that turns `showMark` off (as `DK.workSpot` sets it after the add) no longer keeps the mark in the editor and in the saved scene. The Dockhands guide moves the starter scene's player template onto the beach with its spawn: a new player's body is made where the template stands and moved to the spawn a moment later, so a template left at the origin showed as a grey figure by the pier for the first moments of play. In Dockhands: the same template fix, and the sack pile on the pier is a pallet of the grain sacks the warehouse stacks hold instead of plain blocks on a mat.
- **1.0.20**: built against the engine library @builtin 6683159 (a world on an older one is hidden from players); the reuse review names it. No behaviour change from 1.0.19; tests 25/25 on it.
- **1.0.19**: the key hint line shows on phones and tablets, held either way: on touch it names the Sneak, Blade and Act buttons (it used to be switched off), and on every screen it finds the lowest free row clear of the badge, a level's panel, the XP bar and the touch controls instead of standing at a fixed spot that the touch buttons covered. Desktop is unchanged. A late joiner who lands inside another player is a known engine problem (see *Known limits*); the 1.0.18 note below promised more than Dockhands can do about it.
- **1.0.18**: on a small phone screen (844 x 390) the badge, a level's panel, the level-up banner and the kit's messages all read at once. A HUD piece that finds no free place below whatever is in its way stays where it was asked to stand instead of sliding to the bottom under the XP bar (the badge did, the whole game); the top-centre message steps down out from under a level-up banner; new `DK.badgeRect()` so a level can lay its own panel under the badge. In Dockhands: the phone objectives sit under the badge and no longer step under the banner (which had pushed them off the bottom of the screen); a player who arrives inside another one anywhere is moved apart, never through a rail, and a body that sank a short way under the pier or the deck is lifted back on top (this does not cover every late join: see *Known limits*); and the guards' and the foreman's bodies fade when they pass right in front of the camera, as the townsfolk already did.
- **1.0.17**: notice signs stay clear of saveKit's level-up banner (with saveKit 1.3.15, which states the banner's rect while it shows): a sign whose nearest step was taken now tries the spots beside every obstacle instead of settling on the banner. A watcher who calls you out walks to a spot 1.2 m short of you on his side (so do the guards he alerts), not onto you. In Dockhands: the objectives panel states its rect so the banner narrows beside it and every objective stays readable; the camera sits comfortably inside the warehouse; the sack stacks are real piles of grain sacks; unseen rails keep players on the pier, gangway and yard deck; and a friend who joins late is stood on solid ground. saveKit 1.3.15 and engine library brought up to date.
- **1.0.16**: the how-to guide and the Dockhands guide say in plain words that they cover guards that see through a disguise (the foreman, the captain, the abbot), so a search for that finds them. Engine library brought up to date.
- **1.0.15**: a notice sign pushed far from its watcher (round a toast or a panel) no longer draws a leader line across half the screen: leaders longer than 180 UI points are left out, and the sign keeps its name tag. In Dockhands: the player walks the dunes between the beach and the yard without stalling (the level gives its player's controller a 55 degree slope limit and a 0.45 m step), the island's signpost labels lie flat on their boards, and guards and porters steer round the player (navKit 1.5.1). On keyboard and gamepad the washing line shows one prompt, interactKit's own, instead of two naming different buttons (touch keeps the kit's Act prompt). Also in Dockhands: an unseen fill under the yard deck stops the player sinking through the boards, and the gangway barrel reads as wood at night (concealKit 1.1.5).
- **1.0.14**: the quick start (and the how-to guide's "Put people on watch" step) adds the NavMap the guards walk on. A fresh-world install test found that without it the foreman called you out and then stood still, where the README promised a chase. The world's own `main` scene matches.
- **1.0.13**: the notice signs draw on a screen of their own (`disguiseKitSigns`) at UI layer 920 (new Disguises field `signLayer`), so they always show over HUD chrome such as saveKit's XP bar and level-up banner (layer 900) and under modal panels; that screen takes no clicks. The badge and the key hint line step clear of every rect in `ui.safeArea().controls` and every `DK.hudKeepClear` panel. Sign widgets carry ids `dkSign1`, `dkSign2`, ... so a game can read where they are. Built on saveKit 1.3.14, which now states where its XP bar is. New setting `catchGrace` (1.5 s): nobody catches you in the same instant you are called out. Wardrobe prompts read "Hold to change into ...". On touch, the Act button lets go once an action finishes, so a wardrobe no longer starts by itself after you picked up a sack. In Dockhands: the warehouse crates are sack stacks, and nobody can slip under the yard deck or the gangway any more.
- **1.0.12**: notice signs that would overlap share one row ordered by their watchers' screen position, so a leader line never crosses another sign; rows stay inside the screen (nothing cut off at the top) and keep clear of the badge, prompts, toasts, on-screen controls and any panel a level names. New `DK.hideSigns(owner, hidden)` and `DK.hudKeepClear(owner, rects)` (Dockhands hides the signs on its win screen and keeps them off its objectives). Built on the published tropicalKit 1.2.1 and tropicalProps 1.0.4 (the ocean, hill-edge and pier-side fixes, released from Turquoise Cay), with no local edits to either. In Dockhands: intro and win text wraps inside its panels; the camera keeps the player in view in tight corners and against crates and rocks; the yard rail has an opening where the porters' gangway lands.
- **1.0.11**: built against the engine library @builtin e7497a7 (a world on an older one is hidden from players); the reuse review names it. No behaviour change from 1.0.10.
- **1.0.10**: a watcher's shout reads as a sentence (it said "Foreman Oka sees you doesn't know your face!"); `DK.wearers()` skips a remote player's record that is despawned while it is read instead of failing its caller (a late joiner hit this). The player's own body and whatever they carry no longer pull the camera in; on touch the Act prompt moves to the free band at the top so it never covers interactKit's "Hold to use" (interactKit 1.6.5 gives that line a dark chip). Browser speed written down as measured (see *In a web browser*). 25 tests.
- **1.0.9**: hold Act (F, pad RB, the touch Act button) at a laundry line, clothes chest or robe rack to change, the same quick change as its E prompt, so a phone player never needs the Interact button. Notice signs sit just over the head at a readable size at any distance, stack instead of overlapping, and the ink-brush sign has a dark rim for contrast on sand and sky. Touch buttons stand in their own column sized to the screen and report where they are, and tapping a button's word works as well as its ring. The camera ignores the kit's own props (no more diving into your head at the washing line). Bodies read the camera and concealKit once a frame, and signs redraw only when they change.
- **1.0.8**: an area can be named the way players see it: `DK.setAreaAllow("Salt Warehouse", ...)` and `DK.areaAllow("Salt Warehouse")` take the Area's label (any case, extra spaces ignored) as well as its entity name. A name no Area has is now an error listing the areas there are (setAreaAllow used to accept it and change nothing). README examples checked against what runs.
- **1.0.7**: tests that prove the play itself: a player judged by watchers (passed, noticed, called out, seen through within 4 m), blending in a crowd and at a work spot, and another player's clothes and the shared rules on this peer (23 tests, all passing). Working at a work spot that takes your trade now hides you from watchers further off even on ground your clothes do not belong on, as a crowd does (it used to change nothing). New: `R.beginTrial` / `trialPlace` / `trialFrame` / `endTrial` and `core.applyRuleMessage`. Leftover template comments removed from the scene scripts and the workflow, with no long dashes left.
- **1.0.6**: watchers who see through a disguise (foreman, captain, head of house, abbot) do it only within 4 m (it was 6 to 8 m). A crowd hides you from watchers further than the blend range even in clothes that do not belong there; acting out of character or stepping out of the crowd gives you away. Who belongs where and which rules are on are shared by every player through a synced `SharedRules` record (`DK.setAreaAllow`, `DK.areaAllow`, `DK.sharedRules` are new; `DK.tuneArea`, `DK.setRule` and an Area's `allow` edited in play now reach everyone). Touch is recognised from the engine's own device class, so the Sneak / Blade / Act buttons appear on phones and tablets and the keyboard hints do not. The player's own body (and NPCs dressed by the kit) hide while the camera is inside them; body detail now really follows the camera's distance. Laundry-line posts stand on stone footings. New: the `disguiseKitTests` suite and the `add-disguises-to-a-level` workflow.
- **1.0.5**: the HUD redraws 30 times a second instead of every frame (far less garbage per frame).
- **1.0.4**: sneaking while standing still kneels instead of cowering; the quick change bows in the old clothes and swaps at the bottom of the bow under a puff of dust; gamepad RB (act) works; touch buttons stand beside the engine's own column; the badge says "out of place" once.
- **1.0.3**: holding E at a wardrobe changes clothes in a fresh world (the prompt and the Wardrobe now use the same interactKit).
- **1.0.2**: installs in a fresh world (republished against aiKit 27aa838).
- **1.0.1**: first release on ZeroMind.
## Known limits
Each is an open issue on the tracker of this package's world (*Dockhands: Disguises and Social Stealth Kit*, `bca4ed8d-6b96-46b2-9537-553dfeb7834a`); read one with `zero zeromind viewIssue bca4ed8d-6b96-46b2-9537-553dfeb7834a <number>`.
- **Browser speed below 30 frames a second, as last measured.** A real browser tab ran Dockhands at about 15 frames a second at the pier and 20 at the beach (1.0.9). The main cost, the island's ocean, was fixed for 1.0.10 (see *In a web browser*), but the browser has not been measured again. The `oceanQuality` setting it uses is in tropicalKit 1.2.1, published from Turquoise Cay and installed here. Issue #1.
- **Touch tested with simulated input only.** The whole Dockhands level was played start to win with the engine's input simulator in touch mode, not on a physical phone. Issue #2.
- **Townsfolk bodies are not hidden when the camera passes through them.** The kit hides its own bodies (players, Outfit NPCs); townsfolkKit draws the townsfolk. Issue #3.
- **`DK.tuneRule`, `tuneWatcher`, `defineRole` and `defineWatcher` change only the calling peer.** Call them from code every peer runs (a component's `awake`, `build.luau`). Area and rule switches are shared. Issue #4.
- **Shared area overrides are keyed by the Area entity's name.** Give each Area a unique name without `|`, `=` or line breaks. Issue #5.
- **A script that teleports the player reads as running or climbing for a moment.** Call `DK.reset()` right after moving a player by script. Issue #6.
- **`component.add` drops a list in its init table (an engine bug).** Add the component with `{}` and set list fields after it, as Dockhands does for tropicalKit's `keepClear`. Issue #7.
- **A late joiner is put inside another player (engine issue #26431).** The engine places a joining player inside whoever stands where it puts them: on the beach spawn, or (seen in Dockhands) wherever the first player stands on the pier. Before 1.0.30 the two bodies pushed apart downward and the newcomer sank: tested 2026-11-16 at the beach spawn it once dropped 3.5 m under the sand and once fell through the island, and on the pier it sank through the deck into the water and was thrown about, ending on the deck about nine seconds after joining. With 1.0.32, tested 2026-11-16 in Dockhands with the first player standing still on the pier deck and a second player joining, twice: the newcomer was put inside the first player, and its own machine had not built the pier yet, so the kit held it at deck height about a metre in front of them. What the newcomer sees for that time is both players standing in mid-air over the shallows, their shadows on the sand below and no pier drawn on its screen; nothing is suspicious about it (no climbing, no guard's notice rising). Once its machine had built the pier, 54 s after joining both times, the pier appeared, the newcomer was set down on the deck about 1.5 m beside the first player and stayed there, never once lower than the deck. The first player never sank; in the run where its position was tracked it was nudged about 1 m along the pier. How long the hold lasts is how long the joining machine takes to build the ground. Joining while nobody stands on the pier does not avoid the engine problem: at the beach spawn the newcomer was put inside the first player there too, and the kit moved it 0.9 m aside on its first frame.
- Judging is per player on their own machine, which suits co-op; a competitive game would want the host to judge.
- Two engines signed in to one account are one player (engine issue OrigoZero/zero#14448), so a two-player test needs two accounts.
- The crowd blend reads townsfolkKit's people; a world without townsfolk blends only through work spots.
# navUiKit 1.3.33
Wayfinding and notification HUD for any Zero world: minimaps, a full map screen, compasses, waypoint markers, objective trackers and toasts, and a room map for games made of rooms. There are 30 styles in six looks (sci-fi, fantasy, cartoon, pixel, minimal, gothic), and one setting changes the look. Every player gets exactly one HUD of their own in multiplayer, every style carries tags you can filter by, and every play starts clean.
It suits any game where players need to know where to go and what to do next: open worlds, quests, races, scavenger hunts, co-op objectives, and room-based games such as metroidvanias and dungeon crawlers, top-down or side view. It works on desktop and phones (keyboard, gamepad and touch).
## What's new in 1.3.33
- **The test suite passes in any language.** The compass test looked for the English *No waypoint* in the arrow compass, so it failed when the player had picked Brazilian Portuguese (which draws *Sem destino*). The check now picks English for itself and puts the player's choice back afterwards. No kit code changed.
## An earlier release (the minimal look's titles in Arimo Bold)
- **The minimal look's titles draw in Arimo Bold.** The minimal look named the family `arimobold` for its titles. That name selects the built-in Arimo group, and canvas text takes no weight, so the titles drew in Arimo regular. The minimal look now names `arimo` with `fontWeight = "bold"`, and `T.text` keeps a title in a weighted face beside the canvas commands; `Theme.canvas(id, cmds, w, h)` paints the canvas and draws those titles over it as bold labels at the same place and alignment (`Theme.labels(cmds)` lists them). Every HUD canvas goes through it. The other looks draw as before.
## An earlier release (every look in its own typeface)
- **Every look draws in its own typeface again.** The engine's built-in library no longer ships Anton or Archivo Black, and never shipped EB Garamond, PT Serif or Comic Neue Bold, so the sci-fi titles (Anton), the cartoon titles (Archivo Black), the cartoon body text (Comic Neue Bold), and the fantasy and gothic titles and body text (EB Garamond, PT Serif) all drew in the default face. The package now carries those five faces itself (`Anton.font`, `ArchivoBlack.font`, `ComicNeueBold.font`, `EBGaramond.font`, `PTSerif.font`, from the public world Optional Fonts), so every world that installs navUiKit gets them. The minimal look's bold titles (`arimobold`) wait on the engine's own Arimo Bold, which is going back into the built-in library. No kit code changed.
## An earlier release (the gallery finds its own words)
- **The map gallery finds navUiKit's own words in every game.** The gallery module recorded its `~.words` against a copy of the words module that one game (Crossroads Tales) held, so an install also placed that single file beside navUiKit, and where navUiKit sits under `deps/` the gallery (NavGallery, PointOfInterest) failed with `~.words not found`. Its reference now points at navUiKit's own words module and an install places nothing extra. Nothing else changed.
## An earlier release (pin the objectives panel)
- **A game can pin the objectives panel where its own HUD keeps room for it.** The panel always went to the top corner away from the minimap, so in a game with a HUD of its own up there (a farm's date and coins card, its tool bar) it sat on top of it on a phone, upright and sideways (found in Bramblewick at 390x844 and 844x390). `Nav.configure({ objectives = { at = { x, y, w, h } } })` now draws it exactly there, in screen points, with `h` capping its height (the lowest rows drop first); `at = false` hands placement back to the kit. farmLifeKit uses it to put the quest tracker in a slot its layout keeps free. Nothing else changed.
## An earlier release (every on-screen button, whoever draws it)
- **The minimap keeps clear of every on-screen button, whoever draws it.** It slid off the engine's Menu button and controlsKit's buttons only, so on a sideways phone it sat on a pause button a menu kit draws in the top right, and its Map hint sat on a game's own skill buttons (found in The Undercroft at 844x390). The minimap, the compass bar and the toasts now also read `ui.safeArea().controls`, where the engine lists its own controls and every rect a world states with `ui.setControlRegions(screen, rects)`, and slide clear of those too. Nothing else changed.
## An earlier release (controlsKit buttons in screen points)
- **The minimap keeps clear of controlsKit's touch buttons on every screen.** The minimap and the toasts slide off on-screen touch buttons, but read controlsKit's buttons from the engine's touch layout, which lists them where the engine would place a tap (points times the pixel ratio), not in screen points. Wherever the pixel ratio is not 1 the minimap slid onto controlsKit's Bag button (found in The Undercroft at 1280x720 on touch). controlsKit's buttons are now read from `controlsKit.touchButtons()`, in screen points; the engine's own buttons (the Menu button) are read from its layout as before. Nothing else changed.
## An earlier release (one controlsKit, the current release)
- **One controlsKit, the current release.** The button prompts and toasts named an old controlsKit release, so a world installing navUiKit beside a current controlsKit (sideScrollerKit, for one) landed the old one or ran two controlsKit copies and drew two sets of touch buttons. They now name the current controlsKit (see Version history). Nothing else changed.
## An earlier release (installs into other worlds load again)
- **Installs into other worlds load again.** The `words` module and the locale and glossary files kept the identities of the world that first published them, so an install placed them outside the package, under that world's folder, and every `require("~.words")` failed: the minimap, the map screen and the room grid did not load (found in Starwright). They now belong to this package. Nothing else changed.
## An earlier release (HUD screens are sent only when they change)
- **Every HUD screen is sent only when it would look different.** The waypoint markers and the ring compass were sent to the engine every frame, even when nothing on them had moved; now each screen keeps the last tree it sent and a tree that would look the same is not sent again, so the engine does not lay the screen out again for nothing. Nothing changes on screen: a marker that moves, turns or pulses is still sent that frame.
- **A switch to compare.** `Nav.legacyPerf(true)` sends the compass, the ring compass and the waypoint markers every frame again (the drawing path from before the compass learned to redraw only on change); `Nav.legacyPerf(false)` (the default) is the new path. `Hud.stats` counts screens sent and skipped.
- **Measured in Crossroads Tales** (the harvest fair at 19:30 with the bell's story beat, the journal and notes on screen; same session, the switch flipped four times, NavHud's own update timed around each call over 4 s windows on the native desktop editor): legacy mean 0.66 / 0.54 / 0.94 / 0.56 ms (medians 0.48 to 0.53 ms) against new 0.32 / 0.30 / 0.30 / 0.26 ms (medians 0.23 to 0.25 ms), about half; screens sent in 4 s fell from 117 to 206 to 4 to 13.
## The release before (the fog minimap and the compass redraw only on change)
- **The fog minimap costs a fraction of what it did.** A gothic `fog` minimap and `fog` map on an 80 m level with three marks (found in The Undercroft, where the HUD took 4.2 ms and allocated about 785 KB a frame in a web browser) now draws the same picture for far less. Measured on the native desktop editor, one HUD walking at 5 m/s: `hud:update` from 1.66 ms and 528 KB a frame to 0.38 ms and 66 KB; standing still from 2.1 ms and 473 KB to a median 0.20 ms and 18 KB. The minimap's own share went from about 0.6 ms and 477 KB a frame to about 0.07 ms and 20 KB walking, and to almost nothing standing still.
- **How.** The minimap is now two layers. The picture (background, level, fog, frame, north badge, the Map hint) is redrawn only when the player has moved a point on the map, a fog cell opens, the map is rebaked or the look changes; the frame and the hint keep their commands between redraws. The markers and the player's arrow sit in a light layer over it, redrawn only when they move, turn or pulse. The fog is drawn by its own cells (one rect per run of dark cells, clipped only where a run crosses the rim) instead of a clipped polygon per screen sample, and `Geom.clipCircle` no longer makes a closure and a table for every edge of the circle. The compass redraws only when it turns a tenth of a degree, the player or a place moves 5 cm, or (30 times a second) while a waypoint pulses.
- **Same look.** Variants that animate (the radar sweep, the room grid, the sci-fi ring's spin) still redraw on their clock. A new test, `speed: fog minimap redraws only on change`, checks that standing still redraws nothing, walking redraws the picture on at most half the frames, the fog covers what is unexplored and clears what is not, and prints the timing as a benchmark.
- `Minimap.buildBase`, `Minimap.buildMarks` and `Minimap.buildFrame` draw the parts separately; `Minimap.build` still draws them all at once.
## Two releases before (the suite passes again)
- **The suite passes again.** Its styles test expected six objective trackers in the release before, but the kit has four (list, line, checklist, questCard), so the suite failed in this world and in every game that installed it. The count is back to four, and the test now also checks every family's count against the style tables in this README, so the two cannot drift apart again. No kit code changed.
## Three releases before (no overlaps on a phone)
- **On a phone the compass, the minimap and the objectives never cover one another.** After the minimap slid clear of the touch Menu button, its bezel could land over the compass bar and the objectives panel: at 390x844 the bar (8..382) and the map (230..394 as drawn) overlapped by 10 points and the objectives ran 12 points under the map, and at 844x390 the bar ran under the map and the map's bezel spilled 4 points past the right edge. A last layout pass on small screens now compares the boxes as they are drawn (the map's 12 point bezel and the panel's 8 point padding included): it keeps the map on screen, trims the bar on the map's side while it is still at least 200 points wide (else it drops the map below the bar), and narrows the objectives beside the map (else it drops them below it). Measured after the change: no overlap at 1280x720, 390x844 or 844x390 (found in Crossroads Tales).
## Four releases before (every word in the player's language)
- **Every word the kit draws reads in the player's language.** The minimap's *Map* / *Tap for map* hint, the map screen (title, *Close*, *Legend*, rooms and explored counts, the scale bar), the tracker headings (*Checklist*, *Objectives*, *Your quest*, *Group quest*), the compass letters (N, E, S, W and the points between), *Waypoint* and *No waypoint*, distances (`1.4 km` reads `1,4 km` in Portuguese), the toasts' *Achievement unlocked* and *Press* / *Tap*, the room legend, the *Waypoint set* toast and the whole gallery come from the catalog namespace `navuikit`. English and Brazilian Portuguese ship in the package (`locales/en/navuikit.json`, `locales/pt-BR/navuikit.json`, with review records and a glossary); a world rewords or adds a language by stating the same keys in its own `locales/<tag>/navuikit.json`. Words are read each time they are drawn, so switching language in play changes the next frame. Before, a Brazilian Portuguese player saw *Checklist* and *Map* in English (found in Crossroads Tales).
- **The minimap keeps clear of the engine's Menu button as drawn.** On a touch screen the minimap slid clear of the Menu button's circle by its slot, but its bezel and N badge paint 12 points past the slot and still touched the button at 1280x720, 844x390 and with the ring compass upright. The bezel now counts. And on a short landscape phone (640x360, 740x360) the resting stick's reach no longer counts as a button in the top band: it pushed the compass bar to the bottom of the screen and the minimap off it.
- `navUiKit.words` (`Words.t`, `Words.dir`, `Words.distance`) is the one place the kit's words are read.
## The last release
- **Built against the controlsKit and menusKit releases made without the engine's old deprecated UI library.** The engine deleted that library, and the controlsKit release this kit draws its button glyphs with now runs without it (so does menusKit, which the example guide uses). A fresh install of navUiKit now brings that controlsKit instead of the older one that still required it. Nothing else changed.
## From the last release
- **The compass bar makes room for touch buttons in the top band.** On a phone held upright the engine's Menu button (and a game's corner Pause button) sat on the compass bar. While touch controls show, the bar now narrows between any buttons in its band, and drops below them when that would leave it under 240 points wide; the objective list and messages follow it down. And the objective list is redrawn when its spot moves, not only when an objective changes: it used to stay where it was first drawn, on top of a compass that had moved. Checked in stealthKit's Two Lanterns at 390x844, 844x390, 1024x768 and 1280x720 with touch controls: compass, objectives and buttons clear of each other.
## Earlier changes
- **Touch messages stay out of the middle of the view.** On a touch screen the message stack now takes a side column (left or right) whenever one holds as many cards as the centre would; the centre is used only when the sides are full. In Skyhook a stack of four went down the middle of the screen over the player. A test checks it with Skyhook's arrangement (a panel top-left, buttons down the right).
- `Nav.configure({ toasts = { top = 150 } })` keeps top-anchored messages below a HUD of your own, such as a match timer.
## Earlier: top-HUD setting
- **Keep messages below your own top HUD.** `Nav.configure({ toasts = { top = 150 } })` sets the highest a top-anchored message may sit (points from the top of the HUD). A game that draws its own top-centre HUD the kit cannot see, such as a match timer, sets it once and messages that stack from the top (on a touch screen, a narrow screen, or the banner) start below it. Found in Skyhook, where a message covered MatchFlow's race timer on a touch screen. A test checks it.
## Also recent: toasts keep clear of touch controls
- **Toasts keep clear of on-screen touch controls.** On a touch screen the lower corners belong to the thumbs (the stick bottom-left, controlsKit's button diamond bottom-right) and the engine's Menu button sits top-right, but at tablet and desktop sizes (1280x720 and up) `slide` cards still stacked up from the bottom right, right under the thumb buttons, and the `minimal` pill sat at the bottom centre. While touch controls are showing (the engine draws its touch layout, the surface is `touch`, or controlsKit draws its own buttons), every toast now keeps clear of every control: `slide` and `pixel` cards stack from the top, below the compass and any banner, in whichever column (right, left or centre) has room clear of the buttons, the Menu button, the minimap and the objectives; `minimal` and `prompt` lift above the lowest control; a `banner` or `achievement` drops below a control in its band. The controls are read from `zinput.touchControls.layout()` (controlsKit's buttons included) and the corner a stick rests in; `Toasts.touchControls()` returns them. Waypoint pins avoid the moved stack. Keyboard and gamepad layouts are unchanged. A test checks it with a stubbed touch layout.
- The kit's own version test and reference table now name the current version (the first release of the touch fix shipped them naming the release before it).
## From the last release
- **Built against the controlsKit release menusKit, saveKit and inventoryKit ship with today**, so a world that installs navUiKit beside them (questKit, economyKit, arpgKit) holds one controlsKit. Nothing else changed.
## From the release before it
- **Waypoint markers never take a tap.** The marker layer covers the whole view so a pin can sit anywhere on screen, but it was wrapped in a plain `panel`, which takes every tap that lands on it, painted or not. While any waypoint was set, every click and touch over the game (a settings panel, a phone button, a tap on the world) landed on the empty marker layer instead. The layer is now a pass-through canvas (`pointerEvents = "none"`, the same path the toast layer uses), so taps reach whatever is under it. Markers look exactly as before. A test checks hit testing across the view with a waypoint set, full-screen and boxed.
## From earlier releases
- **Built against the controlsKit release economyKit and towerDefenseKit ship with**, so a world that installs navUiKit beside them holds one controlsKit instead of a second, older copy. Nothing else changed.
## From earlier releases
- **Messages never take a tap, in any HUD.** The toast layer covers the whole HUD area but is painted only where a card is, so it must let every tap through to the game under it. The previous release did that for a full-screen HUD (the layer is one canvas with `pointerEvents = "none"`) but kept a positioning frame that took taps for a HUD drawn into a box (`Hud.new{ box = ... }`), saying a canvas was the only widget that lets taps pass. That was wrong: as the UI guide says, the engine reads `pointerEvents = "none"` on a canvas and on the layout containers (`vertical`, `horizontal`, `grid`, `spacer`); only a plain `panel` takes every tap that lands on it. The boxed HUD's frame is now built from `vertical` containers with `pointerEvents = "none"`, so messages let taps through in both layouts. Messages look exactly as before.
From the last feature release:
- **A room map.** Declare rooms on a grid with `Nav.addRoom` (their cells, the world rectangle each covers, their doors and icons) and pick the `roomGrid` minimap and map screen. Rooms appear once a player has visited them; the room they are in is lit and their position pulses in it; every door is a gap in the outline, and a door they have not tried yet carries a pulsing arrow; icons such as a home (save room), a skull (boss) or a star sit in the room. The map screen names the rooms, counts how many the player has seen and builds its legend from the icons on the map.
- **Each player's own map, fed from your game.** The HUD marks the room a player walks into as visited (`rooms.autoVisit`), or a game that saves its own record turns that off and hands it over with `Nav.setVisitedRooms`, `Nav.useDoor` / `Nav.setUsedDoors` and `Nav.setRoomIcons` (a boss room's skull becomes a check for the player who won). Calls for a player on another peer travel there, like waypoints do.
- **Side view for 2D games.** `Nav.configure{ plane = "xy" }` draws every map with world up as up on the map (x across, y up) instead of top-down (x, z). The baked level picture, fog, distances and the room map all follow it.
- **A sixth look, `gothic`**: dark stone plates, silver borders, crimson spikes and serif capitals. Each look now also carries room-map colours (`roomFill`, `roomHere`, `roomEdge`, `roomNew`, `roomText`, `roomIcons`), and a theme registered without them falls back to its map colours.
- **`map.input = false`** lets a game open and close the map with its own controls (`Nav.toggleMap`) while the hint still shows `map.key`; Escape still closes it.
- Nothing that worked before changes: the defaults, every existing style and every existing call behave as they did in the last release.
## Install and use
Install the package from ZeroMind (search "navUiKit" or use the **Wayfinder Studio** world). It brings the two `controlsKit` modules it draws button glyphs with. Then paste the example below into your scene's `entrypoint.luau` (in a new world, `scenes/main.scene/entrypoint.luau`) and press Play.
```lua
local Nav = require("navUiKit.nav")
function onLoad()
Nav.start() -- round minimap, compass bar, objectives, toasts
-- mark anything: an entity, an entity id, or a point { x, y, z }
local chest = entity.find("Chest") or { 8, 0, -12 }
Nav.mark(chest, { icon = "chest", color = "#FFB300", label = "Treasure", waypoint = true })
Nav.objective("find", "Find the treasure")
Nav.toast("Follow the beam", { title = "Quest started", icon = "quest" })
end
function onUnload()
Nav.stop()
end
```
That gives a round minimap at the top right, a compass bar, an objective list and a waypoint on the treasure (an entity called "Chest" if your scene has one, otherwise a spot 14 m from where you spawn): an icon over it, an edge arrow when it is off-screen, the distance in metres, a light beam and ground rings. Toasts slide in and fade. Press **M** (or Select, or tap the minimap) to open the map. `onLoad` runs when play starts, so nothing appears while you author.
**Every play starts clean.** Each time you press Play (and each time you stop), the kit forgets what the last session declared: markers, waypoints, objectives and their progress, map areas and shapes, explored fog, queued toasts and `Nav.on` listeners. Your `onLoad` then declares them again. So the example gives the same result on every play: one Treasure, one fresh objective, one toast. Settings (`Nav.setTheme`, `Nav.setVariant`, `Nav.configure`) are configuration and stay. Declare your game's markers and objectives in `onLoad` (or with PointOfInterest components), not once from the console.
Prefer no code? Add the **NavHud** component to any entity, and the **PointOfInterest** component to anything you want on the map (tick `waypoint` to guide players to it). Change a NavHud's fields at any time, also while the HUD is showing: the HUD restyles at once. Doing both is fine: a scene's NavHud, `Nav.start()` (once or many times) and extra NavHud copies all share one HUD per player.
Change the whole look with one line. Nothing else in your code changes:
```lua
Nav.setTheme("fantasy") -- scifi, fantasy, cartoon, pixel, minimal
Nav.setVariant("compass", "arrow") -- or Nav.use("compass.arrow")
```
## Guides
Two guides ship inside the package (`navUiKit.package/guides/`). Once navUiKit is installed, the engine's guide search finds them and they open in the Docs panel.
- **How to add a minimap and compass to my game**: what the kit is and what to do first, the four compasses and when to pick each, the minimaps and the map screen, marking places and turning them into waypoints, shared and personal objectives, toasts and button prompts, changing a style or the whole look with one setting and finding styles by their tags, and who sees what in multiplayer.
- **Show a waypoint to the next objective: build a small exploration game**: a step-by-step example from an empty world to a game two players can play together. Places to discover, a compass and a minimap, a waypoint that moves on to the next place when you reach it, a toast when you pick up a relic (pickupsKit), a title screen and pause menu (menusKit) and nameplates over the other explorers (markersKit), all installed from ZeroMind.
## Styles
Every style works in every look. `Nav.catalogue()` returns these rows as data, `{ id, family, variant, description, tags, themes, apply }`, for a world or an agent to pick from, and `Nav.use(id)` applies a row. Filter by tag or family with `Nav.catalogue({ tags = { "round", "phone-friendly" } })` or `Nav.catalogue({ family = "compass" })`; a row matches when it carries every tag you ask for.
| id | what it is | tags |
|---|---|---|
| `minimap.square` | Square north-up minimap with the area plan, POIs and the player arrow. | square, north-up, map-plan, classic, phone-friendly |
| `minimap.round` | Round north-up minimap; the default. | round, north-up, map-plan, classic, phone-friendly, default |
| `minimap.headingUp` | Round minimap that turns with the camera so forward is always up; the N badge orbits the rim. | round, heading-up, map-plan, open-world, driving |
| `minimap.fog` | Round minimap whose plan is hidden until the player has been near it (per-player fog of war). | round, north-up, fog-of-war, exploration, per-player |
| `minimap.radar` | Icon-only radar: no map picture, range rings and a rotating sweep that lights blips as it passes. | round, heading-up, radar, sci-fi, icons-only, animated, combat |
| `minimap.pixel` | Low-resolution pixel minimap sampled from a 1 m grid of the world, chunky icons. | square, north-up, retro, low-res, map-plan |
| `map.rooms` | Full map screen with every area outlined and named, a legend, scale bar and north arrow. | full-screen, north-up, areas, labelled, indoor, default |
| `map.fog` | Full map screen hidden under fog that clears where this player has explored; shows % explored. | full-screen, fog-of-war, exploration, per-player |
| `map.satellite` | Full map screen showing the real world from straight above (an orthographic camera) with markers on top. | full-screen, realistic, top-down, open-world |
| `minimap.roomGrid` | Square room map centred on the player: the rooms they have visited (Nav.addRoom), the one they are in lit, doors, room icons and arrows on untried doors. | square, rooms, grid, doors, exploration, per-player, side-view, metroidvania, dungeon, phone-friendly |
| `map.roomGrid` | Full map screen of the visited rooms on a grid, named, with doors, room icons, untried-door arrows, rooms seen and a legend. Side view (plane xy) or top-down. | full-screen, rooms, grid, doors, exploration, per-player, side-view, labelled, metroidvania, dungeon |
| `compass.bar` | Compass strip across the top: N/E/S/W, degree ticks, tracked POIs with distances. Its frame follows the theme (sci-fi tape, ornate fantasy scroll, minimal line, cartoon pill, pixel tape). | strip, heading, bearings, distance, open-world, phone-friendly, default |
| `compass.dial` | Round compass dial at the top centre, card turning with the camera, POI pips on the rim. | round, heading, bearings, classic, nautical |
| `compass.ring` | Compass bezel round the minimap's own edge (round or square): N/E/S/W and degree ticks, a notch that swings to your heading (or a ring that turns with a heading-up map), tracked places on the rim. Frees the top of the screen. | ring, round, square, heading, bearings, minimap, compact, phone-friendly |
| `compass.arrow` | No cardinal points at all: one arrow at the top that turns to point straight at the nearest waypoint, with its name, distance and an up/down cue when it is above or below you. | arrow, single-target, waypoint, distance, height, minimal, compact, phone-friendly, kid-friendly |
| `objectives.list` | Objective list with progress bars, shared and personal sections. | list, progress, shared, personal, default |
| `objectives.line` | One-line tracker under the compass showing the current objective and its count. | strip, compact, minimal, phone-friendly |
| `objectives.checklist` | Checklist whose boxes tick and strike through as objectives complete. | list, checkbox, progress, cozy |
| `objectives.questCard` | Quest card: title, the steps, a big 3/5 progress counter and bar. | card, quest, progress, rpg |
| `toasts.slide` | Cards sliding in from the right edge, stacking upward, fading out on their own. | card, stack, notification, animated, default |
| `toasts.banner` | Wide banner across the top centre, one at a time, the rest wait in a queue. | banner, wide, announcement, one-at-a-time |
| `toasts.pixel` | Pixel-font toast box with a stepped slide, in any theme. | card, retro, typewriter, notification |
| `toasts.achievement` | Achievement pop: large icon medallion, title and text, a shine sweep, one at a time. | medal, reward, animated, one-at-a-time |
| `toasts.minimal` | Small text-only pill near the bottom centre. | pill, minimal, subtle, phone-friendly |
| `toasts.prompt` | Button prompt ("[E] Open") using controlsKit glyphs for the player's device; stays until dismissed or it times out. | prompt, button-glyph, keyboard, gamepad, touch, phone-friendly |
| `waypoint.icon` | Icon floating over the target on screen. | icon, on-screen, waypoint |
| `waypoint.edgeArrow` | Arrow pinned to the screen edge that glides round it when the target is off-screen or behind. | arrow, on-screen, off-screen, waypoint |
| `waypoint.distance` | Distance label in metres beside the icon or arrow. | label, distance, waypoint |
| `waypoint.beam` | A beam of light rising from the target in the world. | in-world, 3d, light, waypoint, visible-from-afar |
| `waypoint.ring` | Pulsing rings on the ground around the target. | in-world, 3d, ground, waypoint, animated |
The looks are rows too (family `theme`, applied with `Nav.use("theme.pixel")` or `Nav.setTheme("pixel")`):
| id | look | tags |
|---|---|---|
| `theme.scifi` | Sci-fi: dark glass panels, cyan neon edges, condensed display type. | look, sci-fi, neon, dark, futuristic, default |
| `theme.fantasy` | Fantasy: leather and brass, serif type, diamond ornaments. | look, fantasy, medieval, ornate, rpg |
| `theme.cartoon` | Cartoon: white cards, thick black outlines, drop shadows, bold rounded type. | look, cartoon, bright, playful, kid-friendly, chunky |
| `theme.pixel` | Pixel: chunky pixel boxes and a built-in 3x5 bitmap font, stepped motion. | look, retro, pixel-art, 8-bit, chunky |
| `theme.minimal` | Minimal: soft translucent panels, hairlines, plain sans-serif type. | look, minimal, clean, subtle, realistic |
| `theme.gothic` | Gothic: dark stone plates, silver borders, crimson spikes, serif capitals. | look, gothic, dark, ornate, horror, castle |
The waypoint parts are switches that combine (`Nav.configure{ waypoint = { beam = false } }`); the other families pick one variant each.
**Tag vocabulary.** Shape: round, square, strip, ring, arrow, card, list, pill, banner, medal, icon, label, full-screen, in-world. Behaviour: north-up, heading-up, fog-of-war, radar, exploration, single-target, waypoint, notification, prompt, progress, one-at-a-time. Look: sci-fi, fantasy, cartoon, retro, minimal, realistic, animated. Fit: phone-friendly, compact, kid-friendly, default.
**The four compasses.** `bar` is a heading strip across the top. `dial` is a compass rose whose card turns with the camera. `ring` puts the compass on the minimap's own edge: round or square to match it, N/E/S/W and degree ticks on the band, a notch that swings round to your heading (on a heading-up or radar minimap the ring turns instead and the notch stays on top), tracked places as pips on the rim and the nearest waypoint's distance just inside. It frees the top of the screen. `arrow` has no cardinal points at all: one arrow that turns to point straight at the nearest waypoint, with its name, distance, how many others there are, an up or down cue when it is more than 3 m above or below you, and a tick when you arrive. With no waypoint it points north and says so.
Icons for POIs and toasts (`Nav.icons()`): pin, star, flag, skull, chest, door, gem, home, quest, exclaim, coin, key, sword, heart, player, ally, enemy, beacon, tent, eye, trophy, check, shop, portal.
## Multiplayer
The kit runs on every peer. Each peer draws one HUD for its own player, centred on their character and measured from where they stand. Nobody sees another player's minimap, fog, map, arrows, waypoints or personal objectives. Shared objectives stay shared.
- **One HUD per player.** However the HUD is started (a NavHud in the scene, on the player prototype, `Nav.start()`, any mix, any number of times), each peer has exactly one HUD for its player. The first holder draws it and the others stand by. It goes when the last holder goes, or with `Nav.stop()`.
- **Players are sessions.** A player key is `"<userId>#<peerId>"` while connected (`"<userId>"` offline). The relay gives every connection its own peer id, so two machines signed in to the same account are two players to the kit. `require("navUiKit.core").localKey()` is this peer's key. A player object or avatar entity is accepted wherever a key is, and names that one session.
- **Addressing.** A full key, a player object or a body reaches one session. A bare `userId` reaches every session of that account. `"all"` reaches everyone.
- **POIs** are marked on every peer by the same script (or by the PointOfInterest component). Pass `player` to `Nav.mark` or `Nav.setWaypoint` for one player only.
- **Objectives** are shared by default: progress and completion are relayed to every peer. Pass `player = ...` for a personal one. Every peer can declare the same objectives in its own `onLoad`: declaring an id that already exists keeps its progress (pass `count` to set it on purpose), so a second player joining never resets the group's progress.
- **Late joiners catch up.** When a peer's HUD starts it calls `Nav.sync()`, and the peers already playing answer with the shared objectives as they stand. Ones finished before the joiner arrived don't toast again.
- **Toasts** go to the local player by default. `to = "all"` sends one to everyone, and `to = player` sends one to a single player. A toast for someone on another peer is relayed to their peer and shown only there. When every peer runs the same script (a trigger that fires everywhere), the target would get the toast twice, from its own call and from the relay. The same toast arriving both ways within 2.5 s shows once.
- **Per-player state for someone else** is relayed too: `Nav.setWaypoint(id, on, player)`, `Nav.clearWaypoints(player)` and a personal objective's progress reach that player's peer, and each peer applies only what is addressed to its own player.
- Waypoint beams and rings are local, temporary parts each peer draws for its own player. They never replicate and never land in a saved scene. Neither does the `Nav.start()` host entity.
- Messages travel on the `navUiKit` multiplayer channel. To use your own transport, set `require("navUiKit.core").relay = { send = function(kind, payload) ... end }` and call `Nav._receive(kind, payload)` where it arrives.
## Phones and performance
- Widgets lay out inside the safe area (notches, rounded corners) and reflow in portrait and landscape. Under 560 pt of width the minimap shrinks, the compass narrows, the objective list drops rows it has no room for, and toasts stack from the top under the compass.
- The minimap and map pictures are baked once from the world's colliders (`Nav.rebake()` after moving level geometry). Per frame, only the small icon layers and the compass are redrawn, and static canvases are only rebuilt when they change. The minimap's picture (level, fog, frame) is redrawn only when the player has moved a point on it, the fog or the map changed, or the look changed; its markers sit in a separate light layer; the compass redraws only when it turns or something on it moves or pulses.
- **The fog minimap.** A gothic `fog` minimap and `fog` map with fog cells of 6 m, an 80 m level and three marks, one HUD walking at 5 m/s on the native desktop editor: `hud:update` 0.38 ms and 66 KB a frame (the minimap's share about 0.07 ms and 20 KB), standing still a median 0.20 ms and 18 KB. The suite's speed test prints the same measurement wherever the kit is installed.
- **What one HUD costs.** Measured in the playground scene on the native desktop editor (one player, five POIs, four objectives, toasts, round minimap, compass bar): `hud:update` takes a median 0.83 ms per frame (p90 1.5 ms, p99 4.0 ms, over 300 frames), and the profiler's average for NavHud was 0.78 to 1.2 ms. Drawing the HUD's screens adds about 2.4 ms to the engine's UI render pass (2.44 ms with the HUD, 0.04 ms with it stopped, averaged over 15 frames). Together, about 3.5 ms of CPU a frame. Starting the HUD several times costs no more: four holders measured 0.88 ms of script.
- **Buttons of your own.** The minimap, the compass bar and the toasts keep clear of the engine's touch controls, controlsKit's buttons and any rect in `ui.safeArea().controls`. A game or kit that draws its own on-screen buttons states them with `ui.setControlRegions(screenName, rects)` and the HUD moves off them.
- The satellite map's camera exists only while that map is open.
- `Nav.stop()`, removing the last NavHud, or `hud:destroy()` removes every screen, beam, ring and camera the kit made.
## Known limits
These are open issues on the engine's tracker. Each one says what you would see.
- **Two machines on one account (#14448).** Two sessions of one account in the same play room collide, and the engine can refuse one player's spawn. The kit tells the two sessions apart (each connection has its own peer id), so a toast, waypoint or personal objective meant for one machine reaches only that one. But on the machine whose spawn was refused there is no body to centre on: its minimap, compass and distances are measured from its camera instead, and other players see no avatar for it. Test multiplayer with two accounts.
- **No picture-based round or heading-up minimap (#19181, #19182).** A viewport widget draws nothing inside a fully rounded panel, and rotating one is ignored. So the minimaps are vector drawings baked from the world's colliders rather than a live camera picture, and the `map.satellite` view, the one real picture of the world, is a north-up rectangle on the full map screen only. If you put the satellite view from the lower-level builders into your own rounded panel, it comes out blank.
- **Simulated notches only work in edit mode (#19179).** In the editor, `ui.simulateSafeArea` does nothing while playing, so the HUD won't move away from a simulated notch in play. Check notch layouts in edit mode with NavHud's `previewInEditor` on. Real phones report their safe area normally.
- **The gallery's frame rate in the web player (#20750).** The gallery scene draws every style in every look at once, and in a web browser it runs at a lower frame rate than on desktop. A game's own HUD draws one of each and is not affected the same way.
- **Installs with several dependencies are slow (#21420).** navUiKit brings only two controlsKit modules and installs in seconds. The example guide also installs pickupsKit and markersKit, which bring several kits each and can take a while; wait for each install to finish.
- **The ZeroMind page can lag a release (#19258).** For a while after a new version is published, ZeroMind can show the previous release's description. The README inside the installed package is always the current one.
- **Guides inside a package don't show up in library search yet (#22181, ZeroMind#3099).** The two guides arrive with the package and the engine's guide search finds them once navUiKit is installed, but a ZeroMind library search does not list them. Search for "navUiKit" and read the guides in the Docs panel or under `navUiKit.package/guides/`.
## Reference
All calls are on `local Nav = require("navUiKit.nav")`. `player` arguments are optional: leave them out for the local player.
### Life cycle
| call | does |
|---|---|
| `Nav.version` | `"1.3.33"` |
| `Nav.start(opts?)` | Puts the HUD on screen for the local player. Makes (once) a runtime-only entity `navUiKit_hud` carrying NavHud; it is never saved or replicated. If a NavHud is already in the scene they share the one HUD. `opts` is applied as `Nav.configure(opts)` first. Returns the entity. |
| `Nav.stop()` | Removes every HUD on this peer (screens, beams, rings, satellite camera) and the host entity. NavHud components already in the scene stand down until `Nav.start()` or a new NavHud. POIs and objectives stay until the session ends (the next press of Play or Stop), so you can hide the HUD and bring it back mid-game. |
| `Nav.reset()` | Clears POIs, areas, objectives, fog and settings back to defaults, now. (Pressing Play or Stop does the same for everything except settings by itself.) |
| `Nav.hud(player?)` | The HUD object for a viewer, for split views and tests. |
| `Nav.on(event, fn)` | Listens for `poiAdded`, `poiRemoved`, `waypoint`, `objective`, `toast`, `mapOpened`, `mapClosed`, `styleChanged`, `hudStarted`, `hudStopped`. Listeners last for one session: register them in `onLoad`. |
| `Nav.sync()` | Asks the other peers for the shared objectives as they stand. NavHud calls it once when this peer's HUD starts in play; call it yourself after swapping in your own relay. |
### Style and settings
| call | does |
|---|---|
| `Nav.setTheme(name)` | `scifi`, `fantasy`, `cartoon`, `pixel`, `minimal`, or a theme added with `require("navUiKit.theme").register(name, def, base)`. |
| `Nav.setVariant(family, variant)` | `family` is `minimap`, `map`, `compass`, `objectives` or `toasts`. Unknown names throw. |
| `Nav.use(id)` | Applies a catalogue id (`"compass.ring"`, `"toasts.achievement"`, `"waypoint.beam"`, `"theme.pixel"`) or a theme name. |
| `Nav.configure(opts)` | Merges settings (nested tables merge). |
| `Nav.settings()` | The live settings table (read only; change it with configure). |
| `Nav.styles()` | `{ themes, minimap, map, compass, objectives, toasts, waypoint }` with the variant names. |
| `Nav.catalogue(filter?)` | Every style and look as a row: `{ id, family, variant, description, tags, themes, apply }`. `filter`: `{ tags = { ... } }` (rows with all of them), `{ tag = "..." }`, `{ family = "..." }`. |
| `Nav.icons()` | Icon names. |
Settings and their defaults:
```lua
{
theme = "scifi",
variants = { minimap = "round", map = "rooms", compass = "bar", objectives = "list", toasts = "slide" }, -- compass: bar, dial, ring, arrow
minimap = { show = true, size = 180, zoom = 1, range = 45, corner = "topRight" }, -- corner: topRight, topLeft, bottomRight, bottomLeft
map = { key = "KeyM", pad = "select", tapMinimap = true }, -- input = false: the game opens the map itself
compass = { show = true, span = 180 },
objectives = { show = true, max = 5 }, -- at = { x, y, w, h? }: draw the panel exactly there (screen points; h caps its height), false: the kit places it
toasts = { show = true, duration = 4, max = 4 },
waypoint = { icon = true, edgeArrow = true, distance = true, beam = true, ring = true },
fog = { cell = 4, radius = 14 },
rooms = { autoVisit = true, showAll = false, cell = 0, legend = {} }, -- cell 0: the minimap picks its own cell size
plane = "xz", -- "xy" for a side view: world up is up on every map
autoToasts = true, -- a toast when an objective completes
units = "m",
}
```
With `compass = "ring"` and `minimap.show = false`, the ring draws on its own in the minimap's corner, round a dark face.
### Points of interest and waypoints
| call | does |
|---|---|
| `Nav.mark(target, opts?)` | `target` is an entity, an entity id or a `{x, y, z}` point. `opts`: `icon`, `color` (`#RRGGBB`), `label`, `waypoint`, `height` (marker height above the target, m), `player` (only that player sees it), `compass` / `minimap` / `map` (false hides it there), `id`. Returns the POI id. |
| `Nav.unmark(id)` | Removes it. Returns whether it existed. |
| `Nav.update(id, changes)` | Changes any of the mark options, or `hidden = true` to hide it everywhere. |
| `Nav.get(id)` | A copy of the record, or nil. |
| `Nav.list(player?)` | POI ids; with `player`, only those that player can see. |
| `Nav.setWaypoint(id, on, player?)` | Makes it a waypoint, or not, for everyone or one player. |
| `Nav.isWaypoint(id, player?)` | Whether it is one. |
| `Nav.clearWaypoints(player?)` | Clears all waypoints, for everyone or one player. |
| `Nav.distance(id, player?)` | Metres from that player to the POI, or nil. |
**PointOfInterest component** fields: `icon`, `color`, `label` (empty uses the entity name), `waypoint`, `height`, `onCompass`, `onMinimap`, `onMap`. Its POI id is `"poi_" .. entityId`. Removing the component or the entity unmarks it.
### Map content
| call | does |
|---|---|
| `Nav.addArea(name, {minX, minZ, maxX, maxZ}, opts?)` | Names an area: the rooms map outlines and labels it. `opts.id`, `opts.color`. Returns its id. |
| `Nav.addShape({ {x, z}, ... }, opts?)` | Draws an extra polygon (a road, a wall) on the minimap and map. Returns its id. |
| `Nav.removeShape(id)` | Removes an area or shape. |
| `Nav.setBounds({minX, minZ, maxX, maxZ})` | Fixes the map extent instead of fitting the world. |
| `Nav.rebake()` | Re-reads the world's colliders into the map picture. |
| `Nav.explored(player?)` | Share of the map that player has uncovered, 0..1. |
| `Nav.reveal(x, z, radius?, player?)` | Clears fog around a point (normally automatic). |
### Objectives
| call | does |
|---|---|
| `Nav.objective(id, text, opts?)` | Adds one, or updates it. `opts`: `total` (above 1 shows 3/5), `count`, `shared` (default true unless `player`), `player`, `quest` (questCard title), `icon`. Re-declaring an existing id keeps its progress, total, quest and icon unless you pass them. Returns the id. |
| `Nav.progress(id, n, add?)` | Sets the count, or adds to it with `add = true`. It completes at the total. Returns the new count. |
| `Nav.complete(id)` | Ticks it off; it fades from the tracker. |
| `Nav.removeObjective(id)` | Removes it. |
| `Nav.objectives(player?)` | What that player sees: shared plus their own. |
### Toasts
| call | does |
|---|---|
| `Nav.toast(text, opts?)` | `opts`: `variant` (default the toasts setting), `title`, `icon`, `color`, `duration` (seconds), `to` (nil = local player, `"all"`, or a player / key), `key` + `pad` + `action` for prompts (`key = "KeyE", pad = "south", action = "Open"`), `id` (reusing an id updates that toast in place). Returns the id. Toasts queue, stack, slide and fade on their own. |
| `Nav.dismiss(id, player?)` | Fades one out early (e.g. a prompt whose door went away). |
### Room map
For games made of rooms (metroidvanias, dungeon crawlers, station maps). Pick it with `Nav.setVariant("minimap", "roomGrid")` and `Nav.setVariant("map", "roomGrid")`; for a 2D side-scroller add `Nav.configure{ plane = "xy" }`.
```lua
Nav.configure({ plane = "xy", variants = { minimap = "roomGrid", map = "roomGrid" },
rooms = { legend = { home = "Save room", skull = "Boss", check = "Boss beaten", star = "Shrine" } } })
Nav.addRoom("hall", { name = "Great Hall", cell = { 0, 0, 2, 1 }, area = { 0, 0, 48, 14 }, icons = { "home" },
doors = { { id = "hall>crypt", side = "right", at = { 0.1, 0.3 } } } })
Nav.addRoom("crypt", { name = "Crypt", cell = { 2, 0, 1, 1 }, area = { 48, 0, 72, 14 }, icons = { "skull" },
doors = { { id = "crypt>hall", side = "left", at = { 0.1, 0.3 } } } })
```
| call | does |
|---|---|
| `Nav.addRoom(id, def)` | Declares a room (or replaces it). `def`: `name`; `cell = {gx, gy, w, h}` in grid cells (gx to the right, gy UP the map; or `gx`, `gy`, `cw`, `ch`); `area = {a0, b0, a1, b1}`, the world rectangle the room covers on the plane's axes (x and z top-down, x and y side view), which places the player and POIs in it and marks it visited when they walk in; `icons` (icon names, or `{ name, color, label }`); `doors = { { id, side = "left" \| "right" \| "up" \| "down", at = {f0, f1} (0..1 along the side, from its bottom or left), to = roomId?, cell = {gx, gy}? } }` (left out, a door leads into the cell just across it); `color`; `hidden`. |
| `Nav.updateRoom(id, changes)` / `Nav.removeRoom(id)` / `Nav.clearRooms()` | Changes, removes one, removes all (with every player's visits and doors). |
| `Nav.room(id)` / `Nav.rooms()` / `Nav.roomAt(target)` | A copy of a room, the ids in order, the room whose area holds a point. |
| `Nav.visitRoom(id, player?, on?)` / `Nav.setVisitedRooms(ids, player?)` | Marks one room visited (or not), or replaces the whole list (a saved map coming back). |
| `Nav.roomVisited(id, player?)` / `Nav.roomsExplored(player?)` | Whether a room is visited; rooms visited and rooms in all. |
| `Nav.useDoor(id, player?, on?)` / `Nav.setUsedDoors(ids, player?)` / `Nav.doorUsed(id, player?)` | Doors a player has gone through. A door is untried until it is used or the room behind it is visited. |
| `Nav.untriedDoors(player?)` | `{ { room, door } }` for the untried doors of the rooms a player has visited. |
| `Nav.setRoomIcons(id, icons?, player?)` | Other icons on a room for one player (nil goes back to the room's own). |
Settings: `rooms.autoVisit` (default true: the room a player stands in becomes visited; turn it off when your game keeps the record and feeds it), `rooms.showAll` (draw rooms not visited yet too), `rooms.cell` (minimap points per cell, 0 = fit), `rooms.legend` (labels for the legend by icon name, plus `you` and `new`). Event: `roomVisited(roomId, key)`. Room state for a player on another peer is relayed to that peer, the same way per-player waypoints are.
### Map screen
| call | does |
|---|---|
| `Nav.openMap(player?)` / `Nav.closeMap(player?)` / `Nav.toggleMap(player?)` | Opens, closes or toggles the full map. Players also use M, Select, a tap on the minimap, or the close button. |
| `Nav.isMapOpen(player?)` | Whether it is open. |
### Components
- **NavHud**: puts the HUD on screen for the local player. Its fields override the world settings: `theme`, `minimap`, `map`, `compass`, `objectives`, `toasts`, `corner`, `previewInEditor`. Each is applied when the NavHud starts and again whenever you change it, also while the HUD is showing (in play, or in the editor with `previewInEditor` on), so changing `compass` from `dial` to `ring` swaps the compass at once, exactly like `Nav.setVariant`. A field left empty keeps the world setting, a field you have not changed never overrides a later `Nav.setTheme`, `Nav.setVariant` or `Nav.use`, and an unknown name logs a warning and changes nothing. On a player prototype it runs only for the copy this peer controls. Any number of NavHuds share one HUD.
- **PointOfInterest**: see above.
- **NavGallery**: the style gallery used by this world's startup scene. Fields: `walker`, `camera`, `path`, `page`, `theme`, `speed`, `showInEditor`. The walker can be any avatar; one nobody owns shows no name label over it.
### Lower level
The widget builders take a command list and a box, so a world can draw them into its own screens: `navUiKit.minimap`, `navUiKit.compass`, `navUiKit.markers`, `navUiKit.tracker`, `navUiKit.mapScreen` and `navUiKit.toasts`; `navUiKit.words` reads every word they draw from the `navuikit` catalog. Each module's README lists its calls. `navUiKit.hud`'s `Hud.new{ key, avatar, camera, box, viewBox, isLocal, world3d, theme, variants }` makes an extra HUD into any rectangle, such as a split-screen view or a picture-in-picture. A HUD with `isLocal = false` is not ticked for you: call `hud:update(dt)` each frame and `hud:destroy()` when done. `Hud.acquire(owner, opts)` / `Hud.release(hud, owner)` share one HUD between several holders, which is how NavHud does it.
## Tests
`navUiKitTests` (67 tests) covers every call above. That includes screens sent only when they would look different (the legacy switch sends them every frame), a speed test of the fog minimap (no redraw standing still, the picture redrawn on at most half the frames walking, with timings printed as a benchmark), every word in English and Brazilian Portuguese from the package's own catalogs, the minimap and compass clear of the Menu button on phones upright and sideways, the room map (rooms, per-player visits, used and untried doors, icon overrides, the HUD marking the room a player walks into, the roomGrid minimap and map screen in every theme, top-down and side view, phone-sized, the relay and the session reset), the xy plane, map input left to the game, NavHud fields restyling a running HUD, the two guides shipping inside the package, every play starting clean (the README example run over three plays), one HUD however it is started, session keys and toasts for one machine on a shared account, echo suppression, the ring and arrow compasses and their layout, the catalogue tags and filters, the cross-peer messages, the HUD life cycle (nothing left behind after destroy or stop), per-viewer isolation, the toast queue and band, the waypoint 3D parts, every builder in every theme, opaque 8-digit colours, and one version number everywhere. Run it in edit mode with `tools.use("tests", "run", { suite = "navUiKitTests" })`.
## Version history
- **1.3.33**: the compass test picks English itself, so the suite passes when the player has picked Brazilian Portuguese.
- **1.3.32**: the minimal look draws its titles in Arimo Bold (`arimo` with a bold weight, drawn as labels over the canvas, since canvas text takes no weight).
- **1.3.31**: the package carries the Anton, Archivo Black, Comic Neue Bold, EB Garamond and PT Serif faces its looks name, which the engine's built-in library does not ship.
- **1.3.30**: the gallery's `~.words` reference points at navUiKit's own words module (it pointed at a copy one game held, which an install placed as an extra file and which hid the words module where navUiKit sits under `deps/`).
- **1.3.29**: `objectives.at = { x, y, w, h? }` pins the objectives panel at a place the game picks (screen points, `h` caps its height); `at = false` hands placement back. New test: "objectives.at pins the objectives panel".
- **1.3.28**: the minimap, compass bar and toasts also keep clear of the rects in `ui.safeArea().controls` (buttons other kits or the game state with `ui.setControlRegions`). Nothing else changed.
- **1.3.27**: the minimap and toasts read controlsKit's touch buttons from `controlsKit.touchButtons()` in screen points (the engine layout lists them in its tap space, so the minimap could land on the Bag button). Nothing else changed.
- **1.3.26**: the geom, roomGrid and tracker modules name this package's own `words` module too (1.3.25 still left those three on the first publisher's copy). Nothing else changed.
- **1.3.25**: every module that loads the `words` module names this package's own copy (ten modules still named the copy of the world that first published it, so an install planned that world's content too and could refuse to update navUiKit over an older release). Nothing else changed.
- **1.3.24**: the toasts module runs on controlsKit 1.4.12 too (1.3.23 moved the button prompts, and the toasts still named 1.4.9). Nothing else changed.
- **1.3.23**: the button prompts and toasts run on controlsKit 1.4.12 (1.3.22 named 1.4.9, so installs beside a current controlsKit landed 1.4.9 or two copies). Nothing else changed.
- **1.3.22**: the `words` module and the locale and glossary files belong to this package, so installs into other worlds place them inside it and the minimap, map screen and room grid load (found in Starwright).
- **1.3.21**: every HUD screen (waypoint markers, ring compass, compass) is sent only when it would look different; `Nav.legacyPerf` switch to compare with sending them every frame; `Hud.stats`; a test. NavHud in Crossroads Tales' harvest fair about half (0.26 to 0.32 ms against 0.54 to 0.94 ms mean, same session).
- **1.3.20**: the fog minimap and the compass redraw only when what they show changed (a picture layer and a marker layer, the fog drawn by its cells, a closure-free circle clip): one HUD in a gothic fog setup went from 1.66 ms and 528 KB a frame to 0.38 ms and 66 KB walking on native; a speed test.
- **1.3.19**: the styles test counts four objective trackers again and checks every family against this README; no kit code changed.
- **1.3.18**: on small screens the compass, the minimap and the objectives never overlap as drawn, and the minimap stays on screen (a last layout pass; new test).
- **1.3.17**: every word the kit draws comes from the `navuikit` catalog (English and Brazilian Portuguese ship); the minimap's drawn bezel keeps clear of the touch Menu button, and the resting stick no longer pushes the compass bar down on a short landscape phone; the styles test counts six trackers.
- **1.3.16**: built against controlsKit 1.4.9 and menusKit 1.4.5, released without the UI library the engine deleted (it was built against a controlsKit that still required it); no kit code changed.
- **1.3.15**: the compass bar narrows (or drops below) to clear touch buttons in the top band; the objective list redraws when its spot moves.
- **1.3.14**: the minimap keeps clear of on-screen touch controls too: on a phone, a bottom-corner minimap slides along its edge (or up its side, whichever is shorter) until no thumb button covers it, and goes back to its corner when the touch controls hide.
- **1.3.13**: touch messages prefer a side column over the centre of the view.
- **1.3.12**: `toasts.top` keeps top-anchored messages below a game's own top HUD.
- **1.3.11**: the version test and reference table name the current version; no behaviour change.
- **1.3.10**: toasts keep clear of on-screen touch controls (stack from the top in a clear column, bottom pills lift above the controls).
- **1.3.9**: built against controlsKit 1.3.2 (was 1.3.1), so it shares one controlsKit with menusKit 1.3.19, saveKit 1.3.13 and inventoryKit 1.0.27.
- **1.3.8**: waypoint markers never take a tap.
- **1.3.7**: the README keeps only the current version number above this history, as the version test asks.
- **1.3.6**: built against controlsKit 1.3.1 (was 1.2.8), so it shares one controlsKit with economyKit and towerDefenseKit.
- **1.3.5**: a HUD drawn in a box (`Hud.new{ box = ... }`) lets taps through its message layer too: the layer is positioned by `vertical` containers with `pointerEvents = "none"`, which the engine reads on canvases and on the layout containers (vertical, horizontal, grid, spacer), as the UI guide says; only a plain `panel` takes every tap. Corrects 1.3.4's note that only a canvas could let taps through.
- **1.3.4**: on a full-screen HUD the toast layer lets every tap through while messages show (it took every tap on the screen before, so a phone game's own buttons and taps on the world went dead under it); a HUD in a box keeps its frame; 109 tests.
- **1.3.3**: built against controlsKit 1.2.8 (one controlsKit release beside menusKit, saveKit, twoDKit and sideScrollerKit); no kit code changed.
- **1.3.2**: the test suite reads the package from wherever it is installed (its own world, a top-level install or a dependency copy), so `version` and `guides ship with the package` pass as a dependency too; 109 tests.
- **1.3.1**: text only, the gallery README writes key ranges with a plain hyphen.
- **1.3.0**: the room map (`Nav.addRoom`, the `roomGrid` minimap and map screen, per-player visited rooms, used doors and room icons fed from the game or by walking in); the `xy` side-view plane for 2D games; the `gothic` look and room-map colours in every look; `map.input = false`; 55 tests.
- **1.2.1**: changing a NavHud field while the HUD is showing (in play or in the editor preview) restyles it at once, and an unchanged field never overrides a later call; this world on the engine's current built-in library; Known limits names ZeroMind#3099 beside #22181; 49 tests.
- **1.2.0**: two guides ship inside the package (how to use the kit, and an example exploration game with pickupsKit, menusKit and markersKit); checked on the November engine with no changes to the kit's code; Known limits lists only open issues; #19201 fixed in the engine, so the gallery walker shows no `{PlayerName}`; 48 tests.
- **1.1.0**: one shared HUD per player however it is started; per-session player keys, so two machines on one account are told apart; the ring and arrow compasses; tags on every style and the looks as catalogue rows; every play starts clean; opaque 8-digit colours accepted everywhere; 47 tests.
- **1.0.1**: multiplayer fixes: a toast to a player's body reaches them, joining no longer resets the group's progress, per-player waypoints and objectives for another player are relayed, late joiners catch up on shared objectives, and waypoint beams stay local.
- **1.0.0**: first release: minimaps, map screen, compass, waypoints, objective trackers and toasts in five looks, a gallery scene and a two-player playground, phone layouts and a test suite.
# Sealed Orders (assassinationKit): Assassination Contracts, Opportunities, Exits and Ratings Kit
**Turn any stealth level into a sandbox assassination mission.** You write a contract as one data file: the target (or targets), their portrait, their daily round and the guards who shadow them, the intel players can overhear, read or talk out of people, the opportunities (little chains of find → prepare → trigger that end in a staged accident or an opening), the exits (some locked until earned), the start points, outfits and gear. Sealed Orders runs the rest.
The package is `assassinationKit` (`require("assassinationKit.api")`); "Sealed Orders" is its display title.
- **Contract select, briefing and debrief**, drawn by the **missionScreens** package (Mission Dossier). Select shows every contract (two looks: **notice board** `board` or simple **list** `list`); the briefing shows the portrait, intel you already know and the start, outfit and gear you pick; the debrief shows every rating line, the grade, mastery progress and what you unlocked. Briefing and debrief come in three looks: **paper scroll** `scroll`, **case-file board** `caseBoard` and **compact phone card** `card`. Five styles in all, each switched with one setting.
- **Intel** from overheard conversations (earshotKit), notes and letters (loreKit), conversations (dialogueKit) or searching a place. Intel reveals an opportunity, points out the target, or opens an exit.
- **Eight opportunity kinds**: `poison` (a drink or meal), `heavyDrop` (something heavy falls), `riggedSwap` (swap in a rigged item), `impersonate` (take the place of someone the target meets), `lure` (draw him somewhere quiet), `sabotage` (what he rides or leans on), `guardAway` (send a guard off), `doorOpen` (leave a door open).
- **Five exit kinds**: `boat`, `cart`, `gate`, `rope` (rope or rooftop), `hatch` (hidden hatch).
- **Bloodless kills**: a kill is shown as an impactFrames ink-splash frame in sepia ink, never blood. **Knock-outs are always possible and never cost you grade.**
- **Run record and rating**: seen, alarms, bodies found, innocents killed, guards killed, knock-outs, accidents, disguises worn, time against par and the exit used become rating lines with bonuses and penalties, then a grade. The points are scored on **scoreKit**: each line goes through a scoreKit rules player (`Rules.add` for the base line and penalties, `Rules.bonus` for named bonuses) and the tiers come from scoreKit's grade lines (`Rules.rate`). **Four rating tables**: `ranks` (named ranks), `letters` (S to D), `pointsStars` (points with zero to five stars) and `team` (one co-op grade for the whole crew).
- **Mastery per contract**, saved per player in saveKit: replaying with a better grade earns experience and levels that unlock new start points, a starting disguise and gear.
- **Co-op multiplayer**: every player sees the same targets, opportunity progress, open exits and intel, also a player who joins late. Each player keeps their own record, disguise and gear; the `team` table grades the crew as one.
- **Two languages**: English and Brazilian Portuguese (see *Languages* below). Every word players read can also be renamed by your game.
- Keyboard and mouse, gamepad and touch; desktop and browser.
It is the glue. The guards, awareness and alerts are stealthKit and aiKit; bodies, hiding and alarms concealKit; takedowns takedownKit; disguises disguiseKit; the crowd townsfolkKit; overheard talk earshotKit; notes loreKit; conversations dialogueKit; prompts interactKit; items inventoryKit; tracker, markers and toasts navUiKit; saves saveKit; scoring scoreKit; the ink frame impactFrames; walkable paths navKit; the screens missionScreens. How much of the kit is these parts, and how well each served, is measured in `reuse-review.md` in this package.
## Install
Search ZeroMind for **assassinationKit** (or *Sealed Orders*) and install it, or by its guid:
```
zero zeromind installAsset 893f259e-9600-4848-8da0-b3cf709c9c4f
```
It brings every kit it needs, about forty packages, so a fresh install takes several minutes.
## Quick start
1. Install the kit (above).
2. In your scene build, place the mission and the people (the example guide has the whole scene, with the NavMap the guards walk on, the alert director and the caption settings):
```lua
local SO = require("assassinationKit.api")
local TD = require("takedownKit.api")
-- the target: a takedown-able character the mission walks round his day
TD.guard({ 0, 0, 8 }, { name = "Mayor Quill", preset = "hideGuard", target = { profile = "boss" } })
TD.guard({ 2, 0, 9 }, { name = "Quill's Guard", preset = "hideGuard" })
-- named places: plain entities the contract refers to by name (on solid ground: a 50 m starter ground ends at z = -25)
for name, p in { ["Town Well"] = { 0, 0, 7.8 }, ["Bakery"] = { 10.6, 0, 4 }, ["Flower Box"] = { 11.6, 0, 6.2 },
["South Gate"] = { 0, 0, -22 }, ["Market Start"] = { -8, 0, -12 } } do
entity.spawn(name, { position = p })
end
SO.place({ contract = "mayor_quill", rating = "letters", screens = "scroll" })
```
3. Write `contracts/mayor_quill.data/values.yaml` anywhere in your source (it replaces the kit's bundled example of the same id):
```yaml
contract: assassinationKit.contract
values:
id: mayor_quill
title: "The Mayor's Last Errand"
location: Hollowmere
brief: "Mayor Quill sells the town's wells. Make it look like bad luck."
targets:
- id: quill
name: Mayor Quill
guards: ["Quill's Guard"]
routine:
- { at: Town Well, stay: 40, doing: "greets the voters" }
- { at: Bakery, stay: 35, doing: "buys his bun" }
opportunities:
- id: flowerbox
kind: heavyDrop
title: The Loose Flower Box
at: Bakery
steps:
- { id: loosen, kind: prepare, text: "Loosen the flower box", at: Flower Box, hold: 3 }
- { id: drop, kind: trigger, text: "Push it when he is below", at: Flower Box }
exits:
- { id: gate, kind: gate, title: South Gate, at: South Gate }
starts:
- { id: market, title: Market, at: Market Start }
```
Press Play: the contract briefing opens, you pick your start, and the mission runs. `SO.problems()` lists anything wrong in a contract, naming the field.
## Swapping parts: one way for everything
```lua
SO.configure({ rating = "pointsStars", screens = "caseBoard", select = "list" }) -- the world's choice
SO.list("opportunity") -- poison, heavyDrop, riggedSwap, impersonate, lure, sabotage, guardAway, doorOpen
SO.define("exit", "balloon", { title = "Balloon", verb = "Cut the ropes", leaving = "You drift away over the roofs." })
SO.define("rating", "mine", { title = "My table", rate = function(facts, contract) ... end })
SO.words({ contract = "Job", opportunity = "Angle" })
```
The same five families (`opportunity`, `exit`, `rating`, `screens`, `select`) are what the Mission component's `rating`, `screens` and `select` fields pick from. `SO.rate(record, contract, table)` and `SO.teamRate(records, contract, table)` grade a record from code; `SO.mastery(id)` and `SO.masteryChoices(contract)` read a player's mastery.
## Languages
The kit's own words live in its catalogs `locales/en/` and `locales/pt-BR/` (namespaces `sealedorders` for words and screen lines, `sealedorders_rating` for rating lines and tier names, `sealedorders_example` for the bundled example contract). Players see the language they picked.
Text written as data is translated the same way: any text field in a contract, an opportunity or an exit may be a catalog reference written `"@<namespace>.<key>"`, and it reads in the player's language. Put the lines in your world's `/locales/en/<namespace>.json` and `/locales/pt-BR/<namespace>.json`:
```yaml
title: "i18n:one_bad_captain.title" # reads one_bad_captain.json -> "title"
```
Anything that is not a `i18n:namespace.key` reference shows as written. `SO.words({ ... })` renames a word for the whole game and a contract can rename words for itself; a renamed word can itself be a `i18n:namespace.key` reference.
## Make a contract with the workflow
The workflow `make-an-assassination-contract` takes a target idea to a contract played through twice: it designs the target, routine, guards, places, intel, opportunities and exits, writes the contract and intel files, wires the scene, checks it, then plays it quiet and loud to prove the grade. Start it with:
```
zero workflow start --name make-an-assassination-contract --args '{"target":"a toll-keeper who drowns debtors"}'
```
All args are optional (`target`, `id`, `scene`, `setting`, `opportunities`, `rating`, `screens`); its README lists them.
## Guides
- `how-to-make-an-assassination-contract-with-targets-opportunities-and-exits`: every field, every kind, how intel, steps and exits fit.
- `example-build-a-one-target-assassination-mission-from-an-empty-world`: an empty world to a playable one-target mission in about 15 minutes.
## Events
`SO.on(name, fn)`: `phase`, `intel {id, by}`, `oppStep {id, step, by}`, `oppDone {id, by}`, `targetDown {target, how, by}`, `toast`, `fx`, `refused {reason}`, `exited {exit, result}`.
## Multiplayer
The peer that owns the Mission entity (the room host) applies every command and walks the targets; the shared state lives in the Mission's synced fields, so a late joiner sees everything. Each player's engine owns their own `assassinationKit.Agent` record. Disguise, gear and the record stay personal. Events reach every peer on the bus channel `sealedOrders:evt`; commands go to the host on `sealedOrders:cmd`.
## Dependencies
| package | what the kit uses it for |
|---|---|
| stealthKit | alert level, lure gear, sense view and HUD style |
| concealKit | kill, knock-out, body-found and alarm events; knock-out and revive for opportunities |
| takedownKit | knock-out and lethal takedowns (the scene builds targets and guards with `TD.guard`) |
| disguiseKit | outfits, starting disguise, disguise record, badge |
| townsfolkKit | the crowd; townsfolk people count as civilians |
| aiKit | target and guard routes, the spotted event, concealment while leaving |
| navKit | walkable points for routine stops |
| earshotKit | overheard conversations that grant intel |
| loreKit | notes and letters that grant intel |
| dialogueKit | conversations that grant intel |
| interactKit | every step, search and exit prompt |
| inventoryKit | opportunity items and starting gear |
| navUiKit | tracker, target and exit markers, toasts |
| saveKit | mastery saved per player |
| scoreKit | rating line points and grade tiers |
| impactFrames | the ink-splash kill frame |
| missionScreens | select, briefing, debrief and leaving screens, five styles |
Optional, used when installed: controlsKit (which device a player is on, for the HUD layout) and juiceKit (ink droplets, dust, splash and shake in the kill moment and accidents).
## Performance
What was measured, and on what (2 December 2026, the showcase scene `scenes.oneBadCaptain`, a live run with the full crowd, guards and HUD):
| Where | Median frame | Average frame | Worst 1% | How |
|---|---|---|---|---|
| Desktop, the native editor window (1920x1080), playing alone, after the harbour finished loading | 25.5 to 27.8 ms (about **36 to 39 fps**) | 31 to 33 ms (about 30 fps) | 103 to 108 ms | engine profiler, three 20-second windows |
| Web, the browser build in headless Chromium (1280x625) | 29.3 ms (about **34 fps**) | 34.3 ms (about 29 fps) | 106 ms | engine profiler, one 20-second window |
**The 60 fps desktop target is not met.** These numbers come from one development machine that was running the editor, two more engine instances and a headless browser at the same time, on a development build of the engine. The profiler shows about a third of each desktop frame spent waiting for a free CPU core, so a player's machine running only the game should do better. This was not measured.
Where the desktop frame goes, after the harbour has settled: the engine's sky-visibility pass (about 4 ms), Luau garbage collection (2 to 8 ms, depending on the window), disguiseKit, the townsfolk and bodies (each 1 to 3.5 ms), and the camera follow. The kit's own mission code is below the profiler's top costs. The mission host runs at ten steps a second, and the harbour's road, village and launch hull are held on their finished frame instead of re-running their build every frame (that alone saved about 3 ms a frame).
Measure on your own machine: `zero profiler ring on`, play for 20 seconds, then `zero profiler retro --seconds 20`.
# climbKit: mantle, wall climb and ledge hang for any character
climbKit adds the traversal moves the built-in `CharacterController` does not have, as one component you put on a character's body:
- **Mantle**: run at a crate, a wall top, a market stall or a sloped roof and jump (or just walk into anything up to waist height) and the character pulls itself up and over onto the top in 0.35 to 0.6 s. It works onto sloped roofs up to ~40°, from one roof up to a higher eave, and from mid-jump (a jump that has already risen reaches higher).
- **Wall climb**: walls whose collider entity, or any entity above it, carries the attribute `climbable = true` can be climbed by holding forward against them: up, down and sideways at `climbSpeed`. Jump kicks off the wall; climbing past the top pulls over onto it; climbing down to the ground stands again.
- **Ledge hang**: dropping fast past an edge catches it. Sideways shimmies along it, forward or jump pulls up, back drops.
It uses the player's existing controls (the `move` axis and the `jump` action of the controller's input map, or whatever drives the controller's input bus, such as controlsKit), so it works on keyboard, gamepad and touch with no new bindings, and NPCs that drive a `CharacterController` through its input bus get the same moves. It sets no game rules (no stamina, no damage).
## Quick start: an empty world
Install the package, then in your scene's `build.luau` (or by hand on the body entity):
```luau
-- 1. Give the player prototype's body the moves. `body` is the entity your
-- PlayerPrototype names as its body (the one carrying the avatar Asset).
body.component.add("climbKit.ClimbMover", {})
-- 2. A 2 m ledge to pull up onto: anything with a collider.
local ledge = entity.spawn("Ledge")
ledge.component.add("Model", { model = "cube" })
ledge.component.add("BoxCollider", {})
ledge.localPosition = { 0, 1, -6 }
ledge.localScale = { 4, 2, 2 }
-- 3. A climbable wall: mark it (or any parent of it) climbable.
local wall = entity.spawn("ClimbingWall")
wall.attribute.set("climbable", true)
wall.component.add("Model", { model = "cube" })
wall.component.add("BoxCollider", {})
wall.localPosition = { -6, 3, -6 }
wall.localScale = { 4, 6, 1 }
```
In play, run at the ledge and press jump; walk into the wall and hold forward.
The `ledgework` world this package comes from has a showcase scene (`scenes/main`) with a course of crates, a 2 m ledge, a market stall under a townhouse eave, a climbable stone wall and a hang ledge.
## What it ships
| Part | What it is |
|---|---|
| `ClimbMover.component` | The moves. Goes on a body that has a `CharacterController`. Fields, telemetry and events in its README. |
| `ledge.module` | The probes behind it, usable on their own: `findLedge` (can this body pull up here, onto what, landing where), `wallAhead` / `wallRay` (is there a wall, is it climbable), `fits`, `pathClear`, `mantlePoint`, `isClimbable`. |
| `tests/climbKit_ledges.testSuite` | Mantle heights at jump and walk reach, too-tall walls, headroom, 20/30/40° roofs, a too-steep roof, mid-jump reach, climbable vs plain walls, overhangs, the mantle path. |
| `docs/climbing.guide` | How to let players climb walls and pull up onto ledges: the recipe, level-design numbers, animation hookup. |
## Climbable by rule (1.1.0)
Marking is not the only way in. Any package can register a **climb rule** that decides, for a surface nobody marked, whether it can be climbed: by how steep it is, how high, what it is made of. A marked surface always wins: `climbable = true` on the entity or a parent makes it climbable, `climbable = false` makes it never climbable whatever the rules say.
```luau
local Ledge = require("@root::climbKit.ledge")
-- Every near-vertical surface taller than 2 m is climbable.
Ledge.addClimbRule("myGame.tallWalls", function(entityId, hit)
if hit and hit.normal and math.abs(hit.normal.y) < 0.3 then
local e = entity(entityId)
if e.localScale.y > 2 then return true end
end
return nil -- no opinion: ask the next rule
end)
```
A rule answers `true`, `false` (stop asking) or `nil` (no opinion). The `hit` describes the surface being asked about: the wall face for the wall probes (`wallRay`, `wallAhead`, so its normal is near-horizontal) and the ledge top for `findLedge` (normal pointing up). A rule that errors is skipped and reported once. Rules live in module state, so a package that registers them checks `Ledge.hasClimbRule(name)` and registers again after a reload.
## Corners, catches and script control (1.1.0)
- Shimmying to the end of a ledge carries on round an **outside corner** onto the side face, and into an **inside corner** onto the wall across, over `cornerTime` seconds (`cornerShimmy` turns it off; `onCorner` fires). The direction held through the turn keeps going until the player changes it, so camera-relative controls do not read the turn as "let go".
- `tryHang(dirX, dirZ, exclude?)` catches an edge in that direction as a hang now, and `tryClimb(dirX, dirZ)` starts climbing the climbable wall there: for assisted jump catches, dropping to the ledge below, AI and scripted sequences.
- `hangCatchSpeed` sets how fast a fall has to be for an edge to be caught as a hang instead of mantled (was fixed at 2.5 m/s).
- `ledgeTopY` (synced) is the world height of the edge being hung from or mantled onto: where hand IK goes.
- Every peer now turns the visible body toward the wall from the synced `wallNormalX/Z`, so other players see a climber face the wall, not only the owner.
## Animations and game code
`ClimbMover` publishes `state` (`idle` / `mantling` / `climbing` / `hanging`, synced), `progress`, `ledgeHeight`, `ledgeTopY`, `ledgeSlope`, `climbX` / `climbY` (the climb input, for blending) and the wall normal, and fires `onMantleStart`, `onMantleEnd`, `onClimbStart`, `onClimbEnd`, `onHangStart`, `onHangEnd`, `onKickOff`, `onCorner` (synced to other peers). Play your mantle, climb and hang clips from those. `tryMantle`, `tryHang`, `tryClimb` and `release()` drive it from AI or script.
## Multiplayer
The peer that owns the body runs the moves; other peers see the body move through the normal body replication and read the synced `state` and events.
## Limits
- Up is world +Y: it does not climb in `GravityField` frames.
- A hang only catches when falling faster than `hangCatchSpeed` (2.5 m/s by default); slower, an in-reach ledge is mantled instead.
- Corner turns follow the edge at the height being hung from; an edge that steps up or down by more than 0.25 m at the corner is not followed.
## Changes
**1.1.6**: a hang caught while sliding off a sloped roof no longer throws the body across the map. The wall probe under a ledge could meet a near-flat roof surface, and normalising its tiny horizontal direction placed the hang metres away in one frame (seen as a 12 m jump in a castle town). The probe has to meet a wall (as of 1.1.12, steeper than 60 degrees), otherwise the hang lines up on the ledge's own edge, and a hang never moves the body further than its radius plus the probe distance plus 0.6 m. Airborne ledge probes now run 20 times a second instead of every frame, which keeps their cost low in levels with thousands of colliders.
**1.1.8** (first sent as 1.1.7 without this note): `Ledge.suspendClimbRules()` takes every registered climb rule out for a while and answers a function that puts them back (for a test that checks climbKit's own answer, or a scene that wants marked surfaces only). climbKit's ledge tests use it, so they pass in a world where another package (traverseKit's climb-by-rule) has registered a rule.
**1.1.9**: a hang now holds until the player asks to climb. A push toward the wall that was already held when the hang began (the pull-back that caught an edge just stepped off) no longer pulls up at once: the stick has to ease off for a moment (0.12 s) and push again. Jump still pulls up straight away; NPCs driving the body through the controller's input are unchanged.
**1.1.10**:
- Holding forward against a climbable wall starts the climb on its own after a short dwell (`autoClimbDwell`, 0.3 s by default; 0 turns it off), so a body standing on the ground climbs a wall such as a castle keep's stone base without a jump. This applies to NPCs driving the body through the controller too.
- Battered walls climb. A face that leans back as it rises (a castle's dry-stone base) no longer reads as its own top: the head probe is lengthened by the wall's lean, read from its normal, and the climber stands out from the face by that lean so its feet clear the stone.
- Over an overhang. A climb blocked by an overhang above (an eave, a keep's skirt roof) reaches out round its edge and pulls up onto the roof above, the way a climber goes over a cornice.
- No lurches. A single step this component makes is refused if it would carry the body more than 2.6 m in one frame, which stops a far-off ledge, corner or wall answer from throwing the body across a rooftop.
- The player's own controls are taken afresh at the start of each move.
**1.1.11**: letting go of a hang drops the body. The ledge just let go of (by pulling back, a jump away, or `release()`) is not caught as a hang again, neither by this component nor through `tryHang`, until the body lands or 1.5 s pass, so a script or kit that catches "the ledge below" after a drop no longer grabs the same edge straight back. Ledges more than 0.35 m lower, or more than 1.5 m along the wall, still catch.
**1.1.12** (follow-ups from the post-merge reviews of 1.1.6, 1.1.9, 1.1.10 and 1.1.11):
- A step that would be NaN is refused like a far one (the lurch guard compared with `>`, which NaN passes); refused steps warn at most every 2 s, and a hang that cannot be placed hands the body back instead of holding it in place.
- The wall under a ledge being hung from has to be steeper than 60 degrees (`wallRay` with `maxNormalY` 0.5); a roof slope seen from below lines the hang up on the edge instead.
- A wall or corner face with no horizontal direction is treated as no wall, in climbing and in corner turns (no divide by near zero).
- Falling fast with hang on, the air probe runs every frame again (20 times a second could skip the 0.8 m catch window at speed); a jump press is never throttled, and the throttle resets when a move hands back.
- The `autoClimbDwell` timer resets whenever the push is broken (stick released, hand-back, a new move), so taps no longer add up into a climb.
- A hang arms its pull-up once the push drops below 0.45 (was 0.3), so a diagonal stick while shimmying arms it; re-taking the player's controls keeps the push already held, so a late first report cannot pull up from a fresh catch.
- The overhang pull-up checks the way out from under the overhang is clear and runs its search at most 10 times a second while a climb is blocked.
- The released-ledge lock (1.1.11) clears as soon as the body stands, also stops the in-air pull-up back onto the same ledge, and leaves a ledge facing another way (across a narrow alley) catchable.
- Tests: the hang wall probe refuses a sloped roof underside.
**1.1.13** (review of 1.1.12): a hang spot that would be refused is refused before the controller is taken over (no stop in mid-air); a push kept across the controls re-take lapses after 0.25 s if the new activation never reports; the in-air released-ledge guard skips only the pull-up, so a lower ledge can still be hung from.
**1.1.14** (review of 1.1.13): the "move reported" flag resets before an activation that fails, so a push kept across the re-take still lapses; a hang probe that already failed in a frame is not run twice.
**1.1.15**: a climb or hang whose feet end up below the floor under them (a wall grabbed while dropping into a narrow gap) stands on that floor instead of holding still for good: every step up was blocked and the way down started inside the floor. It ends with `onClimbEnd` / `onHangEnd` reason `ground`.
**1.1.16** (review of 1.1.15): changelog in order; no code change.
**1.1.17**: a wall that goes on up under an eave or a cornice is climbed round it. When the head probe meets no wall but the top is still above reach (`too high`) or the column above the top is solid (`too tall`), the climb reaches out round the overhang (the same search a body blocked above makes, now `reachRoundOverhang`) and otherwise keeps climbing, instead of stopping below the eave for good.
**1.1.18** (review of 1.1.17): the overhang throttle's comment names both of its callers. A let-go rule for a wedged climb tried here was taken out again in review: it would drop a climber pushing up under an eave or shimmying into an inside corner.
**1.1.19**: version for the change above; the climbing code is 1.1.17's.
**1.1.20**: lips, shelves, eaves and slow machines.
- A ledge to hang from needs no room to stand on (`findLedge` option `forHang`), so a thin lip on a wall is caught on the way down; the hang sits out past a lip that sticks out of the wall, and is refused when something is over the hanging body (a roof seen from under its eave).
- Climbing up under a thin lip climbs up over it onto the wall above (`climbOverLip`, a mantle that ends climbing); pushing up from a hang on a lip does the same (`onHangEnd` reason `over lip`).
- A top within reach whose one landing spot is blocked (a post's cap) is pulled up onto a little to the side (`mantleBeside`).
- Pushed straight up under a block with no way round or over it, the climber edges sideways toward where it opens; in a dead end with neither side open it lets go after a second (`onClimbEnd` reason `no way up`; from 1.1.22 any pinned climb lets go, whatever the stick's direction). A head probe that starts inside geometry counts as blocked above, not as past the top.
- A body held out from the wall by a bump at its foot climbs straight up until the face is clear; a body a long frame pushed into the ground or a post beside the wall is moved to the nearest free spot; a hanging body is kept at its hang height.
- Long frames are climbed in steps of at most 1/30 s with the frame's input held for each step, so the head probe cannot pass a short face's top (Ledgework issue #12).
- `ledgeEntity`: the entity of the ledge hung from, mantled onto or climbed over, synced, cleared when the controller is handed back, for events that say which ledge was caught.
**1.1.21**: review fixes for 1.1.20 (PR #13). Climbing over a lip goes out, up, then in, so the body never passes through the lip, and ends with `onClimbStart`. `ledgeEntity` names the lip being climbed over and is cleared on hand-back. Pushing up at a wall top with nothing to pull onto (or with mantling off) holds still as before; only a body that cannot rise where it is edges sideways or lets go. The held-out straight-up step has no sideways part.
**1.1.22**: no climb holds the player for good. A climber that cannot rise where it is and whose stick (in any direction but down or away from the wall) moves it nowhere lets go after a second (`onClimbEnd` reason `no way up`): the pocket under a low eave, pushed sideways toward where the player is heading. With the head past a top whose one landing spot is blocked (a post's cap) and mantling on, the climber edges along the top for another spot and drops when the wall runs out, instead of holding still. When the step back in to the usual distance from the wall runs into something (a log's bulge) while straight up is free, the climb goes straight up. A shelf too narrow to stand on (up to 0.8 m deep, was 0.5 m) is climbed over like a lip, from below and from a hang on it, at a pace set by the whole path. Edging along a blocked top goes one way only and at most 2 m, then lets go (`no way up`), so it can never go to and fro. Checked on High Ground's Ridge Run with frames of 20 to 60 ms and spikes up to 270 ms: three of four keyboard runs finished, the fourth stalled at the post cap, which is what the second change fixes.
**1.1.23**: review fixes for 1.1.22 (PR #14). The search along a blocked top goes one way only and at most 2 m: one that would turn back (blocked at both ends) or runs out lets go (`no way up`), so it cannot go to and fro. Climbing over a lip or narrow shelf takes as long as its whole path (out, up, in), not the rise alone. ClimbMover README event list put back together.
**1.1.24**: a hang no longer waits for good on a push the player is already holding. A caught hang still holds for a moment when the stick was already toward the wall (so a catch does not flick straight into a pull-up), but a push held on toward the wall for 0.6 s pulls up (`HELD_PUSH_TIME`). A push held only partly toward the wall (more than 0.3 of it, less than the 0.6 a pull-up asks for) that shimmies nowhere pulls up (or climbs over a lip) after 0.4 s. Found on High Ground's Ridge Run, where a run-up held forward caught a roof eave and hung there.
**1.1.25**: hangs under a ledge that sticks out of the wall (a slab, a balcony's edge). A catch steps out from the wall, up to 0.6 m (was 0.44 m, and only when the body did not fit), until the body fits and nothing is over its head, so such a ledge is caught out in front of it, where it can be pulled up onto. A hang a long frame or a re-snap left under such a ledge steps out the same way (checked five times a second), instead of hanging there with the pull-up blocked above. Found on High Ground's Ridge Run under a slowed machine.
**1.1.26**: review fixes for 1.1.25 (PR #15). The catch's limit on how far it moves the body is checked on the final spot, after the step-out, and allows the step-out's 0.6 m on purpose. A shallow eave (underside ending within about 0.95 m of the wall) is now caught out in front of its edge, like a slab, and pulled up onto; a deeper eave is still refused.
**1.1.27**: safety nets so no wall or hang keeps the player. A climb or a hang whose stick is held (not down, not away from the wall) while the body stays within 5 cm for 2 s lets go (`onClimbEnd` / `onHangEnd` reason `no way up`): a corner the stick pushes into, a dead end along an eave the body can still rise a little under, a bar a rope hangs from with no wall above it. After a `no way up` let-go the same wall (facing the same way, within 2 m) is not climbed again for 3 s, so the player is not put straight back into the dead end. A hang keeps the colliders a `tryHang` caller excluded, so its overhead check agrees with the catch.
**1.1.29** (first sent as 1.1.28, changed on review in PR #16): `tryMantle(dirX, dirZ, exclude, opts)` takes an optional `opts` table for one call, applied by the new `Ledge.applyMantleOpts`: `minHeight` (clamped to -1 .. reach; a negative value lets the body step across onto a floor at or a little below its feet: tops down to half of it below the feet are found, landings down to all of it are taken), `maxHeight` (0 .. reach), `probeDistance` (0.1 .. 2 m) and `skipRiseCheck`. NaN and infinite values are ignored. `skipRiseCheck` skips the check for room straight above the body only when the body rises at most 0.3 m (the new `skipRiseUpTo` ledge option); such a step may duck 0.3 m under something over the head on its way across, while the landing still has to fit a standing body. A higher rise is always checked, so no top over a ceiling is reached. A step across fires `onMantleStart` with a height of 0 or less, and the mantle path then moves level or a little down. Why: a rope or pole often tops out level with the deck beside it, which a plain mantle (a ledge 0.4 m or more above the feet) never finds, so a climber at the top of such a rope stayed on it whatever they pushed. New tests: options clamped, stepping across onto a deck, stepping across under a rope's anchor beam, and a top over a ceiling refused even with `skipRiseCheck`. Calls without `opts` behave exactly as before.
**1.1.31** (first sent as 1.1.30, changed on review in PR #17): no hold at the foot of a wall. A climber whose stick is held down or away from the wall, whose feet have gone no more than 5 cm lower in 0.5 s, and who has ground within 2.5 m below now lets go and drops (`onClimbEnd` reason `blocked below`; a let-go like `drop`: no push-off, the usual regrab delay). That is the foot of a wall over a plinth or foundation that sticks out, which no step down can pass. Before, the going-nowhere rules only counted a stick held up or along the wall, so a player pushing down or away there was held for good (seen at a log cabin's stone foundation in High Ground's Ridge Run). The drop is measured over the whole half second, not frame by frame, so a slow step down at a high frame rate or with a light stick never counts as blocked. Higher up a wall (no ground within 2.5 m) a blocked climb down holds as before. The timer resets with the other climb timers (hand-back, a new climb, a climb over a lip). Pushing up or along still holds, and still lets go after 2 s of going nowhere.
**1.1.35** (sent as 1.1.32 to 1.1.34 in PR #18, changed on three reviews): three fixes found playing High Ground's Ridge Run on the current engine.
- `ignoreLedges` (new field, not synced): entity ids, separated by commas, whose tops this body never takes as a ledge: a ladder, pole or rope it holds. It joins every probe that could take the held thing for the ledge or the wall under it: the climb's top-out, the hang catch (ledge, wall under it, room for the body) and every room check while hanging (the five-times-a-second check, the re-snap, the shimmy and the corner turn), the pull-ups from a hang, a climb over a lip, a corner turn and the shimmy's edge, `tryMantle` and `tryHang`. Why: on a ladder whose rails stand above the deck it leads to, the top-out found the ladder's own top first and stood the climber on a 14 cm slab 0.9 m over the deck, where the next step fell back onto the ladder and caught it again, round and round. Whatever drives the body fills the field (traversalKit does, with the ladder held). `ledgeExclusions(extra?)` answers what the searches will leave out. Two new tests: a held ladder's own top is left out and the deck is found; the field is read with spaces and empty entries skipped and joined to a caller's list.
- A body with no `Locomotion` turned its back to the wall it grabbed: the facing fallback still assumed the old `{0, 0, 1}` front. The engine's default front is now the anchor's -Z (`transform.forward`, Locomotion's own default `{0, 0, -1}`), and the fallback follows it.
- Hand-back keeps the move's speed. The `CharacterController` walks from a walk of its own toward the input at its `acceleration` and `braking`, and resets that walk while it is switched off, so handing over only the input restarted every move from standing. For the one frame it is handed over, the controller's `acceleration` is 0 (reach the request at once); its own value is back once the controller has taken that frame (it clears the hand-back's one-frame jump), or after a quarter second at most, and also when ClimbMover is switched off or removed in between, or when the body is handed to another peer in between, so a 0 can never stay behind (the field is synced). Switching ClimbMover off also puts back the jump force and jump buffer a hand-back was holding. (1.1.32 wrote `velocityX`/`velocityZ` instead, which the controller only reports and never reads.)