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).
The default ?period=current scope arrives as periodId null, and
buildLeaderboardPayload built the boards before resolving currentPeriod(),
so buildPeriodBoards short-circuited to zero entries: the live period's
board was always empty even while ledger rows existed for it. Resolve the
period first and feed its id into the boards, and cover the default scope
with a real-clock regression test (the suite previously only exercised
explicit period ids).
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.
Next.js dev bundles server packages per route, so a module-level Set forks
into one copy per bundle: a broadcast issued from a server action or registry
bundle would never reach a client subscribed through the /api/realtime route
bundle. Anchoring the client set on globalThis unifies every bundle copy within
the single dev process, the same trick blackjack/poker already use. It is a
no-op in production, which has one module instance anyway.
/changelog edit=true resolves the target entry (latest or one version,
ranges rejected) and opens a modal prefilled with its raw markdown
instead of posting. Submit re-checks staff, renders the edited text
through the existing splitForDiscord pipeline and posts the amber
embed(s). One-shot by design: CHANGELOG.md is never written back.
Entries over the 4000-char modal cap refuse edit mode. Modal path
skips deferReply (first-response rule, same as /announce); submits
route through bot/index.ts on the ptf-changelog-edit: prefix.
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 resetApprovalStatusOnEdit(), a collection beforeChange hook factory: when a
non-superuser updates a document whose stored approvalStatus is approved or
revision_requested, the status is rewritten to in_progress so the edit goes
through review again. Creates, superusers (system:admin-access), and system
writes with no user (catalog imports, seeds) are exempt, and an explicit
in_progress/ready_for_review in the edit is honored.
Wired into Technologies, Assets, Resources, Vehicles, and Structures.
Structures also moves from the legacy isDeveloper filterOptions gate to
approvalStatusFieldAccess("structures"), matching the other four collections
and removing the hard ValidationError when saving an already-approved structure.
Tests: 12 cases in tests/int/division-admin-access.int.spec.ts.
Next.js rejects arbitrary exports from a route module, so the production
build failed on `export const ANALYTICS_SID_COOKIE` in /api/collect. The
constant is used only inside that file, so make it module-private. The client
SDK keeps its own copy in client-analytics/core.
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