Skip to content

Latest commit

 

History

History
65 lines (42 loc) · 5.13 KB

File metadata and controls

65 lines (42 loc) · 5.13 KB

Prompt: Cyberpunk HUD v3 — Vector Recipes + Animated Tactical UI

Project location

Standalone Godot 4.6 project at /Users/davidsarno/Documents/cyberpunk-hud-demo/. v1 (hud_v1.tscn) and v2 (hud_v2.tscn) are preserved untouched. v3 lives in hud_v3.tscn. Flip between versions via the hud_version dropdown on the HudLoader node in main.tscn.

Branch: polish/v2-terminal.

Context

v2 got the HUD to a dense terminal aesthetic but hit a tooling ceiling: decorations were stacks of dozens of ColorRects (32 bracket rects, 18 barcode rects, 25 QR cells). The new control_draw_recipe MCP tool (godot-ai plugin v1.1.0+) lets a single Control replay a list of vector draw ops (line/rect/arc/circle/polyline/polygon/string) via a generated _draw() override. v3 uses it to (a) land the same v2 pixels with ~70 fewer nodes, then (b) add animated tactical-UI elements that were impractical before.

Design direction

Goal: replace static ColorRect patterns with crisp vector recipes, then layer in motion. Everything still via MCP tools, still no art assets, still no custom fonts.

Phase A — Rebuild v2 decorations via control_draw_recipe

Swap static node stacks for single-node recipes. Success metric: visual parity with v2 and ≥60 fewer nodes in the scene tree.

  • Corner brackets (Vitals, Minimap, Log, Ammo): each overlay's 8 ColorRects → one Control with 8 draw_line ops forming four L-shapes. Colors match v2 (cyan/cyan/green/orange).
  • Barcode strip (under vitals header): 18 ColorRects in an HBox → one Control with 18 draw_rect ops at varying widths and alphas.
  • QR block (pause menu): 5×5 GridContainer of ColorRects → one Control with 25 draw_rect ops at fixed cell positions.

Phase B — New decorations unlocked by _draw()

These weren't feasible in v2 because every frame would mean dozens of node property updates; with a _draw() recipe driven by an @export-style value, one redraw per frame covers the whole element.

  • Radar sweep on the minimap: rotating fan arc (draw_arc) with a fading alpha trail (3-4 arcs at decreasing alpha stepping back in angle from the sweep head). Drives via a cursor angle updated in _process().
  • Circular cooldown gauges on the ability icons: a draw_arc ring around each IconWrapN whose end_angle is driven by the ability's cooldown progress (0% → 100% as cooldown elapses). Tints match the ability accent color.
  • Crosshair + range ticks at screen center: short draw_line segments forming a plus sign with tick marks at 10/50/100 meter range labels (draw_string). Fades out during pause.
  • Waveform trace in the system-log corner: a draw_polyline with 40-60 points driven by a low-frequency sine + noise — approximates an audio/comms waveform. Scrolls leftward each frame.
  • Scanline overlay: a full-rect TextureRect with a GradientTexture2D tiled vertically (or a minimal shader), ~15% alpha, sitting between ThemeRoot and PauseOverlay in the scene tree. Gives a CRT feel without per-frame work.

Phase C — Motion passes on existing elements

  • Low-health bracket shift: when HP < 30%, pulse the VitalsBrackets color from cyan → red via a simple recipe-color animation (new property on the recipe-emitted script).
  • Ammo counter dial: wrap AmmoCount with a circular draw_arc ring that drains as ammo decreases.
  • Cursor trail in log feed: replace the static >_ with a short trailing cursor drawn via recipe ops (underscore that sweeps left-right across a 4-char window).

Constraints

  • All edits via MCP tools — control_draw_recipe, node_create, node_set_property, scene_save, etc. No hand-authored .tscn/.tres.
  • hud_v1.tscn and hud_v2.tscn must not be modified — they're the reference baselines.
  • Preserve script-level behavior: cyberpunk_hud.gd signals, animations, input wiring all still work against hud_v3's nodes.
  • If control_draw_recipe can't express an op we need (e.g. rotation of the radar fan), fall back to a thin wrapper GDScript via script_create + script_attach — and log it as a v3-friction entry.

Files

  • docs/prompt-hud-v3.md — this file.
  • hud_v3.tscn — new scene, starts as a copy of hud_v2.tscn (so functional parts keep working during incremental refactor).
  • hud_loader.gd — extend @export_enum to include "v3".
  • cyberpunk_hud.gd — may grow new helpers for motion-driving (cooldown → gauge angle, sine-wave generator for waveform). Shared with v2's node paths where possible.

Verification

Per phase:

  • project_run + visual spot-check, comparing against v2 via the dropdown.
  • scene_get_hierarchy --depth 10 on v2 vs v3 — node count should drop by ~60 after Phase A, grow modestly in Phase B.
  • animation_validate on every AnimationPlayer clip after node moves.
  • For motion elements, let the game run long enough to see one full cycle (radar sweep ~4s, cooldown up to 12s, pulse loops).

Friction log

New issues during v3 work go into the existing docs/friction-log-cyberpunk-hud.md under a ## 2026-04-19 v3 recipe pass heading. Especially any limitations of control_draw_recipe found in practice — those feed the plugin's backlog.