WIP: fix(prompts): draw every System guide from the face's parts #1623
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1623
Loading…
Reference in a new issue
No description provided.
Delete branch "gab9281/Longshot:fix/system-guide-lines"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type: fix · Risk: low · Tested on: Linux, AMD Radeon 680M (RADV), 1280x720
Issue: #1211
TL;DR: The System page's controller lines were built from fixed Pro Controller rows and only two of the game's five guide textures. This makes every line come from the active face's parts, builds one line per slot and per bindable input, and gives the keyboard face its own bindings panel. The Switch face keeps the game's images byte-identical.
Why
nx2/prompt_assets.pybuilt guide textures 00 and 01 only. Guide 02 (ZR), 03 (the d-pad frame and line) and 04 (L/R) were the game's own Pro Controller art, so on another face the frame could land on the left stick and the shoulder dots were shared or off the controller. Six rows had per-binding images; the other four slots and every rebind of them did not.What changed
GUIDEScovers all fiveControllerGuide_Pro_00..04textures.GUIDE_PAGESis a generic table:(texture, bar, row, Switch button, group)for every System slot.guide_page_linesmakes a line for every slot × pad input, grouped where the input is in a group.prompts/<face>/guide.binholds them.host/prompts.cpicks the line of the currently bound input and writes it intoCommon.bntxafter the base runs (renumbered write indices: each file numbers runs from 0, so without this the base textures were written over the new lines). This covers ZR, L, R, the d-pad and all rebinding, and follows live face/control changes.prompts/<face>/groups.bin, selected by the current binding mask).PAGE_LAYOUTSis a generic page-variant table. The keyboard face's System page moves the controller picture, shadows and guide panes off the page and places the action labels in two columns, with the bound key/mouse icons the keyboard font already shows.prompts/keyboard/page.binholds the pane runs; the browser applies the file of the active face. Adding another page is another table row, with no new runtime code.Screenshots
Before/after on the same save, face and spot, and the keyboard panel: see the next comment.
How to reproduce
Build this branch. Set
button_prompts=4(PlayStation 5), load a save, open the pause menu's System page: the d-pad frame is around the d-pad and every line ends on its control. Setbutton_prompts=6(Keyboard) and open the same page: the controller is gone and the page is a two-column list of actions with their bound key/mouse icons.Testing
Tested: Linux (CachyOS), Radeon 680M / Mesa RADV, 1280x720,
HOS_HEADLESS=1, through the job queue (--mode shared). PlayStation 5 before:prompts: ps5 textures, 1914 runs; after:3272 runs; keyboard:prompts: keyboard textures, 1872 runs. The System page screenshots show the corrected d-pad frame and the keyboard panel; no prompt errors. Game-free:tests/test_prompt_system_guides.pyfails on main and passes here; all prompt checks pass, including the new run-selector C test.python -I -B tests/run_all.py: 656 passed, 34 failed, 96 skipped; no prompt check fails (the unrelated failures vary between runs on main too).Open: labels still use the game's slots, so a crossing can remain on a face whose physical order differs; that is the next step of the design doc. Art for the other faces is separate. The F1 control-rebind page also needs a per-row "reset to default" button (planned in the design doc).
Not tested: a control rebound on the System page in-game (the run selector is covered by the C test); other faces, languages and 4K/ultrawide in-game; live face switching to/from keyboard in-game.
Must be tested: a rebound control and a live face change on Linux/Windows after review.
Risks
What could break: build-time guide images/layout patches only; a wrong part puts a line beside its control, and a wrong pane puts a label in the wrong place. The Switch face is unchanged. A hand-drawn picture with stale
partswould put lines in the wrong place, as before.Turning it off: revert the commits.
Compatibility: no saves or options changes; a rebuild regenerates the prompts. A mod's own files are never touched (the file precedence is unchanged).
Tested in game: Linux (CachyOS), Radeon 680M / Mesa RADV, 1280x720, HOS_HEADLESS=1, PlayStation 5 face, pause menu System page: before main
430eef4fthe d-pad frame is around the left stick; on this branch it is around the d-pad. prompts: ps5 textures, 2437 runs (main 1914), no prompt errors.Possibly related, for context:
System page, PlayStation 5: before and after
Same save (Kakariko Village), 1280x720, English,
button_prompts=4, pause menu → System. Left: main @430eef4f. Right: this branch @b26874ab. The crop is the controller at the same spot.On main the d-pad's frame is drawn around the left stick (the game's Pro Controller row). On this branch it is drawn around the d-pad from the PlayStation face's own parts. Both runs used the job queue (
--mode shared),HOS_HEADLESS=1andHOS_INPUT_SCRIPTto reach the page; the log line wasprompts: ps5 textures, 1914 runsbefore and2437 runsafter.What is still open (WIP): the bumper/trigger/d-pad lines are still fixed to the face's default inputs, so a rebind of those controls is not followed yet; the label side/order and the keyboard/mouse bindings panel are designed but not implemented here.
Updated screenshots (full fix)
Same save, 1280x720,
HOS_HEADLESS=1, pause menu → System. Left: main @430eef4f. Right: this branch @cbb6548f. The crop is the controller at the same spot; the frame now sits on the d-pad, and every line is selected from the face's parts by its binding.Keyboard / mouse bindings panel
button_prompts=6(Keyboard), the same page. The controller picture and its guide lines are gone; the action labels are in two columns with the keys actually bound (Z, Q, M, WASD, mouse buttons, etc.). The panel is data-driven (PAGE_LAYOUTS→prompts/keyboard/page.bin), so a different page or face can be added without runtime code changes.The runs logged: main
ps5 textures, 1914 runs; this branchps5 textures, 3272 runs; keyboard1872 runs. All runs were throughscripts/job_queue.py --mode shared.4576b8e1580de72e14bbAggressive rebinding, all five controllers
These are the build's line-target heatmaps, rendered from the same data the game receives: the controller picture with the invisible button map (one colour per pad input) and every System label's line drawn in the colour of the input it is bound to. Three cases for each face:
PS5 on its own, larger:
The Switch face keeps the game's original guide images (byte-identical prompts), so its lines do not move with a rebind of the four fixed slots; the other four faces use
guide.binand do. In the split/converge columns you can see lines crossing and inputs being shared — the router avoids other lines where it can, but when ten labels target one input the overlap near that input is unavoidable.tests/test_prompt_rebinding_harsh.pychecks all ten slots against representative pad inputs on every face and measures the overlap away from the target;tests/test_prompt_guide_runs.pychecks the runtime selection in C.The keyboard panel's wide key icons have also been moved clear of their label text (using the per-pane
dxinPAGE_LAYOUTS), so each row shows a box with its key icon and binding rather than the icon drawn over the words.Button positioning for every face (invisible map over the picture)
These show each face's controller picture with the invisible button map drawn on top: one coloured disc per pad input at the position the guide router uses, plus the keep-out boxes (touchpad, screen, mute). The discs are drawn with the face's
parts()radii, so this is the exact geometry the lines target.Individual faces, full resolution:
The shoulders/triggers have a radius of 0 in
parts()(they are edges, not discs), so they appear as the smallltr1/rtr1/lsho/rsholabels at the top of the picture, not as discs. A line for a button or a stick is routed to the edge of its part (2 px inside, as the game's own lines do), and a stick's line goes to its centre — so a line ending just outside a coloured disc is expected, not a misalignment. Please point at any disc that sits off its control and I'll correct that face'sparts().Clearer L1 / L2 / L3 equivalents
Updated button maps: the bumpers and triggers are now diamonds with leaders and large labels, and the sticks carry L3 / R3 click labels. The legend at the top reads
L1 = bumper, L2 = trigger, L3 = stick click (R1/R2/R3 on the right). This is the same invisible map data the line router uses, drawn over each face's picture — no game texture is changed.The coloured leader line points to the exact edge coordinate in
parts()that the L1/L2 guide lines end on; the coloured disc for L3 is the stick's centre, where its line ends.Why the wild rebinds showed a line on the "wrong" button
The d-pad and face-button groups have one guide line for several labels, but the game picks that line by the Switch button of the label it is showing. The build had emitted it under only one assumed member (
leftfor the d-pad,afor the face buttons). When a different member was rebound, the label's icon changed with its own binding while the line stayed the one for the assumed member — hence the disagreement in the aggressive screenshots.Fixed in
f4cc58b0: a group's line is now emitted under every member's Switch button (U/D/L/R and A/B/X/Y), so whichever member the game uses to select the line, the run matches that member's binding.guides.binnow has 17 pad-input lines for all 16 Switch buttons on every drawn face; the game-free checks pass.Remaining limitation: a group has one line, so if several of its members are rebound to different inputs at once, only one of those targets can be shown. Proper per-label lines would need extra line panes in
PaSystemController_00; that is layout work beyond this fix.Dynamic group boxes are implemented
The "boxes instead of lines" idea from the design doc now runs in the game:
da0db029builds a box for every subset of two or more members of the d-pad, face-button and L1/L2 / R1/R2 groups, stored inprompts/<face>/groups.binkeyed by the member mask. The browser computes the mask from the current bindings and writes that subset's box, blanking the individual leader lines it replaces (and the second label row for the shoulders). A group with only one member bound keeps its own line.PlayStation 5, default bindings, System page:
The d-pad frame is around the d-pad, the face frame around the symbols, and the two shoulders on each side share a small box instead of two lines. Logs:
prompts: ps5 textures, 6053 runs(up from 4323, the added group-box runs).tests/test_prompt_group_runs.pycompiles the real mask selector: no box when neither or only one member is bound, the subset's runs when two are. Building another group is a row inGUIDE_DYNAMIC_GROUPS; no runtime code changes.Dynamic group boxes are implemented
The "boxes instead of lines" idea from the design doc now runs in the game:
da0db029builds a box for every subset of two or more members of the d-pad, face-button and L1/L2 / R1/R2 groups, stored inprompts/<face>/groups.binkeyed by the member mask. The browser computes the mask from the current bindings and writes that subset's box, blanking the individual leader lines it replaces (and the second label row for the shoulders). A group with only one member bound keeps its own line.PlayStation 5, default bindings, System page:
The d-pad frame is around the d-pad, the face frame around the symbols, and the two shoulders on each side share a small box instead of two lines. Logs:
prompts: ps5 textures, 6053 runs(up from 4323, the added group-box runs).tests/test_prompt_group_runs.pycompiles the real mask selector: no box when neither or only one member is bound, the subset's runs when two are. Building another group is a row inGUIDE_DYNAMIC_GROUPS; no runtime code changes.Shoulder pair: one box, two lines
This is the shape you described: the R2/R1 (and L2/L1) labels are enclosed by one bracket, and one line leaves that bracket for each control — one to the trigger, one to the bumper. No two separate input boxes. Xbox,
button_prompts=2, System page:Full page:
The bracket is drawn in the guide texture at the label bar, so the game's own label text and icons stay on top of it. When only one of the pair is bound to its group input, no bracket is written and that input keeps its own single line in
guide.bin.Superseded by #1700, which draws the System guide lines at run time (the issue asks for dynamic lines, not baked textures). This branch stays as a reference for what was tried: per-face parts for all five guide textures, per-binding baked runs, group boxes by member mask, the keyboard bindings panel, and (last commit
bcafa6f5) the shoulder pair with one line from the label bracket to one control box.Pull request closed