fix(voice): a Voice Language saved in option.sav is applied after a restart #970
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!970
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:fix/voice-language-option-sav"
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, RTX 3090 · Needs: Windows, any GPU
Why
A player picks Japanese as the game's Voice Language, and after a restart the voices are English again, while the game's
own Options screen still shows Japanese. Three players reported it in #430 (the sage's cutscene after Bongo Bongo,
Darunia after the Fire Temple, Navi at Lord Jabu-Jabu). It looks random because a change made on the Options screen
does work for the rest of that session; it is lost at the next start.
Fixes #430. See #125 (the other direction, Japanese voices under Portuguese text): the same option and the same code,
but this PR does not claim to explain that report.
How to reproduce
Seen on: Linux, RTX 3090,
v3.0.0-rc.4(source 1d7adfa3)Settings and switches: defaults,
language.txten-USSteps: set the game's Voice Language to Japanese (the title's Options), quit, start again, Continue, and play a
voiced scene (the Great Deku Tree's first words, from the
kokiri-startrepo save).Expected: Japanese voices.
Actual: English voices. With
HOS_FS_TRACE=1the scene opensUSen_EventFlowMsg-_Dm_Kokiri_0150--*.bwavwhileOptionData.VoiceLanguagereadsJapanese(#69b014ce) the whole session.What changed
The game applies the voice language in two places only: at its voice resource's first update (the text language's
default), and afterwards when GameDataMgr lists
OptionData.VoiceLanguageamong the flags written since its last pass.option.savis read a moment after that first update, and its value replaces the option without being listed. This PRroutes that one "was it written?" question through the host, which also answers yes when the option's value is not the
one it had at the update before, so the game's own branch reads the option and applies it.
hos_oot_voice_option()in the newhost/oot_voice.ccalls the game'sf_80a9d1c0, keeps its answer, andadds a yes when the option's value changed without a write. It logs
voice: the Voice Language option changed without a write ...: applied(at most 8 times).patch_voice_option()innx2/oot_patches.pyedits the update's (f_80a9ca30) one call off_80a9d1c0, byits return address, on the supported build only;
report()warns when the place is not found once.HOS_VOICE_OPTION_FOLLOW=0indocs/development.md.tests/test_oot_voice_option.py.How the cause was found, on
v3.0.0-rc.4: with the control bridge's memory reads, the option wasEnglishat frame 4with
USenin the voice manager, the saved value from frame 70 on, andUSenstill applied; the disassembly off_80a9ca30,f_80a9d1c0andf_809d48c0shows the two places above.Measurements
Verdict: it passes: with Japanese saved in
option.sav, the scene's voices are English with the hook off andJapanese with it on, on the same build, save and settings. One run each. The bug depends on timing: with the base's
default settings the game applied the saved value by itself (Japanese with the hook on or off); with the installed
v3.0.0-rc.4folder'slongshot_options.ini(frame rate cap, frame pacing, fullscreen, DLSS preset among itsdifferences) it never did.
Hardware: Linux, RTX 3090
Scene: Kokiri Forest, the Great Deku Tree's first scene, headless through the control bridge
Method:
HOS_FS_TRACE=1, the voice files the scene opens;OptionData.VoiceLanguageread throughwatch --events oot --flagsHow to reproduce:
longshot_ctl.py launch <game> --save <kokiri-start's slot with an option.sav holding Japanese> --headless --env HOS_FS_TRACE=1, Continue, teleport to Hyrule Field and back to Kokiri Forest, walk forwardHOS_VOICE_OPTION_FOLLOW=0: this PR @9d3af7499d3af749USen_*(wrong; 3 starts of 3)USen_*(wrong)JPja_*JPja_*JPja_*USen_*The After columns are a
dev_packs.pypack of this branch's tree on the basemain@a00c485c(the build saysv3.0.0-rc.4-108-ga8a30c22-dirty: the tree before its two commits were made, the same files).After, the rc.4 folder's settings:
Baseline: the first column is the installed
v3.0.0-rc.4, notmain; the switch's column ismain's behaviour on thesame build as the fix.
Flags and settings
One new switch, for A/B.
HOS_VOICE_OPTION_FOLLOW=0option.savcan stay unappliedTesting
Tested:
v3.0.0-rc.4, and the fix with the hook off and on (above).patch_voice_option()on a real lift'scode_009.c: one edit, one declaration, a second run changes nothing; and thepack build's lift printed
oot_patches: the Voice Language option followed after option.sav is read in code_009.c.Not tested:
tests/test_oot_voice_option.pyandtests/run_all.py: not run on this PC; left to CI.option.savread before the voice resource's first update (not seen here): the game then writes the default over thesaved value itself, which this PR does not change.
Must be tested:
scene, expecting Japanese voices (by hand: one of #430's reporters, or anyone who sees the bug on
main).Risks
What could break: the voices' language, if the option's value changed for a reason the game does not want applied;
none is known. The hook runs once per update of the voice resource and reads four values.
Turning it off:
HOS_VOICE_OPTION_FOLLOW=0, or revert the commit.Compatibility: the game's code is edited, so the lift's translation is redone on update. Saves and settings are not
changed; a player whose
option.savholds a Voice Language other than their text language's default now hears it.Issues
Fixes #430
See #125
Checklist
Everyone
type(scope): description) of the status line's type.main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named). Not run on this PC: left to CI.third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.mainand passing here. Added; not run either way on this PC.🤖 Generated with Claude Code
Tested in game: RTX 3090, Linux (headless, control bridge): Japanese saved in option.sav, Continue, the Great Deku Tree's first scene in Kokiri Forest. With the installed rc.4 folder's settings it opens USen_* voice files with HOS_VOICE_OPTION_FOLLOW=0 (the bug, as on v3.0.0-rc.4) and JPja_* with the fix, which logs 'voice: the Voice Language option changed without a write (0x69b014ce, was 0x82591fa9: option.sav was read): applied'. One run each.
Measurements: the After columns name the pushed commit (
9d3af749, which only adds a code comment over the tree that ran). The numbers box is removed: the result is which voice files open, not a number.WIP: fix(voice): a Voice Language saved in option.sav is applied after a restartto fix(voice): a Voice Language saved in option.sav is applied after a restart