WIP: feat(menu): a Progress editor in the Debug tools (chests, Gold Skulltulas, hearts, bosses, start place) and Inventory amounts that keep every press #1411
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1411
Loading…
Reference in a new issue
No description provided.
Delete branch "mooki/Longshot:progress-editor"
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: medium · Tested on: Linux (Arch), RTX 4090 (NVIDIA) · Needs: Windows (any GPU), AMD or Intel graphics (a run of the editor)
Why
A tester or player who wants a save "with this chest open, that Gold Skulltula taken, Gohma beaten and a heart more" can only play there or edit the save file by hand. The Debug tab's Inventory page gives items but no progress, and its amounts do not always follow the keys: a held Left or Right on a quantity lost presses (#871, "repeated presses result in only one item being added"). This PR adds a Progress page after Inventory that shows what the loaded save has, by area, and changes it in the running game (a chest, a Skulltula, a piece of heart, a dungeon's items and small keys, a boss as a group, hearts, rupees, the place Link starts), and it makes the Inventory page's amounts keep every press. Two defects found by building a save with the Inventory page are fixed too: a song unlocked there was missing from the game's save, and the Deku Stick and Deku Nut bags had no row.
How to reproduce
For #871 (the Inventory part):
Seen on: Windows 11, RTX 5080, NVIDIA 621.24, v3.0.0-rc.4 (the reporter's
report.txt)Settings and switches: Debug tools On
Steps: open Debug, Inventory, Items, a quantity (bombs), Edit amount, then hold or press Right several times.
Expected: the quantity goes up by the number of presses.
Actual: one item is added. The reporter's
longshot_log.txthas exactly onecheats: inventory ... +1line for each item he edited: the other presses never reached the game.What changed
The Progress page reads the player's own game files when it first opens (a few seconds, on a thread of its own), builds its areas and categories from them, reads the live flags and changes them through the game's own setters at Link's updates, so the pause screens and the game's autosave see a change as they see the real thing. No flag name, list or table of the game is in the source. The Inventory amounts now go through a queue.
gpu/vk/game_files.h,game_byml.h(new): the game-file readers (moved out ofvk_game_font.h, which keeps threeusinglines) and a lazy BYML reader.gpu/vk/progress_catalog.h,progress_editor.h,progress_types.h,progress_boss_sets.h(new): the catalogue (areas, chests, Gold Skulltulas, pieces of heart, containers, dungeon items, small keys, bosses, quests, start places) made from the player's files by rules, and theEditor(have/of, set one, set all, a boss's end set in one batch, the counters that depend on them). A start place on the other age's map than Link's is greyed. The bosses' end sets are 32-bit hashes only, taken from #68's tables (no name).gpu/vk/progress_page.h,gpu/vk/vk_menu.cpp: the page (keys, navigation, drawing) and its row on the Debug tab (Row::cheat12, after Inventory).gpu/vk/vk_api.h,gpu/vk/progress_api.h,host/rx_backend.c: threeMkwVkHostcalls,progress_read,progress_apply,progress_state.MKWVK_API_VERSION30 → 34 (main is 30 since #1383; the open #1358 takes 31, #1426 takes 32 and #68 holds 33; the number renumbers again at merge if another pull request lands first).host/oot_progress.c,host/hos_main.c: the game side: reads straight from the game's memory on the menu's thread (every pointer checked to lie in the guest), writes queued for Link's update (at most 32 changes an update, in order, throughSetBool,SetInt,SetEnum,SetKey64and the pouch event, only while a ring has room).oot_teleportis split so the travel to a start place sends the same event under the same checks.gpu/vk/cheat_queue.h,gpu/vk/vk_menu.cpp(#871): the Debug tab's actions were one atomic int that Link's update took with an exchange; a press before the next update replaced the waiting one. They wait in a queue of sixteen now and the presses of one item's amount are summed into the action that is waiting.host/hos_main.coot_gamedata_set_bool: writes the saved copy of a Bool too (the game's autosave writes the file from it): a song unlocked on the Inventory page was in the running game and not in the save (5 of 12 songs in a made save). The age switch shares the function.gpu/vk/oot_cheat_items.h: rows for the Deku Stick and Deku Nut bags (three sizes each).docs/progress-editor.md(new),README.md,docs/development.md: how to use it, what each change does,HOS_OOT_TRACE_PROGRESS=1, API versions.test_progress_catalog.py,test_progress_page.py,test_progress_menu.py,test_oot_progress_host.py,test_cheat_queue.pynew;test_cheat_items.py,test_pipeline_tour.py,test_audio_output_devices.pyupdated, none weakened.What it does not do:
Measurements
Nothing to time: the page does nothing until it is opened, and its flag reads (a few hundred, twice a second) run on the menu's thread. What was checked is that it works, in Testing.
Flags and settings
One switch and one menu row, no ini key.
HOS_OOT_TRACE_PROGRESS=1gpu/vk/switches.def: #1309's rule for a new switch)Testing
Tested: Linux 7.2.15 (Arch), RTX 4090 (NVIDIA 615.78.08), i9-13900K, 93 GB, GCC 16.2.1 and Clang 23.1.3; 2026-11-17; rebased onto
main @ 67efc4d3e, this PR @03b73c87b(the first bullet is that rebase's reruns, game-free, with no window and no GPU, other work on the PC at load 20 to 60). The other bullets are the earlier results, each with its head overmain @ 544229a26(9bdbc2c94, and4ca7bd4c4for the game run); they were not rerun.The rebase onto
main @ 67efc4d3e(2026-11-17: #1309, #1383, #1378, #1379), old head9bdbc2c94, new head03b73c87b. The same changed lines as9bdbc2c94except the API number, the host table's order and one switch row.git range-diffpairs all 8 commits: 5=, 3!; the three!commits differ in 17 and 18 lines in commit 2, 1 and 1 lines in commit 3, 2 and 2 lines in commit 5 old and new patch lines (added and deleted lines compared one by one). (1) The API number, 31 to 34:MKWVK_API_VERSION, the version comments ingpu/vk/vk_api.h,progress_api.h,progress_types.h,host/oot_progress.handhost/rx_backend.c,docs/progress-editor.mdanddocs/development.md's sentence about the versions (it now also names main's version 30,perf_tracking, which the progress calls follow). (2) The host table:progress_read,progress_applyandprogress_statefollow main'sperf_trackinginstead ofmonitor_selectingpu/vk/vk_api.h,host/rx_backend.c,tests/test_audio_output_devices.py(slots, offset checks, the pin== 34) andtests/test_oot_progress_host.py(its last-four-slots check). (3) One new row ingpu/vk/switches.def,HOS_OOT_TRACE_PROGRESS(diag, bool): #1309's rule says a newRX_,HOS_orLONGSHOT_name read from the environment needs one, andhost/oot_progress.creads this one withenv_on. Conflicts: the host-calls commit (vk_api.htwice,rx_backend.c,test_audio_output_devices.pytwice), resolved by keeping both sides, main'sperf_trackingfirst, with the number 34. The two commit messages that named the number say 34 (API version 31before). No check deleted.main @ 67efc4d3ewith this PR's changed or new test files copied in: 1 pass, 8 fail (test_audio_output_devices, test_cheat_items, test_cheat_queue, test_oot_progress_host, test_pipeline_tour, test_progress_catalog, test_progress_menu, test_progress_page fail on main's source, as they must); test_switch_table passes on main too (test_switch_tablereads main's own source, where no name is new). With the new switch's row deleted in a scratch copy of the head,test_switch_tablefails, naming it:HOS_OOT_TRACE_PROGRESS is read (host/oot_progress.c:308) and has no row in gpu/vk/switches.def. The whole suite,tests/run_all.py --jobs 6 --strictin the idle gate with a fresh HOME, each commit in its own clean checkout, one after the other:main @ 67efc4d3e665 passed, 40 failed, 17 skipped in 188 s; this head03b73c87b670 passed, 40 failed, 17 skipped in 194 s. The failing files are the same 40 on both, compared by name: none fails only on this head.run_all.py --changed 67efc4d3e(the checks that read the 30 changed files; its header counts 165) lists 166 checks by name: all ran in this whole-suite run, and each passed or is one ofmain's own failures. A Linux build of this head,make_game.pybehind the full-build lock and the build gate, no shader preparation, the game's lifted code reused from an earlier build whose lift key equals this head's (checked): exit 0,v3.0.0-rc.7-12-g03b73c87b, 419 of 519 objects new, 0 failed, 0:01:41. Built, not run.main @ 67efc4d3e): 16 translation units captured, 0 failures, 1 unjudged (exit 2, INCOMPLETE):test_pipeline_tourskips Windows (it runs on Linux). PASS:test_audio_output_devices,test_cheat_items,test_cheat_queue,test_oot_progress_host,test_progress_catalog(with the zstd units it compiles),test_progress_page. Windows execution not run.4ca7bd4c4overmain @ 544229a26. What this rebase changed in lines the game runs: the API number and the host table's slot order (progress_*after main'sperf_tracking), whichtest_audio_output_devicesandtest_oot_progress_hostpin and the build above compiled; the editor, the host's progress code and the queue are the same lines.The new game-free tests, both ways. On main's source each fails:
tests/test_cheat_queue.py(vk_menu.cpp does not include cheat_queue.h; the header is new),tests/test_cheat_items.py(the StickBag rows are []),tests/test_oot_progress_host.pybool_both_copies(FAIL ... *at(song + 0x17) == 1: the saved copy was not written),tests/test_progress_catalog.cpp's start-place checks (they do not compile without the age guard). On this PR they pass;test_cheat_queue.pyalso under TSan (--tsan). The engine's test passed under g++, clang++, ASan+UBSan and TSan on an earlier head of this branch, and under g++ on this one.The whole suite,
python -I -B tests/run_all.py --jobs 6in a fresh home, once on this PR and once on main @544229a26. This PR: 668 passed, 41 failed, 17 skipped (709 checks). Main: 663 passed, 41 failed, 17 skipped (704 checks). The same 41 test files fail on both (compared by name,reports/SaveEditGame-files/suite/final-*-suite.txt.names): this machine's and main's own (test_bug_report_defaults,test_cpu_report,test_crash_record,test_linux_pressure,test_mirror_budget,test_present_thread,test_profiling_mode,test_staging_burst,test_target_image_pool,test_missing_nupand the rest of the list in the files). The five new files pass here:test_cheat_queue,test_oot_progress_host,test_progress_catalog,test_progress_menu,test_progress_page.Linux build. A full
make_game.pybuild of the branch (before one change totests/test_audio_output_devices.py) exited 0 (176 s, the lifted code and objects from an earlier build of the same branch).Windows, compiled, not run. The Windows-target syntax check of every changed fixture (llvm-mingw 20261104): PASS for all of them (
test_oot_progress_host,test_progress_catalog,test_progress_page,test_cheat_queue,test_cheat_items,test_audio_output_devices);test_pipeline_tour.pyruns on Linux only.test_audio_output_devices.pyfailed this check on main too ('memmove'/'tmpfile'deprecated: its parser fixture lacked_CRT_SECURE_NO_WARNINGS); it is added here.In the game (Linux, NVIDIA, headless; the pictures are below; build of
4ca7bd4c4, which differs from this head only intests/test_audio_output_devices.py). One hold, two games on one made save (a child in Hyrule Field with 16 Deku Nuts, 5 Gold Skulltulas, 1 piece of heart in hand, 4 hearts, Gohma already beaten): game 1 was driven by scripted menu keys (RX_VK_MENU_SCRIPT, 150 keys) through Debug, Inventory (nuts: four Left, three Right at 0.7 s, four Right at 80 ms, two Left) and Debug, Progress (Hyrule Field's Chest 1, Gold Skulltulas 1 and 2, heart pieces 1 and 3; one heart more; Gohma cleared, then set again; the start place "Front Of Market", the child's map); then Link arrived there and the game saved. Game 2 is a new process on the files game 1 left, and its flags were read the moment play began, before any key:cheats: inventoryline)4c0a63f4576277faafter the clear; then 1,d52b1014(the end step)d52b1014The log has the 43
progress:lines (nine batches, every op "made", none skipped), thensave tracelines at the arrival, and a save file written after the script began. Game 2 then drew the same pages with Chest 1, Skulltulas 1 and 2, pieces 1 and 3Had,5 of 20 hearts,3 of 4 for the next heart, GohmaBeaten, and the Inventory page's Deku Nuts at quantity 17; the game's own pause screen showed 5 hearts andDeku Nut 17/20. No fatal, crash, device-lost or kernel driver line in either game. Pictures:1-game1-editing.jpg(the keys' effect page by page, the travel's arrival withSaving...),2-game2-read-back.jpg(game 2's pages),3-game2-pause-screens.jpg.test_cheat_queue.py(two threads) and by the reporter's log.4c0a63f4); the editor's "beaten" ends at the end step (d52b1014) and the pause screens, the autosave and the second load took it without a sign of trouble. A boss set this way may differ from the game's own in that one quest step.Not tested:
RX_VK_MENU_SCRIPT); the mouse code is only read and tested on a fake.Must be tested:
Risks
What could break: The host reads the game's data manager from the menu's thread with every pointer checked against the guest window, and writes only at Link's update through the game's own setters; a game whose layout differs would answer "no such flag" (reads) or stop a batch with a log line (writes), not crash. A change to a quest-linked flag (a boss's end set) can leave a save the game would not have made (for example a boss marked beaten whose door the player has not opened); the page says what each change does. The queue replaces one atomic int, so a menu action now also waits behind a waiting one instead of replacing it. The
MkwVkHosttable grows by three entries after main'sperf_tracking.Turning it off: Debug tools Off hides the row; reverting the commits removes the page and the queue.
Compatibility:
MKWVK_API_VERSION30 → 34: build the host and the renderer together. The number renumbers again at merge if another pull request lands first (main is at 30, #1358 takes 31, #1426 takes 32, #68 holds 33). Saves andlongshot_options.iniare not touched; a save the editor changed is the game's own save of the changed flags.Issues
See #871 (the Inventory part: the reporter's log shows exactly the lost-press pattern the queue removes; the run in the game shows every press landing, not the old loss).
Overlaps: #68 (co-op) carries the same eight boss end sets in
host/oot_coop.c; this PR holds them as hashes ingpu/vk/progress_boss_sets.hand reads the same flags through its own host calls.Checklist
Everyone
type(scope): description) of the status line's type.can't be run by hand is in Testing's Not testable by hand, with why.
in Risks. Not ticked yet: Risks names menu-thread flag reads and queued menu actions that waited behind others, and neither was measured.
main(67efc4d3e, 2026-11-17; the first Testing bullet).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.HOS_OOT_TRACE_PROGRESSalso has its row ingpu/vk/switches.def(#1309's rule).MKWVK_API_VERSIONbumped (gpu/vk/vk_api.h'sMkwVkHostorMkwVkRendererchanged).mainand passing here.tests/that reads changed source updated in this PR, not weakened.New on this forge; not opened on GitHub.
WIP: feat(menu): a Progress editor in the Debug tools (chests, Gold Skulltulas, hearts, bosses, start place) and Inventory amounts that keep every pressto feat(menu): a Progress editor in the Debug tools (chests, Gold Skulltulas, hearts, bosses, start place) and Inventory amounts that keep every press9bdbc2c94803b73c87b5Rebased
9bdbc2c94onto main67efc4d3e; new head03b73c87b.Patch: the same changed lines as
9bdbc2c94except the API number, the host table's order and one switch row.git range-diffpairs all 8 commits: 5=, 3!; the three!commits differ in 17 and 18 lines in commit 2, 1 and 1 lines in commit 3, 2 and 2 lines in commit 5 old and new patch lines (added and deleted lines compared one by one). (1) The API number, 31 to 34:MKWVK_API_VERSION, the version comments ingpu/vk/vk_api.h,progress_api.h,progress_types.h,host/oot_progress.handhost/rx_backend.c,docs/progress-editor.mdanddocs/development.md's sentence about the versions (it now also names main's version 30,perf_tracking, which the progress calls follow). (2) The host table:progress_read,progress_applyandprogress_statefollow main'sperf_trackinginstead ofmonitor_selectingpu/vk/vk_api.h,host/rx_backend.c,tests/test_audio_output_devices.py(slots, offset checks, the pin== 34) andtests/test_oot_progress_host.py(its last-four-slots check). (3) One new row ingpu/vk/switches.def,HOS_OOT_TRACE_PROGRESS(diag, bool): #1309's rule says a newRX_,HOS_orLONGSHOT_name read from the environment needs one, andhost/oot_progress.creads this one withenv_on. Conflicts: the host-calls commit (vk_api.htwice,rx_backend.c,test_audio_output_devices.pytwice), resolved by keeping both sides, main'sperf_trackingfirst, with the number 34. The two commit messages that named the number say 34 (API version 31before). No check deleted.Carried: the earlier results are of
9bdbc2c94overmain @ 544229a26: the new game-free tests both ways, the whole suite (668 passed, 41 failed, 17 skipped against main's 663/41/17), the Linux build and the Windows-target syntax check. The in-game two-game run (13 of 13 presses landed, the flags read back by a second game, three pictures) is of4ca7bd4c4, which differs from9bdbc2c94only in one line oftests/test_audio_output_devices.py. Not rerun; the description names each head.Rerun: the PR's own tests and the ones that read what it changed (test_cheat_items, test_cheat_queue, test_oot_progress_host, test_progress_catalog, test_progress_menu, test_progress_page, test_pipeline_tour, test_audio_output_devices, test_switch_table) on the new head: 9 of 9 pass. The same set run over
main @ 67efc4d3ewith this PR's changed or new test files copied in: 1 pass, 8 fail (test_audio_output_devices, test_cheat_items, test_cheat_queue, test_oot_progress_host, test_pipeline_tour, test_progress_catalog, test_progress_menu, test_progress_page fail on main's source, as they must); test_switch_table passes on main too (test_switch_tablereads main's own source, where no name is new). With the new switch's row deleted in a scratch copy of the head,test_switch_tablefails, naming it:HOS_OOT_TRACE_PROGRESS is read (host/oot_progress.c:308) and has no row in gpu/vk/switches.def. The whole suite,tests/run_all.py --jobs 6 --strictin the idle gate with a fresh HOME, each commit in its own clean checkout, one after the other:main @ 67efc4d3e665 passed, 40 failed, 17 skipped in 188 s; this head03b73c87b670 passed, 40 failed, 17 skipped in 194 s. The failing files are the same 40 on both, compared by name: none fails only on this head.run_all.py --changed 67efc4d3e(the checks that read the 30 changed files; its header counts 165) lists 166 checks by name: all ran in this whole-suite run, and each passed or is one ofmain's own failures. A Linux build of this head,make_game.pybehind the full-build lock and the build gate, no shader preparation, the game's lifted code reused from an earlier build whose lift key equals this head's (checked): exit 0,v3.0.0-rc.7-12-g03b73c87b, 419 of 519 objects new, 0 failed, 0:01:41. Built, not run.Windows: syntax check of the changed C/C++ fixtures (llvm-mingw 20261104, idle gate, base
main @ 67efc4d3e): 16 translation units captured, 0 failures, 1 unjudged (exit 2, INCOMPLETE):test_pipeline_tourskips Windows (it runs on Linux). PASS:test_audio_output_devices,test_cheat_items,test_cheat_queue,test_oot_progress_host,test_progress_catalog(with the zstd units it compiles),test_progress_page. Windows execution not run.Game: not rerun. The earlier run is of
4ca7bd4c4overmain @ 544229a26. What this rebase changed in lines the game runs: the API number and the host table's slot order (progress_*after main'sperf_tracking), whichtest_audio_output_devicesandtest_oot_progress_hostpin and the build above compiled; the editor, the host's progress code and the queue are the same lines.One docs commit on top of the rebase: the guide check (Guide images and local UI source review) failed after the rebase because source files the Graphics guide image is reviewed against changed, some in this PR and two (
vk_internal.h,vk_reflex.h) already in main's #1309. I rendered the Graphics view from main and from this head and compared them: the only difference is the version text, so the image is kept and its reviewed hashes and dependency list are brought up to date, with a note in the guide's source review file.scripts/check_guide_screenshots.py --review-sourcesnow exits 0 on this head. No code changed.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).
feat(menu): a Progress editor in the Debug tools (chests, Gold Skulltulas, hearts, bosses, start place) and Inventory amounts that keep every pressto WIP: feat(menu): a Progress editor in the Debug tools (chests, Gold Skulltulas, hearts, bosses, start place) and Inventory amounts that keep every pressThank you for adding the two boxes; they match what I know. Under the ready-for-review list (#1454) I have moved this back to WIP until one cost is measured and named in Risks: the cost of the menu thread's flag reads and of the queued menu actions. I will tick the box and mark it ready again when that number is in.
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.