WIP: feat(audio): a Disable low health audio row, to turn off the beep and Link's red flash at low hearts #1293

Draft
kendowashere wants to merge 1 commit from kendowashere/Longshot:feat/heart-alert-mute into main
First-time contributor

Type: feat · Risk: low · Tested on: Windows 11, RTX 5070 Ti, DualSense · Needs: Linux, any GPU

Why

At low health the game beeps and Link flashes red about once a second until he is healed. Some players find it grating, and others want a calmer screen for immersion; there is no way to turn it off. This adds an Audio row that does. No issue on the tracker or pull request (Longshot's or Hookshot's) fits: searched for low health, beep, low hp, heart beep, hearts, health warning and alarm.

What changed

The Audio tab gets Disable low health audio: Off (the default, the game as it is) or On, which turns off the beep and Link's red flash at low hearts. The hearts' own low-health glow (the heart meter's Pinch animation) and every other sound stay.

  • The pulse: Link's update (f_804caa80) pulses at low health in the block at 0x804d24b8, reached from one branch. The block restarts a state of Link's (+0x1860: 1, its timers -1.0) and plays the sound-link trigger whose name is at 0x84b6e110, HeartAlert (the sound SE_Sys_HeartAlert, in Player.bars), with f_8045fbd0 (plays a sound-link trigger by name on the actor's sound user), then joins the update at 0x804cd120. That is the only call in the game that passes that name.
  • nx2/oot_patches.py patch_heart_alert: at the block's first line, if (hos_low_health_audio_disabled()) goto L_804cd120;, the join the block itself ends with. Skipping the whole block, and not only the sound call, also stops the red flash. The patch checks the block before it applies: the name, the call, and no other call in it. The report warns when it is not found once.
  • host/oot_heart_alert.c (new): hos_low_health_audio_disabled() reads the row (HOS_OPT_DISABLE_LOW_HEALTH_AUDIO, option id 96, which no open pull request uses), 0 without a menu. The log says low health audio: disabled, ... or ... the game's low-health pulse plays once.
  • Also changed: gpu/vk/vk_menu.cpp, vk_menu.h, vk_replay.cpp, vk_api.h (the row, its default and the host's view of it; the ini key disable_low_health_audio), gpu/vk/menu_i18n.h (the row's texts in all 13 languages), README.md (the option table and a line).

Measurements

Verdict: nothing to measure: a menu row, off by default; with it Off, the pulse's block runs as before after one option read a pulse.

Flags and settings

One new menu row (the ini key disable_low_health_audio); no switch and no build flag. The README's option table lists it.

Flag What it is Before this PR After this PR Effect Helps / doesn't help / untested Recommendation
Disable low health audio (disable_low_health_audio, id 96) Off or On none Off On: no beep and no red flash at low hearts Helps: players who want a calmer low-health screen. Untested: Linux, Steam Deck Off by default: the game as it is

Testing

Tested:

  • Game-free: tests/test_heart_alert.py (new) applies the patch to a fixture of the pulse's block (the skip first in it, joining where the block does; a second run changes nothing), refuses a block with another call or another name (InWater, the slot before HeartAlert's) and a join that is not there, and checks the row, its default, the host's option and the README row. I also applied the patch to the real lifted f_804caa80 of a build on current main: found once, together with the other patches in that file. python -I -B tests/run_all.py on this branch (cded3573) on main @ f88e6e3a: 628 passed, 43 failed, 45 skipped. A clean main @ f88e6e3a on this PC, run at the same time: 625 passed, 45 failed, 45 skipped. Every failure here also fails on main: test_auto_handheld, test_bug_report_defaults, test_cpu_report, test_crash_dialog, test_crt_options, test_damage_debug_menu, test_display_startup_failure, test_dlss_feature_size, test_failed_compile_keeps_objects, test_framegen_preset, test_fsr_uniform_ownership, test_guest_imported, test_hud_layout_row, test_import_reach, test_invalidate_vcore, test_job_queue, test_linux_preflight, test_linux_pressure, test_mirror_budget, test_missing_nup, test_pads_after_menu, test_parallel_init_order, test_pending_guest_import, test_perf_report, test_pipeline_play_cache, test_portable_builder_home, test_portable_builder_startup, test_present_thread, test_profiling_mode, test_readback_timeout_source, test_recorder_sync, test_replay_write_order, test_rumble_menu, test_run_all_changed, test_slow_frames, test_staging_burst, test_target_image_pool, test_tested_configurations, test_upscaler_round_trip, test_upscaler_rows, test_vcore_escape, test_vk_occlusion_queries, test_walk_key.
  • In the game: Windows 11 Pro, GeForce RTX 5070 Ti, a DualSense through SDL, a pack of this change on an earlier main (6c9edffe), together with my other branches. At low hearts with the row Off, the beep and Link's red flash play as before; with it On, both stop, and the hearts still glow.
  • Linux, compiler only: host/oot_heart_alert.c compiles for a Linux target (clang -fsyntax-only against the Linux sysroot and host/posix). That is not a Linux build, link or run.

Not tested: Linux and Steam Deck; a run of this exact commit on current main in the game (it was run on an earlier main; the patch's place is found once on current main's lift).

Must be tested:

  • Linux, any GPU (the Test Farm): build this branch and start the game, expecting it to build and start, and the Audio tab to show Disable low health audio, Off.
  • Any platform, by hand: Audio tab, Disable low health audio On, take Link to one heart, expecting no beep and no red flash on Link; Off, expecting both back.

Risks

What could break: the patched block is entered only at low health, and with the row Off it runs as before. With it On, the state the block would restart (+0x1860) keeps its last value; the update's code after the join treats it as it does on any frame without a pulse.

Turning it off: the row Off (the default), or revert the commit.

Compatibility: the options file gains one line. The player's next build translates the game again because the lifted function changes, as for any change to nx2/oot_patches.py. Shader and pipeline caches and MKWVK_API_VERSION are untouched (a new HOS_OPT_* number, no struct change).

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what
    can't be run by hand is in Testing's Not testable by hand, with why.
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and
    in Risks.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value.
  • Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen. (Open: the Audio tab's row, to add.)
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. (Open: built on Windows; for Linux only the host file was compile-checked, see Testing.)
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Docs updated.
**Type:** feat · **Risk:** low · **Tested on:** Windows 11, RTX 5070 Ti, DualSense · **Needs:** Linux, any GPU ## Why At low health the game beeps and Link flashes red about once a second until he is healed. Some players find it grating, and others want a calmer screen for immersion; there is no way to turn it off. This adds an Audio row that does. No issue on the tracker or pull request (Longshot's or Hookshot's) fits: searched for low health, beep, low hp, heart beep, hearts, health warning and alarm. ## What changed The Audio tab gets **Disable low health audio**: Off (the default, the game as it is) or On, which turns off the beep and Link's red flash at low hearts. The hearts' own low-health glow (the heart meter's Pinch animation) and every other sound stay. - **The pulse:** Link's update (`f_804caa80`) pulses at low health in the block at `0x804d24b8`, reached from one branch. The block restarts a state of Link's (`+0x1860`: 1, its timers -1.0) and plays the sound-link trigger whose name is at `0x84b6e110`, `HeartAlert` (the sound `SE_Sys_HeartAlert`, in `Player.bars`), with `f_8045fbd0` (plays a sound-link trigger by name on the actor's sound user), then joins the update at `0x804cd120`. That is the only call in the game that passes that name. - **`nx2/oot_patches.py` `patch_heart_alert`:** at the block's first line, `if (hos_low_health_audio_disabled()) goto L_804cd120;`, the join the block itself ends with. Skipping the whole block, and not only the sound call, also stops the red flash. The patch checks the block before it applies: the name, the call, and no other call in it. The report warns when it is not found once. - **`host/oot_heart_alert.c`** (new): `hos_low_health_audio_disabled()` reads the row (`HOS_OPT_DISABLE_LOW_HEALTH_AUDIO`, option id 96, which no open pull request uses), 0 without a menu. The log says `low health audio: disabled, ...` or `... the game's low-health pulse plays` once. - **Also changed:** `gpu/vk/vk_menu.cpp`, `vk_menu.h`, `vk_replay.cpp`, `vk_api.h` (the row, its default and the host's view of it; the ini key `disable_low_health_audio`), `gpu/vk/menu_i18n.h` (the row's texts in all 13 languages), `README.md` (the option table and a line). ## Measurements **Verdict:** nothing to measure: a menu row, off by default; with it Off, the pulse's block runs as before after one option read a pulse. ### Flags and settings One new menu row (the ini key `disable_low_health_audio`); no switch and no build flag. The README's option table lists it. | Flag | What it is | Before this PR | After this PR | Effect | Helps / doesn't help / untested | Recommendation | |---|---|---|---|---|---|---| | Disable low health audio (`disable_low_health_audio`, id 96) | Off or On | none | Off | On: no beep and no red flash at low hearts | Helps: players who want a calmer low-health screen. Untested: Linux, Steam Deck | Off by default: the game as it is | ## Testing **Tested:** - Game-free: `tests/test_heart_alert.py` (new) applies the patch to a fixture of the pulse's block (the skip first in it, joining where the block does; a second run changes nothing), refuses a block with another call or another name (`InWater`, the slot before `HeartAlert`'s) and a join that is not there, and checks the row, its default, the host's option and the README row. I also applied the patch to the real lifted `f_804caa80` of a build on current `main`: found once, together with the other patches in that file. `python -I -B tests/run_all.py` on this branch (cded3573) on `main` @ f88e6e3a: 628 passed, 43 failed, 45 skipped. A clean `main` @ f88e6e3a on this PC, run at the same time: 625 passed, 45 failed, 45 skipped. Every failure here also fails on `main`: `test_auto_handheld`, `test_bug_report_defaults`, `test_cpu_report`, `test_crash_dialog`, `test_crt_options`, `test_damage_debug_menu`, `test_display_startup_failure`, `test_dlss_feature_size`, `test_failed_compile_keeps_objects`, `test_framegen_preset`, `test_fsr_uniform_ownership`, `test_guest_imported`, `test_hud_layout_row`, `test_import_reach`, `test_invalidate_vcore`, `test_job_queue`, `test_linux_preflight`, `test_linux_pressure`, `test_mirror_budget`, `test_missing_nup`, `test_pads_after_menu`, `test_parallel_init_order`, `test_pending_guest_import`, `test_perf_report`, `test_pipeline_play_cache`, `test_portable_builder_home`, `test_portable_builder_startup`, `test_present_thread`, `test_profiling_mode`, `test_readback_timeout_source`, `test_recorder_sync`, `test_replay_write_order`, `test_rumble_menu`, `test_run_all_changed`, `test_slow_frames`, `test_staging_burst`, `test_target_image_pool`, `test_tested_configurations`, `test_upscaler_round_trip`, `test_upscaler_rows`, `test_vcore_escape`, `test_vk_occlusion_queries`, `test_walk_key`. - In the game: Windows 11 Pro, GeForce RTX 5070 Ti, a DualSense through SDL, a pack of this change on an earlier `main` (6c9edffe), together with my other branches. At low hearts with the row Off, the beep and Link's red flash play as before; with it On, both stop, and the hearts still glow. - Linux, compiler only: `host/oot_heart_alert.c` compiles for a Linux target (clang `-fsyntax-only` against the Linux sysroot and `host/posix`). That is not a Linux build, link or run. **Not tested:** Linux and Steam Deck; a run of this exact commit on current `main` in the game (it was run on an earlier `main`; the patch's place is found once on current `main`'s lift). **Must be tested:** - Linux, any GPU (the Test Farm): build this branch and start the game, expecting it to build and start, and the Audio tab to show Disable low health audio, Off. - Any platform, by hand: Audio tab, Disable low health audio On, take Link to one heart, expecting no beep and no red flash on Link; Off, expecting both back. ## Risks **What could break:** the patched block is entered only at low health, and with the row Off it runs as before. With it On, the state the block would restart (`+0x1860`) keeps its last value; the update's code after the join treats it as it does on any frame without a pulse. **Turning it off:** the row Off (the default), or revert the commit. **Compatibility:** the options file gains one line. The player's next build translates the game again because the lifted function changes, as for any change to `nx2/oot_patches.py`. Shader and pipeline caches and `MKWVK_API_VERSION` are untouched (a new `HOS_OPT_*` number, no struct change). ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what can't be run by hand is in Testing's Not testable by hand, with why. - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and in Risks. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value. - [ ] Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen. (Open: the Audio tab's row, to add.) - [ ] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. (Open: built on Windows; for Linux only the host file was compile-checked, see Testing.) - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [x] Docs updated.
feat(audio): a Disable low health audio row, to turn off the beep and Link's red flash at low hearts
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 8s
cded357335
Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
First-time contributor

Tested in game: Windows 11 Pro, GeForce RTX 5070 Ti, a DualSense through SDL; a pack of this change (with my other branches) on main @ 6c9edffe. At one heart: row Off, the beep and Link's red flash as before; row On, both gone and the hearts still glow.

Tested in game: Windows 11 Pro, GeForce RTX 5070 Ti, a DualSense through SDL; a pack of this change (with my other branches) on main @ 6c9edffe. At one heart: row Off, the beep and Link's red flash as before; row On, both gone and the hearts still glow.
Owner

Brought up to the ready-for-review standard (#1454): the checklist's Everyone list has two new boxes, added here from what this PR's description and comments show (please check they match what you know).

  • Tested on my own PC: ticked: Testing's Tested and the author's comments: in the game on Windows 11, RTX 5070 Ti, DualSense, on an earlier main.
  • Nothing gets worse that I know of: ticked: Measurements says nothing to measure: one option read per pulse, and the row is off by default.
Brought up to the [ready-for-review standard](https://git.magicbean.dev/MagicBeanDev/Longshot/src/branch/main/CONTRIBUTING.md#ready-for-review-out-of-wip) (#1454): the checklist's Everyone list has two new boxes, added here from what this PR's description and comments show (please check they match what you know). - *Tested on my own PC*: ticked: Testing's Tested and the author's comments: in the game on Windows 11, RTX 5070 Ti, DualSense, on an earlier main. - *Nothing gets worse that I know of*: ticked: Measurements says nothing to measure: one option read per pulse, and the row is off by default.
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 8s
This pull request has changes conflicting with the target branch.
  • gpu/vk/menu_i18n.h
Some workflows are waiting to be reviewed.
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.
git fetch -u 'feat/heart-alert-mute:kendowashere-feat/heart-alert-mute'
git switch 'kendowashere-feat/heart-alert-mute'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!1293
No description provided.