feat(texts): the ocarina microphone hint says your microphone, not the console's #604
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/upscaling
beanstalk: approved @ 1697603
beanstalk: approved @ 2c5a62e
beanstalk: approved @ 4fd82b7
beanstalk: approved @ 64d6d09
beanstalk: approved @ 6f91fae
beanstalk: approved @ 70a78f9
beanstalk: approved @ 8d361dc
beanstalk: approved @ 9d8356e
beanstalk: approved @ abf2227
beanstalk: approved @ d82f202
beanstalk: approved @ e5f1e40
beanstalk: approved @ ee8ab5f
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
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
testing wanted
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!604
Loading…
Reference in a new issue
No description provided.
Delete branch "lg/Longshot:feat/pc-wording-texts"
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: feat · Risk: low · Tested on: Windows 11, RTX 4090 (621.24) · Needs: Linux; native speakers for the wordings
Why
The hint for playing the ocarina by microphone tells the player to use the console's built-in microphone. A PC has no
such thing: the game listens to the microphone chosen in the menu (Gameplay, Microphone). It is the same kind of
leftover as the console's button icons were in the texts, which the button prompts already replace with the player's
own controller's.
No issue asks for this (tracker searched: "microphone", "wording", "text", "console name").
What changed
The build now rewords that one hint in the player's own text files, in all 16 of the game's languages, and the game
reads the reworded files. It follows the button prompts: made at build time from the player's files, served at run
time, and a mod's own file wins.
nx2/text_assets.py(new).reword()edits the string in its own room and pads it with NULs, so no MSBT orSARC offset moves and the archive keeps its size (the resource size table goes by it).
STRINGSnames the string byits MSBT and label, and each wording by a fingerprint with the bytes to replace: no game text is in the file. Only
the words for the console's microphone change; the rest of the sentence, the menu's icon and the reading aids stay
the game's. A text that is not a known wording (another game version) is left as it is.
nx2/make_game.pyruns itin the finish stage (0.25 s for 16 languages).
--showprints the result from your own files, to check a wording.host/texts.c(new).hos_texts_romfs()serves the game folder'stexts/<archive>forMals/<archive>.host/mods.casks it only when no mod and no prompt has the path.tests/test_text_assets.py(new), on an authored SARC and MSBT.tests/test_mods_size_table.pycompilestexts.cwithmods.cand checks three cases over real folders: ours served, a mod's own first,HOS_TEXTS=0.HOS_TEXTSindocs/development.md,host/game_layout.c's note.Measurements
Verdict: it works in the game: the hint reads "Use your microphone ..." with this PR and names the console on main, from
the same save and spot. Both held the 60 fps cap there (one run each, so not a performance comparison; the change only
serves a different file when the game opens its texts).
The run in the game and the screenshots were made with this change on main
7494ce4, built both ways from that commit.The branch was rebased twice since (onto
a0dac82, then40aec7c) with no conflicts and no change to its own code, so theywere not retaken. The full suite was run on
a0dac82; after the last rebase the change's two tests were run again.Hardware: Windows 11, RTX 4090 24 GB, driver 621.24, Core i9-10900K, 32 GB
Scene: the village, by the gate guard, daytime; 3840x2160, DLAA, DLSS Frame Generation 2x, 60 fps cap, HDR off, English (US)
Method: one run each; the hint read on screen and in a screenshot, the served file from
longshot_log.txt, the frame rate from the log's last threevi:lines. No median: it is not a performance comparisonHow to reproduce: load a save where Link has the ocarina, press the ocarina button (D-pad left), read the hint;
HOS_TEXTS=0inlongshot_env.txtshows the game's own again40aec7c77d3b46tests/test_text_assets.pytests/test_mods_size_table.pyFlags and settings
One new switch.
HOS_TEXTS=0=0: in the Linux test onlyTesting
Tested:
tests/test_text_assets.py(5 tests),tests/test_mods_size_table.py(13 cases,host/texts.ccompiled with gcc and run over real folders) and
python -I -B tests/run_all.py: 495 passed, 13 failed, 71 skipped.main
a0dac82on that PC: 494 passed and the same 13 failed (test_appimage_player_build,test_bake_portability,test_cpm_discovery,test_crash_dialog,test_env_on,test_lift_cache,test_lift_cleanup_error,test_linux_preflight,test_make_game_cache,test_readback_late,test_vk_pgo,test_vram_budget_row,test_walk_key).RX_TARGET=windows, llvm-mingw 20261104):host/texts.ccompiles and the finishstage made all 16 files in
texts/.7494ce4and this PR builtfrom the same commit, the same save loaded in each (Kakariko, by the gate guard), the ocarina button pressed. main shows
the console's wording; this PR shows "Use your microphone to perform ocarina music via mic input. ..." with the menu
icon in place. The log names the served file. Screenshots below.
Not tested:
HOS_TEXTS=0(the last two are covered by the Linux testof
host/texts.conly).Must be tested:
Mals/USen.Product.110.sarc.zsinmods, and separately setHOS_TEXTS=0, expecting the mod's text in the first case and the game's own hint in the second (request to open)texts:line in the log (request to open)python -I nx2/text_assets.py --romfson your own romfs folder with--showand read your language's line, expecting a natural sentence that no longer names the console (request to open)Screenshots
Before: main @
7494ce4· After: this PR on7494ce4(see Measurements). The same save, the same spot, 3840x2160. Attached in the first comment.Risks
What could break: a text archive the game cannot read would leave its texts missing. Each archive has the game's
own size and layout, and only the hint's bytes differ.
Turning it off:
HOS_TEXTS=0, or delete the game folder'stexts.Compatibility: an update makes
texts/again. Saves, the options file and the caches are not touched. A mod withits own text file is not affected: its file wins.
Checklist
Everyone
type(scope): description) of the status line's type.main. (main @40aec7c)python -I -B tests/run_all.pypasses (any failure that also fails onmainis named).third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.mainand passing here.tests/that reads changed source updated in this PR, not weakened.host/texts.candhost/mods.c, the host code this PR adds or changes, compiled with gcc againsthost/posixand run bytests/test_mods_size_table.py; a whole Linux game build is under Must be tested.)🤖 Generated with Claude Code
Screenshots, 3840x2160, the same save and spot (a guard by the gate in the village, the ocarina button pressed), English (US). First: main @
7494ce4. Second: this PR's change on7494ce4. They were made before the rebases ontoa0dac82and40aec7c, which did not change the PR's own code.WIP: feat(texts): the ocarina microphone hint says your microphone, not the console'sto feat(texts): the ocarina microphone hint says your microphone, not the console'sView 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.