Changelog
All notable changes to THRESHOLD XR are recorded here. The format follows Keep a Changelog, and this project adheres to Semantic Versioning.Unreleased
Added
- Stalking mechanic — entities now come for you. Each active entity keeps a live position that creeps toward the player whenever it is outside a 42° cone around the view direction, and freezes the moment it is looked at. Speed ramps from 0.10 m/s to 0.38 m/s across a run. Reaching
STRIKE_DISTANCE(0.85 m) while unobserved firesRendererCallbacks.onThreatStrike, which punches the camera, plays a face stinger and ends the run. With two entities live you cannot watch both, which is the tension. Measured: ignoring one at 2.5 m costs you the run in 14 s; glancing away 2 s in every 5 s buys ~30 s; near-continuous watching ~50 s. Guards: an entity must be fully manifested (≥0.8) and alive ≥2.5 s before it can strike, so nothing spawns on top of you and instantly kills you. - Proximity audio:
setThreatProximity(distance)drives a breathing layer that rises sharply as something closes, ducks the whole ambience to near-silence as it arrives (the silence is the warning), and ramps a heartbeat from ~0.9 Hz to ~3.3 Hz. - Entities now always turn to face the player.
Changed
- Outcome copy is honest about why you lost.
RunSummary.causenow records'strike'vs'acoustic'. Being reached shows PROXIMITY BREACH — It reached you. instead of the acoustic-vocalisation message, which was simply wrong when an entity grabbed you. - The rule is on the title screen: “Watch them — look away and they close in”. An unexplained instant-death mechanic reads as a bug, not as fear.
- Threat rendering uses the stalking position rather than the fixed spawn slot, so WallPeel / crawler / etc. peel off their surfaces and advance.
getNearestThreatDistance()exposes the closest entity for proximity effects.
Fixed
- Shadow map type deprecated on Quest:
shadowMap.typewas set toTHREE.PCFSoftShadowMap, whose implementation three r187 removed. Every run loggedTHREE.WebGLShadowMap: PCFSoftShadowMap has been removed. Using PCFShadowMap instead.and silently downgraded. Now requestsTHREE.PCFShadowMapdirectly. - AI scare plans silently dropped two of the seven archetypes: the Gemini plan sanitizer in
server.tsvalidated archetypes against a five-entry set, so anyInterceptStalkerorFaceAssaultspot Gemini chose was silently replaced with the slot’srecommendedArchetype(which slot generation also never picks from those two). Both archetypes were already fully implemented (rigs, renderer branches, local-director spawns) — the validation set was the only gate.VALID_ARCHETYPESnow lists all seven. Design note:FaceAssaultwas built as a camera-staged scare; letting the AI director also place its rig on room slots is a deliberate taste call (Kev’s update directive, 2026-12-04). If that purity is ever wanted back, deleting the single'FaceAssault'line restores InterceptStalker-only room placement. - Director phase tests aligned with the 5% Baseline design: two
director.test.tsfailures were expectation drift, not an engine bug. Commit2f9679b(“cut baseline dead air”, 2026-11-12) deliberately shrank Baseline from 12% to 5% of a run — with a rationale in the commit and the code — but the tests, last touched inb6ba511, still asserted the old bands. Expectations now sample the current bands (Baseline sampled at progress 0.02; the Baseline step of the staging test runs at t = 2s of 60s). No engine code changed and no assertion was weakened. Suite: 14/16 before this update, 16/16 after;tsc --noEmitclean before and after.
Verified on device
- Confirmed on a Quest 2 (OculusBrowser 157 / Chrome 157) over the
adb reversetunnel:window.isSecureContext === trueon plainhttp://localhost,navigator.xrpresent, andnavigator.xr.isSessionSupported('immersive-ar') === true. - Note for anyone testing via DevTools:
isSessionSupported()never settles while the page isdocument.visibilityState === 'hidden'(browser panel not displayed), soenterWebXRPassthrough()awaits forever and the button appears to do nothing with no capability notice. The browser panel has to be visible in the headset first.
0.1.0 - 2026-11-12
Headset bring-up pass: the build now actually runs in passthrough AR on a Quest 2, and the experience has atmosphere, motion and a much shorter wait before the first scare.Added
- Declarative threat rigs (
src/three/threatRigs.ts): every entity silhouette is now data — named parts with shape, material and transform — instead of ~226 lines of hard-coded mesh construction. Animation addresses parts by name, so a future redesign (smoother surfaces, sculpted geometry, or a substituted GLTF model viamodelUrl) only touches this one file. Includes an exportedTHREAT_RIGStable and abuildThreatRig()instantiator. - Limb joints and capsules: arms and legs are split into upper/lower segments with explicit elbow/knee spheres and 16-segment capsules, so figures taper and bend rather than reading as stacked cylinders.
- Atmospheric audio bed (
src/audio/horrorAudio.ts): procedurally generated reverb impulse, breathing air layer with slow filter sweep, 27.5 Hz sub-harmonic swell with its own amplitude LFO, and randomised distant creaks panned around the listener. All layers scale with dread and are torn down with the room tone. No audio assets are shipped. - Manifest stinger: a sub-drop plus air transient, panned to the threat’s azimuth, fired the instant an entity first appears so a silent reveal is never missed.
- AR dimming overlay: a camera-locked black plane billboarded from the real head pose, so the Compression phase can close the world in during passthrough. Previously all dimming was silently skipped in XR.
README.mdand this changelog;RUN-LAN.mdheadset setup guide.
Changed
- Threat materials: bodies are true void (
0x000000, roughness 1.0) so they absorb light and read as a hole in passthrough; skin carries a cold self-lit edge (emissive0.85) that survives a bright camera feed; eyes went fromemissiveIntensity0.35 to 2.6 and grew 0.011–0.017 m → 0.016–0.023 m so they read as pinpoint glow. CeilingHangredesigned: torso stretched shot past human proportion, drooping head with glowing eyes (it previously had none), arms lengthened, and palms with four splayed fingers per hand added — hands hang ~2.4 m below the anchor.- Reveal curve:
manifestationis eased withpow(m, 1.7), so entities stay concealed longer and then are simply there. - Idle motion: every entity now has a deterministic per-threat tremor, sway and body roll (
threatMotionSeed()), so nothing is ever perfectly still. - Pacing:
Baselineshortened from 12% to 5% of the run, first-threat delay frommax(7, dur*0.13)tomax(4.5, dur*0.055), first-anomaly delay frommax(5.5, dur*0.08)tomax(3.5, dur*0.05). First threat now arrives at ~10 s on a 3-minute run (was ~23.4 s) and ~4.5 s on 1 minute (was ~7.9 s). - Rig scale is applied on an inner group so per-frame animation scale composes with it instead of clobbering it. Standing figures are now ~2.10 m.
Fixed
- Express 4 catch-all route:
app.get('/{*splat}')is Express 5 / path-to-regexp v8 syntax and returned 404 for every non-root path on Express 4.22. Now'*'. - HTTPS certificate had no SAN: the self-signed fallback used
-subj /CN=localhost, which browsers ignore for hostname matching since Chrome 58, and which could never match a LAN IP. It now emits-addext subjectAltName=coveringlocalhost,127.0.0.1and every non-internal IPv4, and prefers mkcert material at.certs/lan.pemwhen present. PORTwas hardcoded to 3000; nowNumber(process.env.PORT) || 3000, which allows running an HTTPS and a plain-HTTP instance side by side for diagnosis.- AR had no dimming at all:
setPassthroughDimness()early-returned whenever an XR session was active, because fog and tone-mapping exposure cannot darken composited passthrough. The overlay above closes that gap. .gitignorenow excludes.certs/,mkcertand.chrome-profile/—.certs/contains the development CA private key.
Notes
- Verified:
tsc --noEmitclean, production build clean,POST /api/ai/analyze-roomover HTTPS across three room presets, TLS chain validation, and headless-Chrome render. - Not verified in this pass: the in-headset immersive session,
dom-overlayHUD support, and the subjective mix level of the new audio/visuals — these need a real headset.
Source: DTRHnet/Threshold-XR@12cd722 —
CHANGELOG.md.