/dm-game:hud-readoutsfrom dm-game
Builds smooth, correct browser-game HUD elements: DOM/canvas/diegetic choice, interpolated world-anchored readouts, write-on-change DOM, pausable timers, compass/edge arrows, minimap, score/combo, and tiered toast queue with deduplication.
Ships in dm-game. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Purpose: Every readout shows the right value, at the right time, moving smoothly, without costing the frame. The skill covers the plumbing behind a HUD that player-ux has already decided the content of.
Sources:
radio-queue.ts): timberwolfTyped sketch: references/hud.ts. It covers interpolation, the pausable view
clock, write-on-change text, edge-arrow placement, shortest-arc easing and the
toast queue.
| Failure | Seen in | Root cause |
|---|---|---|
| Markers judder on 120/144 Hz displays | timberwolf, gravelight, free-horses (read from code, not reproduced) | HUD and world read raw 60 Hz sim state; no interpolation |
| Hit flash lasts half as long at 120 Hz | Hard Deck (flashT -= 1/60 per frame) | Timer counted in frames, not seconds |
| HUD labels shake with the camera | free-horses' ui-plan warns against it | Screen-space HUD drawn inside the shaken camera container |
| Arrow shown for a target hidden behind the HUD dock | timberwolf (fixed, hudInset) | On-screen test used the full viewport |
| Toasts pile up and cover play | Hard Deck (uncapped timeouts), logarithmic (unbounded queue, no dedupe) | No queue, cap or tier |
| About 20 fix commits in one compass (survey count) | redshifted | Arrow kinds added one at a time, with no shared placement rule |
| Layer | Use for | Cost |
|---|---|---|
| DOM overlay | Text readouts, panels, toasts, anything a screen reader or aria-live should hear | Layout per write: write only on change (rule 3). Give the overlay pointer-events: none and opt interactive controls back in, or clicks never reach the canvas, and pointer-lock's gesture handler never runs |
| Canvas (the renderer's own UI layer) | Many items, or per-frame motion: edge arrows, world markers, minimap blips, damage numbers | No accessibility tree: mirror critical facts into DOM text, as volatile-state-redux does |
| Diegetic (in the fiction: a dashboard dial, a light on the ship) | Non-urgent state, when immersion is a declared pillar | Easy to miss. Pair it with a non-diegetic fallback the player can switch on |
Fagerholt & Lorentzon add meta-perception: effects on the player's view itself, like red screen edges. Gravelight's threat rim is one. It is often the cheapest legible option for "danger level". Its intensity follows the flash setting (see game-feel).
Anything anchored to the world reads interpolated render state:
pos = lerp(prev, curr, alpha) with alpha = accumulator / STEP.
alpha the world renderer used this frame, or markers slide off
their targets.World markers use the world's camera transform, shake included. Redshifted's
worldToHudScreen adds shake and zoom. A marker that ignores shake slides off a
shaking target.
Screen-space panels never take the shake. Draw them outside the shaken container.
Text readouts can read sim state directly, because they change rarely. Publish them throttled:
Both are corpus values. Starting value elsewhere: 5–10 Hz (posture B). Test: does any value the player acts on lag visibly? If so, raise that one readout's rate, not all of them.
Keep the last string per element, and compare before writing textContent. That is
Hard Deck's HUD and logarithmic's setText cache. Never innerHTML a readout per
frame, and never rebuild a list that holds focus (menu-navigation rule 7).
dt seconds: flash, pulse, toast hold, arrow
fade. Never by "one frame". Hard Deck's flashT -= 1/60 halves the flash at
120 Hz.dt after a hidden tab, so one frame can't skip every timer to the end.hudInset.compass.ts).font-variant-numeric: tabular-nums), so the number
doesn't jitter as digits change width.score-animator.ts).
c1ef2293).Tiers:
now: alerts. They cut in on the current toast, unless that is also now.next: lessons, warnings. They never wait behind chatter.chatter: flavour, achievements.Within a tier, first in, first out. This is timberwolf's radio-queue.ts, a
pure, tested module.
Cap the chatter tier and shed the oldest. Timberwolf caps it at 6 (corpus value, CHATTER_MAX).
now and next are never dropped.
De-duplicate an identical line already queued or on screen. Logarithmic's queue doesn't, so repeats stack.
Hold time. Starting value: 2 s plus 60 ms per character (posture B). Test: a first-time player reads every lesson toast without pausing. If they miss lines, lengthen the hold.
Accessibility: a role="status" region (aria-live="polite") for the toast
text. Switch to assertive only for now alerts (timberwolf). Several
achievements at once collapse into one toast: "3 achievements".
Placement: at an edge, away from the play-critical centre. A toast that must be
read in combat goes near the eye-line instead (GAG intermediate), and then it
belongs in the now tier.
Lines that must be read during action and must stay true (crew radio, coaching) need more than a toast: situation keys, an engagement-bent reading clock and a card stack. See in-play-comms.
prev = curr
on discontinuities.w < 0 before placing the arrow.resize,
and when the UI scale setting changes (settings-and-persistence).now
alert must show over a menu, put it in the top layer too (a popover), or hold it
until the menu closes.aria-live floods. Throttle what a screen reader hears to the same tiers, or
the chatter drowns the alerts.Each line names what the check cannot see.
Unit, pure functions: - edge placement: a target in each octant, and a target behind - shortest-arc easing across ±π - toast queue order, cut-in, cap, dedupe
Mutation-check the cut-in rule. *Blind to: legibility.*
High-refresh display (120 Hz or more): markers stay locked to targets while the camera pans. Blind to: 60 Hz, where the bug is invisible.
Throttle the page to 30 fps (DevTools): the flash and toast durations, in seconds, are unchanged. Blind to: timers added outside the view clock.
Pause with a toast showing: it is still there, with the same time left, after resume.
Hide a target behind the HUD dock: an arrow shows, not a marker under the dock. Blind to: HUD layouts at other aspect ratios, so repeat at 4:3 and 21:9.
Colourblind simulation (OS filter): every arrow and blip kind is still distinguishable. Blind to: real colour-vision deficiency, which is close but not identical.
Screen reader on: alerts are announced, and chatter doesn't flood. Blind to: other screen readers.
Three tight links. Everything else routes through the map, so adding a skill
touches one file rather than twenty: references/routing-map.md (in
game-design).
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
40 skills in this plugin
/accessibility-designUse when designing any player-facing feature, evaluating a game for accessibility, responding to accessibility feedback, designing difficulty or assist options, adding subtitle/caption systems, implementing input remapping, or when a player reports they can't play. Covers the four accessibility pillars (visual, auditory, motor, cognitive), implementation tiers, colorblind design, subtitle standards, input accessibility, and testing methodology. Accessibility is a design discipline, not a post-launch checklist./async-and-socialSocial and competitive design that does not require players to be online together: ghost/replay data, leaderboards, asynchronous PvP, offline vulnerability, and anti-snowball mechanics. Use when adding leaderboards or high-score tables, designing ghost races or replay challenges, letting players attack or compete against absent opponents, deciding what social signal a single-player game should carry, or when matches and runs feel decided in the first minutes. Anti-snowball applies to single-player roguelikes and simulations too, not just PvP. For real-time multiplayer architecture, matchmaking, guilds, and moderation, this skill deliberately does not cover them — those are large specialities and belong in dedicated references.npx claudepluginhub rbergman/dark-matter-marketplace --plugin dm-gameOther plugins' skills for the same job