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
1 participant
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_VERSION29 → 31 (main is 29; the open #1358 holds 30 and #68 holds 33).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=1Testing
Tested: Linux (Arch, kernel 7.2.15), RTX 4090 (NVIDIA 615.78.08), i9-13900K, 93 GB; headless, 2026-11-17; main @
544229a26and this PR @9bdbc2c94.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 aftermonitor_select.Turning it off: Debug tools Off hides the row; reverting the commits removes the page and the queue.
Compatibility:
MKWVK_API_VERSION29 → 31: build the host and the renderer together. 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.main(544229a26).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.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 pressView 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.