062026 Ability HUD
Opus 4.8
Summary
Built the on-screen ability HUD for 062026 (the build-heavy SNKRX×RoR action-roguelite) from scratch in one session — from four layout mockups down to a polished, spec-lab-editable filled-slot HUD wired to live Swordsman state. All visuals route through the four-axis effect pipeline; the ability colors are placeholders pending a planned stat-based recolor.
Orientation:
- Resumed 062026 after session 5 (Swordsman kit complete: Cleave / Leap Slam / Surge / Blade Dance + shield + buff systems). The session-5 plan (Swordsman UI card + stat system) was deferred; the owner pivoted to designing the on-screen ability HUD himself rather than doing external ChatGPT ideation.
HUD layout mockups (hud.lua, new file):
- Built 4 toggleable HUD layouts; F6 cycles A/B/C/D; a top-center label names the active one. All read LIVE player state (cooldowns, charges, shield/HP, Surge).
- A = bottom-center tray; B = split corners (RoR2-style: resources bottom-left, abilities bottom-right); C = left rail (vertical column + name labels); D = sculpted hub (ult enthroned center, segmented shield, dividers).
- Screen is 480×270 logical. Wired into main.lua:
require('hud'), F6 bind,hud_update()replacing the old fixed bottom-leftui_hud_barpair. - Shared
hud_slots()gatherer (per-ability cooldown/charge/active state, computed once) +hud_slot()drawer; HP/shield fills threadhud_hp_spec/hud_shield_specso F5 keeps tuning them.
HUD B chosen + refined:
- Owner picked B (closest to RoR2; supplied a RoR2 screenshot). Refined the left cluster: HP = the chunky centered value bar (the one A/D use); shield = a thin 4px white sliver capping it (size hierarchy, not two equal bars). Boots into B by default (
hud_layout = 2).
Icon investigation:
- Checked Invoker for ability icons; found they are 40×60 PORTRAIT, not square: ~108/111 in
Invoker-old/reference/SNKRX/assets/imagesare SNKRX rune-glyphs (white monochrome line-art). Because they're centered glyphs (not edge-to-edge card art), they drop into SQUARE slots cleanly — the slot-shape decision dissolved.
Real icons wired:
- Alpha-trimmed 4 icons into
assets/(ceremonial_dagger→cleave, heavy_impact→leap, haste→surge, assassination→blade) asic_*.png. - Toolkit add:
ui_item_icongained animageopt (centered + scaled-to-fit + tinted vialayer_image's color arg);ui_slotforwardsicon.image. Reverse-sync candidate for snkrx-template / SNKRX-update. - Engine image API confirmed:
image_load(name, path)→ img{.handle/.width/.height};layer_image(lyr, img, x, y, color, flash)draws CENTERED, no scale arg (scale vialayer_push/pop). - Removed the M1/M2/SP/R keycaps from the slots.
Slot style exploration → FILLED:
- Built an F7 cycler with 6 slot styles (default / circular / brackets
[ ]/ hollow outline / bare underline / filled). Owner chose FILLED (accent-colored slot, dark glyph). Stripped the cycler + other 5 styles;hud_slotis filled-only.
Per-ability bg+icon specs, then the negate→darken correction:
- Made the filled slot's bg + icon each draw through a per-ability four-axis spec, registered with the F5 spec lab. The icon recolors as a MASK through the shader — confirmed by reading
draw_shader.frag(the image path applies the color recipe using the glyph's alpha as coverage), which resolved an earlier open risk. - Owner asked for the icon as the bg "negated." Built a
u_invertshader modifier (1−col). Owner corrected: NEGATE is wrong — follow SNKRX-update's side-icon principle = the base color DARKENED a shade. Studiedunits.lua:glyph_spec= body spec +value = 0.78(unit_glyph_value, ≈ SNKRX [-5] shade). Revertedu_invertentirely (thevalue/u_value_multmodifier already existed). Icon = bg spec + value 0.78 (SLOT_ICON_VALUE) — the SNKRX glyph-ink idiom.
Per-ability spec registry, generalized then collapsed:
- Made each ability's spec the single source of its color — driving its HUD slot AND its in-game visuals. Global
ability_specs[character][ability]in main.lua;player:ability_spec(name)helper (falls back to the body spec). Gameplay wired: Cleave square, Leap AoE/telegraph/wake (self.wake_spec), Surge trail + SURGE word, Blade Dance per-landing bursts — each pullsself:ability_spec(). Body keepsswordsman_spec. - Owner then decided every Swordsman ability should use the ONE SNKRX-update Swordsman spec (no per-ability divergence yet). Verified 062026
swordsman_specis byte-identical to SNKRX-updateunits.luaswordsmanspec. Emptiedability_specs = {}→ everything falls back toswordsman_spec; removed the per-ability spec-lab targets. The general mechanism stays wired for the future stat-based recolor (each ability colored by the stat it scales off).
Slot polish (final pass):
- Charges: moved from inside the slot (top-right pips) to ABOVE the slot, centered, in the ability's color (
spec_color, the swordsman yellow), 4px pips. - Surge duration: a thin 2px top bar draining to the LEFT (
(p.buffs.surge.expires_at - time)/duration), replacing the white active-outline. - Cooldown: reworked from the translucent dark bottom-up rect (owner: "doesn't feel coherent with how the UI works") to a brightness recharge — the not-ready top fraction is the bg+icon redrawn a shade darker (
COOLDOWN_VALUE = 0.4× value, the same value/shade-darker idiom as the glyph ink), brightness filling up from the bottom as it readies, with the countdown number centered. Implemented via two stencil passes (dark bg clipped to the slot's rounded shape, dark icon clipped to the top rect). - HP/shield track editable (the fill already was): added a
track_specopt toui_bar+ui_hud_bar(toolkit, sync candidate); new F5 targetshud_hp_track/hud_shield_track(seeded to charcoal = no visible change until edited).
Files touched: hud.lua (new), main.lua (ability_specs registry, F6 bind, HUD wiring, HP/shield track specs), snkrx/player.lua (ability_spec helper + gameplay spec wiring), snkrx/ui/widgets.lua (ui_slot image, ui_bar/ui_hud_bar track_spec), snkrx/ui/primitives.lua (ui_item_icon image), snkrx/effect.lua + assets/draw_shader.frag (u_invert added then reverted), assets/ic_*.png (4 trimmed icons).
Tunables: SLOT_ICON_VALUE=0.78, COOLDOWN_VALUE=0.4, duration bar 2px, charge pip 4px, SLOT=24 / ULT=30 / SGAP=4 / RES_H=11.
Next session: continue improving the ability HUD UI.
🔒 Only the summary of this log is public. Private because this is 062026.