Four prediction generations shipped and production still disagreed with the
server: v0.12.16's ack-sized envelope, wall-clock catch-up with a 1s cap,
ghost parity in both sims, and a forward-only replay clock. The last playtest
(n=645, rtt 41-69ms) still read gapP50 1.26, gapP95 7.05, 30% of snapshots
easing, with frameMax 17ms and zero server-side jumps. A second simulation
cannot be kept in agreement with the server by tuning.
Remove the second simulation instead:
- own seat renders the server's snapshot position through the same one-pole
ease as remote players (shorter constant, 0.6 vs 0.4 per frame, because
easing reads as input lag), snapping only past 1.5 cells (respawn/reset)
- drop the pending ledger, ack drain, input-to-ack EMA, envelope, trim and
ease correction, optimistic kick overlay, and the local movement copy
- drop ghosts stay as visual feedback, placed at the server's own copy of our
cell so they align with where the charge will appear
- telemetry now reports the ease's own-seat trail, own/remote snaps, snapshot
cadence, frame max, ghost rows and RTT
- delete bomperator/prediction.ts, its offline harness and the prod-RTT
fixture: they covered a mechanism that no longer exists
Input stays level-triggered on the monotonic seq + 400ms keepalive path. Cost
is one tick of queue (~25ms) plus one-way latency, the explicit trade for a
render that cannot diverge from the server.
tsc clean; bomperator-registry 19/19.
Root cause of the remaining jitter, and why stride tuning never touched it.
projectServerPosition replayed every unacknowledged input, then moved its
replay clock back to that input's receive time even when it predated the
snapshot. The trailing segment (targetMs - t) then included the input's
whole age, so a keepalive still in flight inflated the estimate by up to
the 400ms re-assert cadence: a phantom lead of 1-4 cells that the reconcile
then chased toward a position the server never occupied.
Prod telemetry fits exactly: gap p50 1.0, p95 4.12, max 4.5, 22% of
snapshots easing, frameMax 38ms, remoteSnaps 0, 13 ghost rows. No hitches,
no server-side jumps, just an estimator biased by pending input age. The
bias scale with ack latency, which is why the first match looked clean
(p50 0.18) and a match with RTT spikes to 53ms did not.
- clamp the replay clock: an input whose receive time is at or before `t`
contributes its direction only, never a rewind
- the component now calls the shared projectServerPosition instead of
keeping an inline copy of the same replay (one implementation, one fix)
- unit tests pin both behaviors (stale input adds no travel, newer input
still advances); harness 12 scenarios plus the two new tests green
Prod telemetry (3291 snapshots, one match): gap p50 0.18 but p95 1.22,
max 4.19 cells and 43 eases. A 4-cell gap is ~0.6s of running, so these
are events, not latency noise. Tuning the correction envelope could only
change how they were presented.
- advance prediction by real elapsed time (1s sanity cap) instead of a
100ms slice: the engine runs on wall clock, so every main-thread hitch
over 100ms left a permanent gap that had to be eased back. The ease
branch keeps its own 100ms slice so a catch-up frame cannot discharge
a whole gap at once
- release held keys when the tab hides: input is level-triggered, so a
backgrounded tab kept the technician running server-side and then
snapped back on return
- replay optimistic ghost charges in the server estimate too; pred saw a
charge the estimate did not, so every unconfirmed placement read as
divergence while it was in flight
- telemetry: per-row longest frame and ghost count, frameMax/ghostRows in
stats, so the next playtest attributes any remaining gap directly
- harness mirror: same 1s catch-up and 100ms ease slice; 12 scenarios green
Add a briefing export dialog with a diary script and a structured text array. Convert Lexical formatting, including bold, code, underline, colors, headings, lists, and quotes, into Arma Structured Text. Scope the shared color palette to the briefing editors and render colors on the mission page.
Adds a shared fixed-position debugging dock (Controls/State/Log tabs) gated
to dynamic superusers, mounted per minigame. Multiplayer games gain synced
server-authoritative admin commands with [dev-admin] audit logging: poker
(force fold, force street, per-viewer reveal-all, clock control, stack
adjust, force expire), blackjack (bankroll adjust, next-card injection,
dealer override, force expire), bomperator (pure applyAdminCommand: crates,
pickups, eliminate, freeze, sudden death, timer, end round; mirrored over
the arena REST path), and CFF Versus (reveal fleets, force shot outcome,
skip turn). Solo games get client-side tuning via persisted dev settings:
flappy physics sliders plus pause and invincibility, EOD layout reveal and
seeded boards, radio transcript view and timer freeze, aim trainer seed and
difficulty overrides plus hitbox overlay, OPORD answer reveal and study
window, call-for-fire target reveal, seeded grids, and free corrections.
Includes 26 new integration specs (command purity, gating, audit lines) and
a poker e2e smoke for the dock. Plan: Minigame Developer Console.
Prod telemetry (bompDebug, 783 snapshots): ping RTT of 3-24ms shrank the
correction envelope to ~0.75 cells while the real gap noise floor sat at
p95 1.0, so 13% of snapshots trimmed and each trim closed its whole
excess in one frame - constant micro-teleports.
- size the envelope from transport RTT plus the server-side component of
measured input-to-ack latency (tick queue + snapshot turnaround),
which ping/pong cannot see; HTTP behavior stays near the v0.12.6 tuning
- rate-limit trims to 0.35 cells per snapshot (a run-speed glide); the
>2.5-cell ease branch remains the fallback for genuine divergence
- harness mirror updated: maxJump now capped at 0.35 across all 12
scenarios, prod-trace pulls 162 -> 47, zero teleports throughout
- drawDrop now renders the powerup name on a semi-opaque plate pinned to
the cell bottom (no bob, stays readable while the drop animates)
- own loadout pip row centered above the play area
- opt-in client telemetry behind localStorage.bompDebug='1': one row per
reconciled snapshot (gap, envelope, correction branch, rttAvg, snapshot
delivery cadence, remote-player snaps) plus transport kind changes,
exposed as window.__bompDbg.stats()/.table()/.dump() to diagnose the
reported WS jitter with data instead of guesses
Add a client-safe ROUTINE_EVENT_TYPES list (game:tick, economy:tick, market:auto-generate) and hide those types on /events behind an off-by-default Routine ticks switch. The dashboard always excludes them so real events fill the recent list.
Tick bins now skip no-op emissions: game tick requires shipment, construction, or production activity; market tick requires an expiry or generation; economy tick requires processed items or errors. Historical events stay in the database and remain visible via the toggle or the admin panel.
Add a research pipeline over the existing technology tree: Research
Facility blueprint fields copied to structure instances, tech-researches/
tech-ballots/tech-ballot-votes collections, Game Rules research config,
pure rules lib (capacity, duration math, eligibility, intel-weighted
tally with tie cascade), a timestamp-derived tech-tick bin that opens,
resolves, advances and completes research with notifications, vote
casting server actions, and a read-only member-facing tech tree page at
/intelligence/tech-tree with veil blackout and dossier-style panels.
Includes migration 20261019_184409_add_tech_research_system, permission
groups, event and notification types, sidebar entry, and integration
plus e2e coverage.
Adds a dedicated Node 22 + ws arena server (src/arena) that owns live
Ordnance Disposal matches: drift-corrected 20Hz tick loop with capped
catch-up and tick-drift logging, per-socket snapshot fan-out, 30s jose
ticket auth, and awards via the idempotent results callback route.
Client gains a transport abstraction (transport.ts): WsTransport first
when NEXT_PUBLIC_ARENA_URL is baked into the bundle, HttpTransport
(today's actions + SSE + guarded poll, behavior unchanged) as automatic
fallback after two connection failures or a 5s setup timeout; absent
env var means pure HTTP (kill switch / rollback path). Next actions
proxy the match lifecycle to the arena when ARENA_SECRET +
ARENA_INTERNAL_URL are set; the in-process registry stays untouched as
the default backend.
Deploy wiring: runner-arena Dockerfile target, compose service, env
docs, DEPLOYMENT.md checklist. Tests: arena module suite (19), live
server WS suite (3), prediction harness ws-grade latency scenario.
The six period-scored game pages (flappy, eod, opord, radio,
qualification, call-for-fire) now render their current-period
PeriodStandingsCard directly under the game board, in the slot the
lifetime board used to occupy. Each game's all-time leaderboard moves
below it into a collapsed AllTimeLeaderboard disclosure (shadcn
Collapsible) that expands on click, so period standings are centered and
primary and the lifetime board is opt-in.
PeriodStandingsCard drops its period/all-time toggle and keeps the
current period only, now with the presence line the pages previously
omitted. The old "Anchored period standings" heading and card block are
removed from the six page.tsx files. The e2e spec covers the collapsed
all-time section on /minigames/flappy.
Command Post becomes a 3x2 rect that flips wide/tall, the Ammo Depot L grows to four cells, the FOB becomes two cells, and a second FOB (Forward Operating Base II) joins the fleet for 16 cells across five structures. Fully destroyed structures now render charred black instead of red, and their cells burn with flame and ember particles for 45 seconds after destruction, driven by a new impact timestamp on each shot.
Root cause: Node event-loop stalls drop the server's setInterval ticks with
no catch-up, so the sim permanently lags wall clock; the old all-inputs-acked
pull let that gap stack past the snap threshold and discharge as an instant
backward teleport (the reported complaint).
- Component: lead-aware correction envelope, trim on every snapshot,
capped-rate ease (2.5x speed) past 2.5 cells; resets still snap via the
ack-backwards branch. No latency-precision mechanisms (the v0.12.4 lesson).
- prediction.ts: drop the unused decision-nudge exports.
- Harness: replay recorded production HAR latency
(tests/fixtures/bomperator-prod-rtt.json), model server tick stalls, add
per-reconcile jump telemetry. A/B proof under trace+stalls: v0.12.3 policy
teleports twice (max jump 2.59 cells); envelope policy zero (max 1.10).
Reverts 655407a (component + guide). Production HAR showed input POST
TTFB p50 87ms / p90 236ms / max 384ms (server pipeline variance, not
network). The nudges and ghost projection trusted rttAvg too tightly and
glitched under that variance; v0.12.3 behavior is restored.
Kept on purpose: bomperator/prediction.ts and the offline prediction
harness stay as test-only infrastructure for the re-fix, which will be
calibrated against the recorded production latency trace.
- Extract client prediction helpers to bomperator/prediction.ts (predStep/
predAdvance port, alignDecisionToServer, projectServerPosition)
- Nudge prediction across cell boundaries at turn/stop edges so client and
server commit to the same rounding decision; ghosts use the server's
projected placement cell
- Stamp snapshot arrival time; event projections use measured age, reconcile
estimate keeps the calibrated half-tick bias
- Replace pending-gated pull and instant 2.5-cell snap with a lead-aware
correction envelope plus capped-rate ease (2.5x speed); resets still snap
via the ack-backwards branch
- Add offline deterministic prediction harness (real engine + modeled network
+ frame-by-frame reconcile mirror), 9 scenarios incl. rAF stalls and a
pre/post-fix ghost-mismatch comparison
Halve TICK_MS (100 -> 50) so every snapshot-bound surface (opponents,
explosions, drops) arrives twice as fresh, and double every hardcoded
tick-denominated constant so real-world durations stay identical:
BOMB_FUSE_TICKS 25->50, FLAME_LIFETIME_TICKS 3->6,
SUDDEN_DEATH_INTERVAL_TICKS 40->80, SPAWN_INVULNERABLE_TICKS 10->20.
TPS-derived durations (round timer, countdown, end hold) scale on their
own. Client fuse-blink and flame-fade thresholds are now derived from
the constants instead of hardcoded for 10 Hz.
Fixes a latent engine bug the old rate masked via lucky float rounding:
approach() snapped to the target only when the remaining delta was
<= step exactly, so a multi-tick glide accruing float dust (5.3 + 0.35
= 5.6499999999999995) could overshoot on the final step and park the
technician at 5.999999999999999 forever (isCellCentered accepted it,
Number.isInteger did not). approach() now tolerates step + 1e-6 and the
movement loop snaps resting positions to whole cells, restoring the
documented rest-exactly-on-center invariant at any tick rate.
Docs: registry header and minigames AGENTS.md updated to ~20 Hz; also
corrected stale rate-limit (40/s) and polling (500ms fallback) notes.
Two client-side follow-ups from the first prod playtest of prediction v2:
Reconciliation no longer position-corrects while the latest inputs are still
in flight. In that window the server legitimately trails the local sim (it is
still applying the previous direction), and the previous always-on 20% pull
dragged the sprite backwards on every turn and key release; that drag is what
made movement feel heavy even after prediction landed. Soft correction now
only runs once every sent input is acknowledged and the gap exceeds a 0.4
cell deadzone, pulling the excess; the teleport hard-snap is unchanged.
Dropping a charge now renders an optimistic ghost at the technician's cell
the same frame, mirroring every server rejection rule against the freshest
state. The ghost blocks movement like a real charge (but cannot be kicked),
burns its fuse on the local clock, and is retired per snapshot by a bomb at
its cell, by a fresh bomb owned by our seat (possibly one cell away when the
server trailed the displayed position), or by a 1.2s expiry covering server
rejections.
The client rendered the local technician only from server round trips, so
every keypress showed up RTT + tick + easing late (roughly 250-500ms in
production, per HAR analysis of a live playtest). Two changes, shipped
together:
Direction edges now fire immediately with a monotonic seq instead of queueing
behind an in-flight POST. The registry applies only strictly newer seqs, so
out-of-order action POSTs can never resurrect a stale intent, and echoes the
last applied seq back in every snapshot for client reconciliation.
The client predicts its own seat locally with a line-level port of the
engine's movement rule (align-first turns, blocked settle, slip-to-rest,
kick-push with an optimistic overlay) and reconciles per snapshot by
replaying unacknowledged inputs forward from the server position, timed by
send time plus measured latency, instead of snapping toward a stale sample.
A soft 20%/frame correction absorbs sub-cell error; teleports and round
resets still snap.
Add a 2-8 player free-for-all Bomberman-style charge-clearing drill at
/minigames/bomperator, category multiplayer. Pure engine plus a single-instance
in-memory match registry, mirroring the call-for-fire-versus split but upgraded
from turn-based to a fixed ~10 Hz tick loop.
Engine (src/lib/minigames/bomperator): seeded RNG via state.rngState/gridSeed;
grid is 15x13 with border, even/even pillars and seeded crates; classic pickups
bomb/range/speed/kick. Movement is grid-locked with sub-cell interpolation,
charges fuse about 2.5s, cross-flames stop at walls, crates are destroyed and
charges chain-detonate and kick-push. Round ends at one alive; sudden death
spawns random explosions after 150s with a draw guard.
Registry (registry.ts): one setInterval per live match started on startMatch and
cleared on complete/dissolve; globalThis-anchored map; holds seats across a
reconnect window then eliminates; below two active seats it dissolves. On a
manual end, broadcasts a bomperator-terminated event so remaining players see a
toast, then awards rewards via stats.ts (minigame:bomperator, profile group
bomperator: matchesPlayed/matchWins/roundsWon/kills/xpEarned).
Clients POST rate-limited inputs and poll fetchBomperatorMatch; the SSE bus pushes
snapshots with a guarded slow-poll fallback. Registry row ships as upcoming so the
page renders the coming-soon shell until an admin flips it active. Adds the
migration for the stats group, the minigame:bomperator event type, XP
aggregation on the profile, generated types, and real-time event wiring.
Guard the Technologies collection with an X-PTF-If-Unmodified-At
precondition hook (update-only, header-only) that rejects stale writes
with HTTP 409 and a stale_write payload, placed before the approval
reset hook. Bulk position writes gain per-row ifUnmodifiedAt tokens in
one all-or-nothing statement; conflicts return the offending ids and
successful writes return fresh tokens so clients advance their own
versions. The lite editor shows a Version Conflict dialog (load latest
or overwrite anyway); canvas position conflicts surface as a toolbar
banner with refresh / force-overwrite plus red node rings.
Tests: new tech-tree-concurrency int spec (guard, coexistence with the
approval reset, positions preconditions), two e2e scenarios for the
dialog and the banner; existing positions spec adapted to the new
return shape.
Add a "phasingOut" minigame status and an `estimatedRemovalDate` field so a
game can be announced as leaving soon while staying fully playable and keeping
scoring periods (unlike retired games). Visibility is the only difference:
- Sidebar badge + tooltip (amber "Phasing out", countdown to removal) in
NavMinigames, via new phasingOutTooltip in countdown.ts.
- In-game banner (PhasingOutBanner) on all 9 game pages, wired from
getMinigameReleaseState (added the fetch to call-for-fire, which lacked it).
- registry.ts status union + field; loadRegistry.ts maps the field;
config status select + estimatedRemovalDate date field added.
- Migration adds the enum value and column (idempotent); types + db schema
regenerated.
Adds tests for visibility, round-trip, and period scoring; updates the
minigames domain guide.
Event nodes gain a 'Post this event to the Discord NPC dispatch channel'
checkbox. The flag rides emit() onto game_event_logs (discordRequested +
announcement bookkeeping columns, migration add_event_log_discord_fields),
and a new bot poller stamps pending rows into an amber NPC Dispatch embed
with relative-time mention and a link back to the source contact.
Bot delivery itself is unverifiable locally (no Discord token or channel id
in dev); the DB-side contract is covered by an integration test and a live
probe walk confirmed discord_requested persists end to end.
DialogueText gains line-based block lists: consecutive lines starting
with - / * render as bullets, 1. / 2) as ordered lists, with item
content running through the inline parser so markup nests inside items.
Node editing swaps plain textareas for a shared MarkupEditor (line,
narration, lead-in, closing, tooltip, lock message, event message):
a formatting toolbar (bold, italic, code, color, link, bullet and
numbered list), a right-click menu wrapping the selection in tokens,
and a live DialogueText preview on the long-form fields. Storage stays
the plain custom-markup string; the editor only wraps selections.
Conditions become a discriminated union: the existing flag leaf plus a
single-level group combining leaves with AND / OR / NOR. The evaluator
recurses one level, and every flat-assuming site (choice gating, graph
validation, editor, canvas previews) is group-aware; DB entry gates stay
flat by design. The node editor gains a shared condition builder with a
combinator dropdown and repeatable rows for both branch nodes and gated
choices.
Display strings also gain ternaries: {{ key ? yes : no }}, {{ !key ? .. }},
and numeric compares like {{ rep >= 5 ? .. }}. A brace-depth scanner
rewrites ternaries over bounded passes so branches may nest flag tokens
and even nested ternaries, then plain interpolation runs its single
never-rescanned pass. Ternary keys join collectNodeTokens so the server
reads exactly the flags a node needs.
Nodes can carry pointers to media docs (transcripts, sealed orders,
images). Authors upload from the node editor (gated on
npc-dialogues:update); the runtime resolves ids to file URLs server-side
and players open them in a dossier-styled viewer modal with download
and new-tab escape hatches. Deleted media resolve to nothing instead of
dead chips.
The per-browser localStorage tracking reset on every new device and kept
re-badging whole conversations whenever a GM edited the flowchart (hash
change), which players read as "nothing I read is remembered". Read
progress now lives in a npc-dialogue-states collection: one row per
(user, dialogue, node) with a unique index, so a node badges NEW exactly
once per player and GM edits never re-flag content they already saw.
- New collection NpcDialogueStates (own-doc access, staff-visible admin
view) plus migration add_npc_dialogue_states.
- lib/npc-dialogue/states.ts: listSeenNodeIds for the page and an
idempotent markNodeRead; exposed via the markNpcDialogueNodeRead
server action, called fire-and-forget as nodes type in.
- The contacts page seeds initialSeenNodeIds into NpcConversation; the
component keeps an optimistic local set and no longer touches
localStorage. seen.ts and its tests are removed.
Verified live: fresh account shows NEW on all choices, reading the
"Who are you?" branch and reloading drops that badge while unread
branches keep theirs; npc_dialogue_states holds exactly the traversed
nodes. Interpolation int suite green (30/30).
Dialogue-emitted game events default to restricted (npc:dialogue policy) so
narrative branches stay spoilable-free, which also hid announcements authors
intended for everyone. Event nodes can now mark their effect's log entry
public: NpcDialogueEffect gains an optional eventVisibility field, runEffect
threads it into every emitGameEvent call (emit, reward, flag), and the node
editor exposes a "Show this event to everyone" checkbox for those effect
types.
Omitted eventVisibility keeps today's behavior exactly: resolveEventVisibility
falls back to the per-type restricted policy. The separate restricted flag:set
audit written by the PlayerFlags hooks is untouched.
Verified live on dev: two injected event nodes (with and without the flag)
stored visibility "public" and "restricted" respectively; flow and probe rows
cleaned up afterward.
Edges in the dialogue flow editor bent around where cards used to be until
the page was saved and refreshed, because RoutedFlowEdge memoized its
obstacle rectangles on the React Flow store's nodeLookup Map. That Map is
mutated in place during a drag, so the memo key never changed and the cached
rects only refreshed on remount.
Compute the card rectangles in the editor from its own live `nodes` state and
hand them to each edge through `data`, which is how the tech tree already
drives its routed edges. Obstacles stay render-only: serialize() persists
deriveEdges(clean) separately, so nothing new reaches stored flow data.
Verified by dragging a non-endpoint card over an unrelated edge and sampling
that edge's path mid-drag: 4 of 5 held positions re-routed with the fix, 0 of
5 without it (same test, same document).
Cell size was computed from the wrapper width without subtracting the
inventory frame's p-2 padding and borders, so the grid was ~16px wider
than its container and grew a horizontal scrollbar. Subtract the 18px
frame chrome, lower the cell floor 40->24 (legibility guard only), and
switch the wrapper to overflow-hidden so no scrollbar can appear.
Vehicle orientation is meaningful in a bay, so a parked-then-turned
vehicle now shows its silhouette turned too. The rotated image is sized
from the card's pixel dimensions (long edge against the card height) and
anchored to the card centre so the 90deg turn happens around the middle
instead of clipping against the top edge. Name labels stay upright.
dnd-kit pins the DragOverlay container to the activator rect measured
at drag start, so pressing R while dragging left the preview at the
pre-rotation footprint (a square-ish box for elongated items). Pass the
live rotated dimensions through the DragOverlay style prop, which is
spread after the pinned rect, in all three R-to-rotate grids: garage
vehicle bay, locker, and structure storage.
- Reject in-world dates after the current in-game date (now + 47,326 days)
- Default the date picker to the present in-universe date when composing
- Show a subtitle with the formatted date and days since the Awakening
- Reject any journal in-world date before March 19, 2156 in the
create/update validation (server-side) and add min to the date picker.
- Filter the related-mission dropdown to operationType = "main" only.