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.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: 654 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.
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.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.