fix(prompts): show keyboard keys on the ocarina song sheet #2450
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
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
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2450
Loading…
Reference in a new issue
No description provided.
Delete branch "huntet123/Longshot:fix/ocarina-keyboard-prompts"
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?
Summary
Set Button prompts to Keyboard and play the ocarina with the Skull Kids in the Lost Woods. On main, the “Play a note” hint shows keyboard bindings while the notes on the song sheet still show controller icons.
Generate keyboard note textures from the same glyphs used by the text prompts. The Rust builder generates and caches them in
builder/crates/build-assets/src/prompts/. The runtime selects a texture inhost/prompts.cusing the first keyboard binding of the corresponding Switch button.Testing
Tested: Rebased source now at
1f26b82don Windows, GeForce RTX 3080, NVIDIA driver 621.40. Played the ocarina with the Skull Kids in the Lost Woods using a keyboard and confirmed the correct keys on the song sheet. The Windows build with the new Rust builder and all 70build-assetstests passed.The two current commits are
21183e4d(regression test) and1f26b82d(fix). The author and committer metadata was rewritten after testing. Both source trees and commit messages were verified identical, so the Windows play test and measurements apply to the current code.The following broader checks and full Linux build were run before the latest rebase, against main
22d0d200.The new Rust builder built the Windows base and pack. All 69
build-assetstests passed. The targeted Windows checks reported 10 passed, one failingtest_dev_build.pyalso reproduced on main, and two Linux-only skips. Both skipped prompt tests passed in Ubuntu 24.04 Docker, where Clang also compiled the changed host file on both revisions.The generated Switch, Xbox, PS4, PS5 and Steam Deck texture bundles matched the current main build byte for byte.
The full strict Windows suite reported 761 passed, 80 failed and 47 skipped on each revision. The same 80 checks failed on main and on the rebased branch.
Checks failing on both revisions
Full Linux build passed on the previous Rust-builder rebase in Ubuntu 24.04 Docker with the new Rust builder and the pinned Linux toolchain. The pack built against main
22d0d200, linked bothlongshotandlongshot_vk.so, and produced a runtime with 660 keyboard texture entries. This was a build check.Still to test:
Measurements
Verdict: Fresh and cached prompt-stage timings overlap across the four runs on each revision. The fix adds a 6,119,528-byte (5.84 MiB) keyboard texture bundle and retains 3,677,472 bytes (3.51 MiB) more than main when the live loader selects Keyboard.
Setup: Windows, AMD Ryzen 9 5900X, Rust 1.99.1 release builds of
build-assets --example assets, six prompt workers, same local ROMFS and drive. The job queue ran the measurement intiming-cpumode. One warm-up per revision primed the system file cache. Four measured pairs alternated order. Each fresh run used a new output directory and an empty builder prompt cache. The warm run reused that directory immediately. Timings are wall-clock prompt-stage invocations including process startup and file I/O. Rust compilation and tool installation were outside the timer.28cb22b91f26b82dAll shared prompt output files matched byte for byte. The only new prompt output was
keyboard/textures.bin. The fresh and warm log summaries confirmed which assets were generated and which were reused.The Windows heap check compiled
texture_face,texture_binandread_allfrom each revision and called them on its generated bundles. It used the Windows CRT's_msizeto measure the allocated buffers and confirmed that repeat lookups reuse the same buffer. These figures cover the loader's retained heap allocation. Total game RSS and GPU memory were outside the measurement.The Rust regression test failed on the original Rust-builder base without the fix and passes on the current head.
The original screenshots show the same Lost Woods encounter before and after. The keyboard result was reproduced after the latest rebase.
Risks
The keyboard textures are generated during the build. Older builds without the keyboard texture bundle fall back to the original note icons. The song sheet follows the regular button bindings. Dedicated Ocarina Note overrides are outside the scope of this change. Reverting the patch restores the previous texture selection.
Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.mainand here, for a change that shows on screen.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.Tested in game: Windows, GeForce RTX 3080, NVIDIA driver 621.24. Played the ocarina with the Skull Kids in the Lost Woods using a keyboard. The song sheet showed the correct keyboard symbols for the notes.
Possibly related, for context:
The option was set to Keyboard in both runs of the Skull Kids' ocarina minigame in the Lost Woods.
Before (main
8aa5ab87) — controller icons on the song sheet.After (fix
43591cd4) — keyboard icons on the song sheet.WIP: fix(prompts): show keyboard keys on the ocarina song sheetto fix(prompts): show keyboard keys on the ocarina song sheetNeeds rebase onto new builder!
43591cd411814230ca5eRebased onto main
22d0d200and ported keyboard note texture generation and the regression test to the Rust builder. The updated head is814230ca.Retested in game on Windows with a GeForce RTX 3080 and NVIDIA driver 621.40. Playing the ocarina with the Skull Kids in the Lost Woods displayed the correct keyboard symbols on the song sheet. The Windows pack built, and the Rust regression and targeted Linux prompt checks passed. All five generated controller texture bundles matched main byte for byte. The Xbox controller still needs an in-game pass on the rebased build.
Full Linux build passed for
814230cain Ubuntu 24.04 Docker with the new Rust builder and the pinned Linux toolchain. The pack built against main22d0d200, linked bothlongshotandlongshot_vk.so, and produced a runtime with 660 keyboard texture entries. This was a build check.Recommendation: Request changes. The exact-head Windows run shows that the song sheet now displays the regular keyboard bindings. Measure the build and memory cost of the new texture bundle before merging.
Blocking —
builder/crates/build-assets/src/prompts/textures.rs:168. These layers encode each whole 93×93 ASTC note texture for each supported key. The 660 entries reported in Testing imply about 5.8 MiB of block data before headers (660 × 24 × 24 × 16) at the reported dimensions. The default assets build generates the bundle even if the player uses a controller. The live texture loader also retains the entire bundle after it is opened. Please report actual output bytes and matched fresh/cached prompt build timings, and record the live retained size. The estimate above comes from the source and is separate from a measurement.Checked. Generation uses the same built font cmap as the text prompts, and caches the keyboard variant against that font key. The startup and live readers select the same first regular keyboard binding. Existing installations without the keyboard bundle still select the original Switch textures; the author reports all five controller texture bundles remain byte-identical. The dedicated Ocarina Note controls are the separate #297 behavior; neither the change nor the keyboard evidence covers them.
Testing. The author reproduced the Lost Woods keyboard result on exact head
814230caon Windows RTX 3080, reported 69 asset tests passed, and linked a Linux pack containing 660 keyboard texture entries. The Linux evidence is a build check. Before merge, run the documented Windows Xbox/Auto regression and applicable Tier 1 runtime checks for Keyboard and controller mode. The description check passed. Ten exact-head workflow jobs remain blocked by required conditions. CIReviewed. All four changed files and the generation, startup and live call paths at head
814230ca5ea20d5bf2e41d25a6a088e7b101dc83against actual base22d0d20098d6acaf16761ec18cc7b80059b19e46, with live target main at01d6878b; the four files did not change on main in between. No switches changed. Code review only.@ -164,2 +166,3 @@im.paste_colour(&[0, 0, 0, 255], &m.holes, ox, oy);layers.push(layer(format!("{name}.{pad_name}.png"), name, sw(s) as u8, p as u8, im));let file = if keyboard { format!("{name}.{p}.png") } else { format!("{name}.{}.png", PADS[p]) };layers.push(layer(file, name, sw(s) as u8, p as u8, im));[P2] Measure the incremental keyboard bundle bytes, clean and cached build time, and retained runtime size. The 660 full-canvas ASTC entries imply about 5.8 MiB of encoded blocks before headers. The reported entry count does not measure the build or live cost.
Thanks for flagging this. I rebased onto
28cb22b9and retested the keyboard prompts with the Skull Kids on head6801249c. The song sheet showed the correct keys.With six workers and four interleaved runs per revision on Windows, the empty-cache prompt stage had median wall times of 5.7100 s on main and 5.7712 s with the fix. The warm-cache medians were 0.5186 s and 0.5340 s. The ranges overlapped in both comparisons.
The only added prompt output was the 6,119,528-byte keyboard bundle. I compiled the live loader functions from both revisions and measured the retained Windows CRT heap buffers with
_msize. Selecting Keyboard retains 6,119,528 bytes with the fix versus 2,442,056 bytes for the Switch fallback on main, an increase of 3,677,472 bytes (3.51 MiB). Xbox alone retained 4,438,832 bytes on both builds. This measures the loader allocation. The full run ranges and cache setup are in Measurements.814230ca5e6801249cd96801249cd91f26b82d59@rebase
I rebased this pull request onto
main(46ae5b43d3): the new head is63f441413a.Conflicts resolved
Nothing was built or run: read the resolution before merging.
Automated rebase by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
1f26b82d5963f441413aRecommendation: Request changes. The Windows play test shows the keyboard song-sheet fix works, but the regression test does not cover the runtime selection that makes it work. Undoing that selection would restore the original bug while the new test still passes.
The builder generates note textures from keyboard glyphs, and the runtime selects them using the first regular keyboard binding. The added bundle costs 5.84 MiB on disk and 3.51 MiB of retained loader heap when Keyboard is selected; measured prompt-stage timings overlap.
Blocking (1): must change before merging.
host/prompts.c:366: The regression test exercises keyboard layer generation but does not exercise the runtime's choice of keyboard bindings and texture bundle. (more on the line) Do: Add a game-free runtime test that selects a keyboard binding from a keyboard texture bundle and verifies the chosen note run, including the older-build fallback.Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)
@fixcan do L1.Checks: they run again on this head; a failure shows on the pull request.
More: does it help, other systems, switches, what was read
Does it help: Yes. The author reports that the Lost Woods song sheet showed the correct keys on Windows with an RTX 3080, and supplied before-and-after screenshots. Fresh prompt-stage medians were 5.7100 s before and 5.7712 s after; warm medians were 0.5186 s and 0.5340 s, with overlapping ranges.
Other systems: The change also affects startup and live prompt switching, controller faces, Linux, and the prompt asset build and cache. The author reports byte-identical controller bundles and a Linux build, but controller-mode and Linux in-game checks remain outstanding.
Switches: None.
Reviewed:
63f441413aagainst46ae5b43d3: Read AGENTS.md, CONTRIBUTING.md, docs/dev/standards.md, the pull request template, the diff and both commit messages, all four changed files, and the relevant binding, startup, live-selection and asset-generation paths. Skimmed related prompt tests and the reported runs and reviews. docs/review-checklist.md and ../Tooling/AGENTS.md were absent. No generated files or translations changed.; nothing run (a code review).Checked and fine:
Testing: Read-only review; no code, scripts, builds or tests were run. CI has not run on this head.
Overlaps and merge order: Not checked; network access was unavailable.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its rebase. Nothing was run; a maintainer decides.
@ -362,2 +363,4 @@static int texture_face(int face) { return face == HOS_PROMPT_KEYBOARD && !keyboard_textures ? HOS_PROMPT_SWITCH : face; }static const int *texture_bind(int face, const int *bind, int *own) {if (face != HOS_PROMPT_KEYBOARD) return bind;if (keyboard_textures) return bind + HOS_SW_N;L1 (blocking): The regression test exercises keyboard layer generation but does not exercise the runtime's choice of keyboard bindings and texture bundle.
When: If this line and the keyboard texture selection are reverted, the runtime again shows Switch note icons while the new Rust test still passes, because it only calls face_layers.
Do: Add a game-free runtime test that selects a keyboard binding from a keyboard texture bundle and verifies the chosen note run, including the older-build fallback.