Log inGet started
World

Low Water

README.md

omenKit

Monster detectors for horror games: something the player carries that warns them a monster is near without showing where it is. A radio that crackles and lets a broken voice through, a Geiger counter that clicks faster, a motion tracker that pings, a candle that gutters and burns blue, a pocket watch that slows and stops, and seven more. Every gadget comes held in the hand (a modelled 3D object with moving needles, hands, flames and lamps), on the HUD (an instrument drawn on screen), or both, in a plain, retro (1970s bakelite and brass, amber dials) or scifi (clean panels, cyan glow) look, and a world swaps between all of them with one field.

Version 1.1.2 (Omen.VERSION). No dependencies: omenKit installs and runs in an empty world. It senses stalkerKit monsters, feeds tensionKit's dread and routes its toggle through controlsKit when those are installed, by soft links.

First example

In a scene's build.luau (or any script), with a player already set up:

local director = entity.spawn("OmenDirector")
director.component.add("omenKit.OmenGadget", { gadget = "radio", presentation = "both", look = "retro", range = 30 })

Press Play: every player carries a crackling radio in hand and on the HUD. G (d-pad down, the Detector touch button) switches it on and off. Put an omenKit.OmenThreat on anything that should register, or let it find stalkerKit's monsters by itself.

Every gadget, every presentation, every look

Each cell is one field change away from any other. All 108 combinations are covered by the test suite.

gadgetwhat it does as the threat closesheldhudbothplainretroscifi
radiostatic thickens, a faint broken voice and a thin tone push through, signal lamp flickersyesyesyesyesyesyes
motionTrackerpings faster and higher; a smeared blip at the right range ring, never the exact spot (vague direction)yesyesyesyesyesyes
geigerclicks run faster into a crackle, meter needle climbsyesyesyesyesyesyes
emfneedle and five-LED bar climb green to red, buzz growsyesyesyesyesyesyes
compassneedle drifts off north toward something, then spins and rattles (vague direction)yesyesyesyesyesyes
pocketWatchticking slows, then stops deadyesyesyesyesyesyes
candleflame leans, gutters, dims, sputters and burns cold blueyesyesyesyesyesyes
musicBoxlullaby drags, slows and goes out of tune, then stallsyesyesyesyesyesyes
breathFogyour breath fogs visibly, faster and thicker; frost creeps in from the screen edgesyes (breath)yes (frost)yesyesyesyes
heartbeatWatchwrist display BPM climbs, heart icon throbs, beeps every beatyesyesyesyesyesyes
dowsingPendulumcrystal swings wider and chimesyesyesyesyesyesyes
thermometermercury drops, frost creeps up the glass, ice cracklesyesyesyesyesyesyes

Only the compass and the motion tracker hint at a direction, on purpose, and only roughly (a slow wobble of up to 50 degrees). Every other gadget reads distance only, smoothed and jittered so the dial never states a distance either.

Components

componentwherefields
omenKit.OmenGadgetone per scene (the director)gadget, presentation (held, hud, both), look (plain, retro, scifi), hand (right, left), range (30 m), sensitivity (1), closeRange (0 = 22% of range), occlusion, weighted, startOn, sound, dread, toggleKey
omenKit.OmenCarrieron each player's body (the director or Omen.equip adds it)the same, plus on, jitter, volume, controls; reading (synced, coarse)
omenKit.OmenThreaton anything the gadgets should senseweight, hunting, idleWeight, active
omenKit.OmenWraitha test figure to put on a threatheight, eyes
omenKit.OmenPedestal, omenKit.OmenShowcasethe showcase gallery

API (local Omen = require("omenKit.api"))

calldoes
Omen.equip(player?, opts)give a player a gadget or change theirs (player = body entity or id, nil = this engine's player). opts: { gadget, presentation, look, hand, range, sensitivity, on, closeRange, occlusion, weighted, jitter, sound, volume, controls, dread }
Omen.unequip(player?)take it away
Omen.setGadget(name, player?) / setLook(name) / setPresentation(name)swap with one call
Omen.setHand("left" or "right", player?)which hand holds the gadget (default right); the left hand mirrors the right-hand pose, for other players too
Omen.setOn(bool), Omen.toggle(), Omen.isOn()switch it
Omen.level(player?)the reading, 0..1 (0 with no player, no gadget, switched off or no threat)
Omen.reading(player?){ level, raw, threats, gadget, look, presentation, on, spikes }
Omen.gadgets() / Omen.looks()every gadget { name, label, description, direction }; every look with its description
Omen.addSource(src, { weight }) / removeSource(id) / clearSources()custom threats: an entity, a position, or a function returning one (or { position, weight })
Omen.setSourceFn(fn)replace the sensing: fn(listenerPos, body) returns a raw 0..1 or a list of { position, weight }
Omen.onSpike(fn)fn({ id, distance, gadget, player }) once each time a threat first comes inside close range; returns a stop function
Omen.setToggleKey("KeyH")an extra keyboard key for the toggle
Omen.bindControlsKit("action")route the toggle through a controlsKit action so its rebind screen rebinds it (soft link)
Omen.setSound(name, clip), Omen.setVolume(v)your own clips; master volume
Omen.define(name, def)add a gadget of your own: { label, description, step, build, animate, svg }
Omen.threats()what this engine senses now (debugging; never show it to the player)

Which hand

A held gadget sits in the right hand by default. A game whose player already holds a flashlight in the right hand carries the gadget in the left one with hand = "left" on the director or in Omen.equip, or Omen.setHand("left") at any time:

Omen.equip(nil, { gadget = "radio", hand = "left" })

The left-hand pose is the right-hand one mirrored across the view's centre line (x, yaw and roll flip sign; Held.poseFor(gadget, "left") returns it), and other players see the gadget at the same side of your body. Never edit Held.POSE from a game: it is shared by every carrier. A gadget added with Omen.define gets its left pose the same way from the pose it registers.

Threat sources

By default, with no setup: every entity carrying stalkerKit's Stalker (found by component name, so stalkerKit is never required; a hunting or chasing monster weighs more than an idle one, one hiding in a vent less), every omenKit.OmenThreat, and every entity with the omen.threat attribute (e.attribute.set("omen.threat", true), found by a scan every 3 s). Add your own with Omen.addSource, or replace the sensing with Omen.setSourceFn.

The reading is a falloff of distance inside range, weighted by what the monster is doing (weighted) and, with occlusion on, damped by walls (a raycast twice a second per threat). It rises quicker than it falls, so a passing threat lingers on the dial, and it wanders slightly so it never states an exact distance.

Sound

Every gadget makes sound, synthesized for this kit (sounds/, from the recipes in omenKit.synth): a 1970s shortwave radio's static (band hiss that fades in and out, clustered crackle, static bursts cut off by a squelch click, a drifting heterodyne whistle and a faint broken murmur deep in the noise), a broken voice and a carrier tone, Geiger clicks, tracker pings, watch ticks, music box tines, heart-rate beeps and thumps, EMF buzz, candle flame and sputter, breath, pendulum chimes, compass rattle, frost crackle, the spike sting and the switch. Loops follow the reading in volume and pitch; one-shots play through a small pool of emitters on the player. Sounds are local to each player. Swap any of them with Omen.setSound.

Soft links

  • stalkerKit: Stalkers are sensed by component name, weighted by their mode and hidden fields.
  • tensionKit (horrorKit): with dread = true the reading feeds setThreat twice a second and each spike adds a dread stimulus.
  • controlsKit: Omen.bindControlsKit(action) routes the toggle through a controlsKit action.

Multiplayer

Each player has their own gadget and their own reading, computed on their own engine from the monster positions it already sees, so nothing about the reading is sent anywhere except a coarse value (5% steps, 4 times a second) that lets other players see your held gadget move: on their screens it hangs at your body's hand, animated and silent. Works with one or two players (tested), and with zero (everything reads 0).

Performance

Readings update 10 times a second; the HUD tree is rebuilt only when what it shows changes; sweeps, swings, flickers and pulses are engine-run CSS animations; held models are quick-geometry programs with a few pivot transforms and per-instance glow writes per frame; the gadget step allocates nothing. Touch screens get a Detector button (and the HUD moves to the upper left, clear of the stick and buttons).

Showcase

The omenKit.showcase scene (the omenKit world's startup scene) is a dark gallery in first person: twelve pedestals with every gadget on display and a plaque, two consoles by the door for the look and the view, and a hooded figure walking from the end of a long back corridor up the hall and back, so every reading rises and falls. Stand at a pedestal and press E (pad X, the Use button) to take its gadget; [ and ] step through gadgets, L looks, P views. layers.load("omenKit.showcase") opens it.

Guides

  • How to add a monster detector that warns the player when a monster is near (radio, Geiger counter, motion tracker and more) (omenKit.package/how-to-add-a-monster-detector-that-warns-the-player-when-a-monster-is-near.guide)
  • Example: build a small horror level where a crackling radio warns you the monster is close (omenKit.package/example-build-a-small-horror-level-where-a-crackling-radio-warns-you-the-monster-is-close.guide)

Tests

omenKitTests (16 tests): every gadget x look x presentation equips and draws, left and right hands mirror without editing the shared poses, a rig whose entities were despawned poses without throwing, every synthesized clip is non-silent with headroom and no flattened peaks, readings rise and fall, spike once, swaps, zero and two players. tests.run("omenKitTests").

Version history

1.1.2

  • Built on the current @builtin (d7b6509) instead of 93d6d4b. Before, the kit's held gadget, wraith and tests required @builtin::systems.quickGeometry.sceneNouns at an older @builtin, so installing omenKit placed an old copy of sceneNouns under deps/07158574/versions/29f1a966..., and a game scene that builds with quick geometry nouns (Low Water's main scene) then loaded PARTIAL in a fresh client: mergeGeometries was bound into its build.luau by both copies. No API or behaviour change.

1.1.1

  • New Omen.setHidden(hidden) and Omen.hidden(): a game hides this player's own held gadget and its on-screen readout while a title screen, pause menu or cutscene owns the screen, and brings them back after. The gadget stays switched on and keeps reading; other players' gadgets are not affected. Before, the held gadget's visibility followed only whether it was switched on, so it was drawn over a game's title screen (found in Low Water).

1.1.0

  • New hand option (right default, left) on OmenCarrier, OmenGadget, Omen.equip and Omen.setHand: carry the gadget in the left hand when a flashlight fills the right one, without editing the shared poses. Held.poseFor(gadget, hand) returns a hand's pose.
  • Fixed: OmenCarrier threw entityRef: entity ... does not exist every frame once its held rig was despawned from outside (scene reload, camera swap, a game's cleanup). The carrier now forgets a dead rig and rebuilds it, and Held.pose / Held.setVisible skip a rig that is gone (Held.alive(rig)).
  • Sounds: the radio static is now a 6 s 1970s shortwave bed (bursts, squelch clicks, crackle clusters, heterodyne whistle, a faint broken murmur). Recipes no longer clip before normalizing (the voice, buzz, tine, chime and spike clips had flattened peaks), and synth.bake writes into sounds/ wherever the kit is installed.

1.0.0

First release: twelve gadgets, three presentations, three looks, synthesized sounds, spike events, stalkerKit, tensionKit and controlsKit soft links, per-player multiplayer readings, the showcase gallery, two guides and the test suite.