feat(discord): the status names where Link is, his age and stats; its text and picture are the player's to set #1653

Merged
HumanBean merged 12 commits from dyst/Longshot:feat/discord-area into main 2026-11-18 21:36:44 +00:00
Member

Type: feat · Risk: low · Tested on: Windows 11, RTX 3080 (driver 621.14) · Needs: Linux, any GPU

TL;DR

Longshot's Discord status said only "Longshot" and the build. Now it says where Link is and his age ("Water Temple - Adult"), with his hearts, Gold Skulltula tokens and pieces of heart under it ("❤️ 1.25/9 · 🕷️ 17 · 💗 5"), and the version where there is no place (the title screen). Players can rewrite both lines, the picture and its hover text in longshot_options.ini. Checked in the game with a real Discord client on two saves, and with new game-free checks.

Breakdown

  • Who it helps: anyone who plays with Discord open, and their friends who see what they're doing.
  • What was wrong: the status only ever showed "Longshot" and the build, with no way to change it (#1082).
  • What changes: the status names the area, Link's age and his stats, and its text, picture and hover text are the player's to set.
  • What does not change: the Discord status row in the Insert menu (on by default, off sends nothing), the application, and nothing is sent unless a Discord client runs on the PC.
  • How it was checked: watched runs with a real Discord client on Windows (a new save, then a save at the Water Temple: title, play, a teleport), and two game-free checks.
  • What is still open: a run on Linux.
  • Risk: low: the status's text only, and a one-time read of eight map files on the Discord thread.

Why

The Discord status showed "Playing Longshot" and the build and nothing else, the same on the title screen as at the Water Temple. #1082 asks for the area and other game details, and for the player to choose the text, picture and name. Fixes #1082 (the bold name is the Discord application's, so a different one is the player's own application through discord_app_id=, as before).

What changed

The status is now a template the player can rewrite, filled from what the game knows: where Link is, his age, his hearts, rupees, tokens and pieces of heart, and the version in readable parts. The defaults show the place over the stats in a map and the version elsewhere; the picture's hover text shows the version.

  • Places: host/oot_area_names.c names the game's 80 maps in English (Market Ruins, Zora's Domain (frozen), Fighting Queen Gohma, "(Master Quest)"), and spells out one it does not know.
  • The template: host/discord_activity.c: discord_text= (both lines, split by {break}), discord_image=, discord_image_text=; {name}, {name|text} (only when name is not empty), {!name|text} (only when it is), nesting, {{ }}; an empty part takes its brackets, spaces and a dangling dash or dot with it; a line is cut to Discord's 128 bytes at a whole letter. The version in parts: {version} v3.0.0, {build} RC7 or N486 (a nightly), {commit} (in the defaults only on a build with no version number, a nightly), {release} all of it.
  • The stats: host/hos_main.c reads Link's life, most life and rupees from the game data with the map, and his Gold Skulltula tokens from his pouch every 2 s; hearts show as plain decimals (1.25), as ¼ was too small to read in Discord.
  • Pieces of heart: the game keeps only the 0–3 pieces Link holds, so the total is worked out: 4 × (hearts − 3 − boss containers taken) + held. host/oot_heart_containers.c reads the eight boss containers' placement ids from the player's own RomFS once, on the Discord thread (the dungeons' map files: zstd with Pack/ZsDic.pack.zs's dictionary, BYML inside); host/oot_state_tap.c's hos_oot_gamedata_bool64 reads whether each was taken (the game data's Bool64bitKey flags). Nothing from the game is in the source.
  • Sending: host/discord_rpc.c looks every 2 s, sends a change once 15 s have passed since the last, keeps the 60 s keep-alive, and logs each new status ("discord: the status: ..."). The location shows only while Link was seen in the last 90 s (not through the title or a long load).
  • Docs: the README's Discord section: the lines, placeholders and examples; the privacy section says what is sent.

Measurements

Nothing to measure: the status's text. The work it adds is a few game-data reads every 250 ms (with the map, as before), two pouch counts and eight flag reads every 2 s, and one read of eight map files on the Discord thread at the first status.

Flags and settings

Three new longshot_options.ini lines, documented in the README's Discord section; no switch.

Flag What it is Before this PR After this PR Effect Helps / doesn't help / untested Recommendation
discord_text= the status's two lines, a template none {location|{location} - {age}{break}{hearts|❤️ {hearts}/{max_hearts} · }{skulltulas|🕷️ {skulltulas} · }{heart_pieces|💗 {heart_pieces}}}{!location|{version} {build}{!version| {commit}}} what the status says helps: tested the default
discord_image= the large picture: an art asset's key or an https:// link none longshot the picture tested with the default the default
discord_image_text= the picture's hover text, a template none Longshot {version} {build}{!version| {commit}} the hover text tested the default

Testing

Tested:

  • Windows 11, RTX 3080 (NVIDIA 621.14), with the Discord app running and the status watched in it, on a new save (Kokiri Forest, a teleport to Kakariko) and on a save at the Water Temple (the title, the Water Temple, a teleport to Kakariko Village). The log's status lines at 21c3afa3 (the layout of this PR; hearts still as ¼ and 💗 still the 0–3 held then):
    [hos host] discord: the status: v3.0.0 RC7 / -
    [hos host] discord: the status: Water Temple - Adult / ❤️ 1¼/9 · 🕷️ 17 · 💗 1
    [hos host] discord: the status: Kakariko Village - Adult / ❤️ 1¼/9 · 🕷️ 17 · 💗 1
    
  • The pieces' total, in the game on the same save through the control bridge's memory reads (HOS_CONTROL_MEM=ro): of the eight boss containers' Bool64bitKey flags, exactly the five of Deku Tree, Dodongo's Cavern, Jabu-Jabu, Forest and Fire read 1 at +12 (Shadow, Spirit and Water 0), so 4 × (9 − 3 − 5) + 1 = 5, the pieces the player counted (the game's map marks 4 of them).
  • python -I -B tests/test_discord_activity.py: every map named; the templates, conditionals, cleanup and the 128-byte cut; the version's parts (RC, beta, nightly, a bare hash, dirty); the hearts' decimals; the options lines (the Insert menu's own discord_status= left alone); the JSON parsed back.
  • python -I -B tests/test_heart_containers.py: the pieces' total, and the readers on made-up SARC and BYML files of both byte orders, cut short at every length.
  • python -I -B tests/run_all.py on Windows: 640 passed, 49 failed, 121 skipped. The same 49 fail on main (da91e770) on this PC, none from this branch: test_auto_handheld.py, test_bug_report_defaults.py, test_build_long_paths.py, test_capture_read_once.py, test_cpu_report.py, test_crash_dialog.py, test_crt_options.py, test_damage_debug_menu.py, test_dev_packs.py, test_discover.py, test_display_startup_failure.py, test_dlss_feature_size.py, test_failed_compile_keeps_objects.py, test_fastfp_fma.py, test_fma_soft.py, test_fpx_sticky.py, test_game_menu_mouse_buttons.py, test_guest_imported.py, test_host_guest_writes.py, test_hud_layout_row.py, test_invalidate_quick.py, test_invalidate_vcore.py, test_job_queue.py, test_libc_hooks.py, test_lift_lookups.py, test_linux_preflight.py, test_linux_pressure.py, test_longshot_ctl.py, test_missing_nup.py, test_pads_after_menu.py, test_pending_guest_import.py, test_pipeline_play_cache.py, test_prepare_cache_save.py, test_present_thread.py, test_profiling_mode.py, test_psychov35_fsr3_fg.py, test_readback_timeout_source.py, test_run_all_changed.py, test_sdiv_overflow.py, test_slow_frames.py, test_song_note_cue.py, test_spawn_emit.py, test_switch_table.py, test_tested_configurations.py, test_upscaler_rows.py, test_vbytes.py, test_vfpx_elem.py, test_walk.py, test_walk_key.py.

Not tested: the last two commits (31ffa5ad, the hearts as decimals; 73398ede, the pieces' total) in a watched run: building now, its status lines follow as a comment. Linux: neither built nor run here (the new host code is plain C with no Windows calls); a Master Quest save (the containers are read from the normal dungeons' map files).

Must be tested:

  • Linux, any GPU: the build, then, with the Discord app running, play a save into a map, expecting the area and age over the stats in Discord's status, the version on the title screen, and "discord: the boss heart containers: 8 of 8 found in the RomFS" in longshot_log.txt (by hand: a tester with Discord on Linux).

Risks

What could break: the Discord status's text; a RomFS without the dungeons' map files (a mod that removes them) shows no 💗 and logs "0 of 8 found".

Turning it off: the Insert menu's Discord status row, or discord_text= set to what you want shown; revert the commits.

Compatibility: Nothing changes for saves or caches. The status's text is new; a player who wants the old line writes discord_text=Longshot {version} {build}.

Issues

Fixes #1082

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.
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Docs updated.

🤖 Generated with Claude Code

**Type:** feat · **Risk:** low · **Tested on:** Windows 11, RTX 3080 (driver 621.14) · **Needs:** Linux, any GPU ## TL;DR Longshot's Discord status said only "Longshot" and the build. Now it says where Link is and his age ("Water Temple - Adult"), with his hearts, Gold Skulltula tokens and pieces of heart under it ("❤️ 1.25/9 · 🕷️ 17 · 💗 5"), and the version where there is no place (the title screen). Players can rewrite both lines, the picture and its hover text in `longshot_options.ini`. Checked in the game with a real Discord client on two saves, and with new game-free checks. ## Breakdown - **Who it helps:** anyone who plays with Discord open, and their friends who see what they're doing. - **What was wrong:** the status only ever showed "Longshot" and the build, with no way to change it (#1082). - **What changes:** the status names the area, Link's age and his stats, and its text, picture and hover text are the player's to set. - **What does not change:** the Discord status row in the Insert menu (on by default, off sends nothing), the application, and nothing is sent unless a Discord client runs on the PC. - **How it was checked:** watched runs with a real Discord client on Windows (a new save, then a save at the Water Temple: title, play, a teleport), and two game-free checks. - **What is still open:** a run on Linux. - **Risk:** low: the status's text only, and a one-time read of eight map files on the Discord thread. ## Why The Discord status showed "Playing Longshot" and the build and nothing else, the same on the title screen as at the Water Temple. #1082 asks for the area and other game details, and for the player to choose the text, picture and name. Fixes #1082 (the bold name is the Discord application's, so a different one is the player's own application through `discord_app_id=`, as before). ## What changed The status is now a template the player can rewrite, filled from what the game knows: where Link is, his age, his hearts, rupees, tokens and pieces of heart, and the version in readable parts. The defaults show the place over the stats in a map and the version elsewhere; the picture's hover text shows the version. - **Places:** `host/oot_area_names.c` names the game's 80 maps in English (Market Ruins, Zora's Domain (frozen), Fighting Queen Gohma, "(Master Quest)"), and spells out one it does not know. - **The template:** `host/discord_activity.c`: `discord_text=` (both lines, split by `{break}`), `discord_image=`, `discord_image_text=`; `{name}`, `{name|text}` (only when name is not empty), `{!name|text}` (only when it is), nesting, `{{` `}}`; an empty part takes its brackets, spaces and a dangling dash or dot with it; a line is cut to Discord's 128 bytes at a whole letter. The version in parts: `{version}` v3.0.0, `{build}` RC7 or N486 (a nightly), `{commit}` (in the defaults only on a build with no version number, a nightly), `{release}` all of it. - **The stats:** `host/hos_main.c` reads Link's life, most life and rupees from the game data with the map, and his Gold Skulltula tokens from his pouch every 2 s; hearts show as plain decimals (1.25), as ¼ was too small to read in Discord. - **Pieces of heart:** the game keeps only the 0–3 pieces Link holds, so the total is worked out: 4 × (hearts − 3 − boss containers taken) + held. `host/oot_heart_containers.c` reads the eight boss containers' placement ids from the player's own RomFS once, on the Discord thread (the dungeons' map files: zstd with `Pack/ZsDic.pack.zs`'s dictionary, BYML inside); `host/oot_state_tap.c`'s `hos_oot_gamedata_bool64` reads whether each was taken (the game data's Bool64bitKey flags). Nothing from the game is in the source. - **Sending:** `host/discord_rpc.c` looks every 2 s, sends a change once 15 s have passed since the last, keeps the 60 s keep-alive, and logs each new status ("discord: the status: ..."). The location shows only while Link was seen in the last 90 s (not through the title or a long load). - **Docs:** the README's Discord section: the lines, placeholders and examples; the privacy section says what is sent. ## Measurements Nothing to measure: the status's text. The work it adds is a few game-data reads every 250 ms (with the map, as before), two pouch counts and eight flag reads every 2 s, and one read of eight map files on the Discord thread at the first status. ### Flags and settings Three new `longshot_options.ini` lines, documented in the README's Discord section; no switch. | Flag | What it is | Before this PR | After this PR | Effect | Helps / doesn't help / untested | Recommendation | |---|---|---|---|---|---|---| | `discord_text=` | the status's two lines, a template | none | `{location\|{location} - {age}{break}{hearts\|❤️ {hearts}/{max_hearts} · }{skulltulas\|🕷️ {skulltulas} · }{heart_pieces\|💗 {heart_pieces}}}{!location\|{version} {build}{!version\| {commit}}}` | what the status says | helps: tested | the default | | `discord_image=` | the large picture: an art asset's key or an `https://` link | none | `longshot` | the picture | tested with the default | the default | | `discord_image_text=` | the picture's hover text, a template | none | `Longshot {version} {build}{!version\| {commit}}` | the hover text | tested | the default | ## Testing **Tested:** - Windows 11, RTX 3080 (NVIDIA 621.14), with the Discord app running and the status watched in it, on a new save (Kokiri Forest, a teleport to Kakariko) and on a save at the Water Temple (the title, the Water Temple, a teleport to Kakariko Village). The log's status lines at 21c3afa3 (the layout of this PR; hearts still as ¼ and 💗 still the 0–3 held then): ``` [hos host] discord: the status: v3.0.0 RC7 / - [hos host] discord: the status: Water Temple - Adult / ❤️ 1¼/9 · 🕷️ 17 · 💗 1 [hos host] discord: the status: Kakariko Village - Adult / ❤️ 1¼/9 · 🕷️ 17 · 💗 1 ``` - The pieces' total, in the game on the same save through the control bridge's memory reads (`HOS_CONTROL_MEM=ro`): of the eight boss containers' Bool64bitKey flags, exactly the five of Deku Tree, Dodongo's Cavern, Jabu-Jabu, Forest and Fire read 1 at +12 (Shadow, Spirit and Water 0), so 4 × (9 − 3 − 5) + 1 = 5, the pieces the player counted (the game's map marks 4 of them). - `python -I -B tests/test_discord_activity.py`: every map named; the templates, conditionals, cleanup and the 128-byte cut; the version's parts (RC, beta, nightly, a bare hash, dirty); the hearts' decimals; the options lines (the Insert menu's own `discord_status=` left alone); the JSON parsed back. - `python -I -B tests/test_heart_containers.py`: the pieces' total, and the readers on made-up SARC and BYML files of both byte orders, cut short at every length. - `python -I -B tests/run_all.py` on Windows: 640 passed, 49 failed, 121 skipped. The same 49 fail on `main` (da91e770) on this PC, none from this branch: test_auto_handheld.py, test_bug_report_defaults.py, test_build_long_paths.py, test_capture_read_once.py, test_cpu_report.py, test_crash_dialog.py, test_crt_options.py, test_damage_debug_menu.py, test_dev_packs.py, test_discover.py, test_display_startup_failure.py, test_dlss_feature_size.py, test_failed_compile_keeps_objects.py, test_fastfp_fma.py, test_fma_soft.py, test_fpx_sticky.py, test_game_menu_mouse_buttons.py, test_guest_imported.py, test_host_guest_writes.py, test_hud_layout_row.py, test_invalidate_quick.py, test_invalidate_vcore.py, test_job_queue.py, test_libc_hooks.py, test_lift_lookups.py, test_linux_preflight.py, test_linux_pressure.py, test_longshot_ctl.py, test_missing_nup.py, test_pads_after_menu.py, test_pending_guest_import.py, test_pipeline_play_cache.py, test_prepare_cache_save.py, test_present_thread.py, test_profiling_mode.py, test_psychov35_fsr3_fg.py, test_readback_timeout_source.py, test_run_all_changed.py, test_sdiv_overflow.py, test_slow_frames.py, test_song_note_cue.py, test_spawn_emit.py, test_switch_table.py, test_tested_configurations.py, test_upscaler_rows.py, test_vbytes.py, test_vfpx_elem.py, test_walk.py, test_walk_key.py. **Not tested:** the last two commits (31ffa5ad, the hearts as decimals; 73398ede, the pieces' total) in a watched run: building now, its status lines follow as a comment. Linux: neither built nor run here (the new host code is plain C with no Windows calls); a Master Quest save (the containers are read from the normal dungeons' map files). **Must be tested:** - Linux, any GPU: the build, then, with the Discord app running, play a save into a map, expecting the area and age over the stats in Discord's status, the version on the title screen, and "discord: the boss heart containers: 8 of 8 found in the RomFS" in `longshot_log.txt` (by hand: a tester with Discord on Linux). ## Risks **What could break:** the Discord status's text; a RomFS without the dungeons' map files (a mod that removes them) shows no 💗 and logs "0 of 8 found". **Turning it off:** the Insert menu's Discord status row, or `discord_text=` set to what you want shown; revert the commits. **Compatibility:** Nothing changes for saves or caches. The status's text is new; a player who wants the old line writes `discord_text=Longshot {version} {build}`. ## Issues Fixes #1082 ## 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] A check under `tests/` that reads changed source updated in this PR, not weakened. - [x] Docs updated. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
dyst added 12 commits 2026-11-18 21:25:37 +00:00
In a map the Discord status's first line is the place Link is and his age ("Kakariko Village - Adult", "Fighting
Queen Gohma - Child"); on the title screen and before Link is first seen it says "Longshot" and the version, as before.
Link counts as in a map while his update ran within 90 s (the pause menu and cutscenes keep it).

host/oot_area_names.c names the game's 80 maps in English (the age, Master Quest and changed-state suffixes folded;
the market's ruins by their own name; a boss's or a fight's room by the fight) and spells out one it does not know.
host/discord_activity.c reads longshot_options.ini's discord_details=, discord_state=, discord_title_details=,
discord_title_state=, discord_image= (an art asset's key or an https:// link) and discord_image_text=, templates with
{area}, {age}, {map} and {version}, cut to Discord's 128 bytes at a whole letter, a line under 2 letters left out, the
JSON escaped. host/discord_rpc.c sends a change within 15 s (Discord takes a few a minute) and logs each new text.

Checks: tests/test_discord_activity.py (every map named, the templates, the settings lines, the in-map rule, the
activity's JSON parsed).

See #1082.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
git describe's "v3.0.0-rc.7-25-g7a029028" becomes {version} v3.0.0, {build} RC7 (rc.7 and rc7; beta.2 "Beta 2";
nightly-70 "Nightly 70"; nothing on a release), {commit} 25-g7a029028 (-dirty kept) and {release} all of it. An empty
part takes its brackets and the extra space with it, so "Longshot {version} {build} [{commit}]" reads "Longshot v3.0.0
RC7 [25-g7a029028]" on a test build and "Longshot v3.0.0" on a release. The defaults: "Longshot {version} {build}" on
the second line, the commit in the picture's hover text.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The status is discord_status=, default
  {location|{location} - {age}{break}}Longshot {version} {build} {commit}
so the place and the age lead and the version is the smaller line under them; on the title screen there is no location,
the first part is left out and the version stands alone. {name|text} nests; {location}, {age} and {map} are empty
outside a map. The bold name above it is the Discord application's (discord_app_id=): Discord shows no other there.
Replaces the separate details/state keys of the earlier commits (not released).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The menu saves its Discord status row (on or off) as discord_status=1, the key its label makes, so the template read
"1" as the status's text: a line under Discord's 2 letters, left out, and the status showed the application's name
alone. Seen in a run with the Discord app (the title's status sent once, then nothing). The template is
discord_text= now, and a check holds that discord_status=1 never touches it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
{hearts}/{max_hearts} (quarter hearts as ¼ ½ ¾), {rupees} and {skulltulas} in the template, empty outside a map. The
default's second line: "❤️ 2¾/3 · 🕷️ 12 · v3.0.0 RC7 ..."; a part not known goes with its middle dot. host/hos_main.c
reads PlayerStatus.Life, .MaxLife and .CurrentRupee with the map on Link's update (host/oot_state_tap.c's lookup,
hos_oot_gamedata_int) and the tokens (Item_Token_Gold, as the Cheats page counts them) every 2 s, kept for the
Discord thread (hos_oot_stats).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The status's second line in a map is now Link's stats alone (hearts, Gold
Skulltula tokens and, new, pieces of heart as 💗 {heart_pieces}); the version
moves to the picture's hover text, and is the first line where there is no
location (the title screen), through a new {!name|text}: text when name is
empty. The commit is left out of the defaults except on a build with no
version number (a nightly: "N486 09a20cd6"), whose name is now read in parts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
feat(discord): the pieces of heart Link has found in all, not the 0-3 he holds
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 10s
Website / Website on Cloudflare (pull_request_target) Has been skipped
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 16s
CI / Workflow lint (actionlint) (pull_request) Successful in 20s
Third-party parts / As their notes say (pull_request) Successful in 21s
PR description / Description follows the template (pull_request_target) Successful in 12s
73398ede15
The game keeps only the pieces Link holds toward his next heart. The total
comes from his hearts: 4 * (hearts - 3 - boss containers taken) + held.
host/oot_heart_containers.c reads the eight containers' placement ids from
the player's own RomFS once, on the Discord status's thread (the dungeons'
map files, zstd with Pack/ZsDic.pack.zs's bcett dictionary, BYML inside), and
host/oot_state_tap.c reads whether each was taken from the game data's
Bool64bitKey flags (GameDataMgr + 0xc58, the value at +12 of each entry).

Checked against a save at the Water Temple: five containers taken, 9 hearts,
1 held, so 5, as the player counts them (the map's own icons show 4).
tests/test_heart_containers.py checks the readers on made-up SARC and BYML
files of both byte orders, cut short at every length, and the total.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Tested in game: Windows 11, RTX 3080 (NVIDIA 621.14), the Discord app running, the status watched in it: a new save (Kokiri Forest, a teleport to Kakariko) and a save at the Water Temple (title, Water Temple, a teleport to Kakariko Village). At 21c3afa3 the status read 'v3.0.0 RC7' on the title, then 'Water Temple - Adult' over the hearts, tokens and pieces, then 'Kakariko Village - Adult'. The eight boss containers' flags read in the game on that save: exactly the five taken set, so 5 pieces in all, as the player counted. The last two commits (hearts as decimals, the pieces' total) are building for a watched run; its lines follow as a comment.

Tested in game: Windows 11, RTX 3080 (NVIDIA 621.14), the Discord app running, the status watched in it: a new save (Kokiri Forest, a teleport to Kakariko) and a save at the Water Temple (title, Water Temple, a teleport to Kakariko Village). At 21c3afa3 the status read 'v3.0.0 RC7' on the title, then 'Water Temple - Adult' over the hearts, tokens and pieces, then 'Kakariko Village - Adult'. The eight boss containers' flags read in the game on that save: exactly the five taken set, so 5 pieces in all, as the player counted. The last two commits (hearts as decimals, the pieces' total) are building for a watched run; its lines follow as a comment.
dyst changed title from WIP: feat(discord): the status names where Link is, his age and stats; its text and picture are the player's to set to feat(discord): the status names where Link is, his age and stats; its text and picture are the player's to set 2026-11-18 21:25:59 +00:00
Author
Member

The watched run of the last two commits (31ffa5ad, the hearts as decimals; 73398ede, the pieces of heart in all) was stopped before it started, to free this PC's shared build base: the pack over it was rebuilding the game's code, as the branch is 20 commits past that base. It is still owed: the status should read "Water Temple - Adult" over "❤️ 1.25/9 · 🕷️ 17 · 💗 5" on the save the containers' flags were read from, with "discord: the boss heart containers: 8 of 8 found in the RomFS" in the log. I'll post its lines here when it has run.

The watched run of the last two commits (31ffa5ad, the hearts as decimals; 73398ede, the pieces of heart in all) was stopped before it started, to free this PC's shared build base: the pack over it was rebuilding the game's code, as the branch is 20 commits past that base. It is still owed: the status should read "Water Temple - Adult" over "❤️ 1.25/9 · 🕷️ 17 · 💗 5" on the save the containers' flags were read from, with "discord: the boss heart containers: 8 of 8 found in the RomFS" in the log. I'll post its lines here when it has run.
HumanBean deleted branch feat/discord-area 2026-11-18 21:36:44 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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!1653
No description provided.