feat(debug): a Progress page in the Debug tools: each dungeon, story part and side quest done or undone at once, and the saved flags one by one #2421
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2421
Loading…
Reference in a new issue
No description provided.
Delete branch "dyst/Longshot:feat/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?
Summary
Putting a save at a given point of the game (the Forest Temple done, the Spiritual Stones in hand, the Door of Time open)
meant playing there or editing the save by hand. This adds a Progress page to the Debug tab (Debug tools on), after
Inventory. It lists the story's parts (Deku Tree to Ganon), then the side quests (Epona, Biggoron's Sword, the masks, the
Great Fairies, ...), each as a group that folds with a switch at its right: Not done, Part done, Done. Done sets
its chapters of the story to where it ends, opens the chests that matter (key items, a dungeon's keys, map and compass),
gives its items through the Inventory editor's own path and sets its flags; Not done undoes them. Opened, a group lists
its chapters' steps, chests, items and flags, each set by hand. After the groups, Everything else: the overworld's
chests, the areas visited, and every other named flag in lists by kind (places by area, people, cutscenes seen, Navi's
hints, mini-games, conversations, ...).
is told in the game's own quest-log words (what has happened at its step, what to do next).
list the top line is in stays pinned, so a long list can be folded from anywhere in it.
Keep them (a save the player makes then keeps them) or Put back (the game as it was); until then the map
change's autosave waits, so nothing reaches a save file by accident.
Nothing of the game is in the source but the story's order and the words that tell a group's flags: which flags there
are, their names, the chests, the icons and the quest log's words are read from the player's own RomFS when the Debug tab
first shows (on 8 threads: about 0.5 s, up to about 6 s when Windows Defender checks the ~2,700 files again).
Two fixes to the Insert menu as a whole ride along, found by using the page with a controller and with the keyboard:
host/nn_hid.cstick_dirsturns the left stick into four directions past
HOS_PAD_N, whichhos_pad_rawadds for the menu only; the game'sbuttons and the Controls page never see them.
game has no keys). Not in a text field, not while a binding waits for its key; a key that is one of the menu's own
(Q, E, an arrow) stays only that.
Read first:
docs/dev/reference/progress.md(the design: where the flags come from, the groups, how a change is made andwhat it lasts),
host/oot_progress.c(the game side),gpu/vk/menu/progress.cpp(the page). The page reaches the hostthrough
MkwVkHost's newprogresstable (MKWVK_API_VERSION45 to 46).Overlaps #1411, a different Progress page that adds a file of the
same name (
host/oot_progress.c): the two cannot both merge as they are.Testing
Tested: Windows 11 Pro 23H2, NVIDIA GeForce RTX 3080 (driver 621.14), Ryzen 9 3900X, llvm-mingw, packed over v3.1.1's
base. By hand in the game over seven runs, each on a fresh save at the start of the game; the last on this head's game code
(
b064de980, main @90fae88c1; the head adds a test only):progress: 23114 flags of a slot's save, 3051 named; 33 groups; 194 chests, 45 of them the overworld's,read in 766 ms (... the names 640 from 2739 files ...; 8 readers),150 menu icons from the game's textures in 800 ms. A run whose files Defender had not checked yet: 6,031 ms.the scroll bar's drag and click, folding and opening, all with the mouse, the keyboard and a controller.
search field.
Checks:
tests/run_all.py --changed origin/main(Windows, llvm-mingw first onPATH): 233 passed, 19 failed, 23 skipped.18 of the 19 fail on main @
90fae88c1too (run again there by name):test_build_long_paths,test_crash_dialog,test_crt_options,test_dev_build,test_dev_packs,test_dev_update,test_fpx_sticky,test_game_menu_mouse_buttons,test_input_movie,test_linux_preflight,test_longshot_ctl,test_menu_text_field,test_pads_after_menu,test_perf_report,test_pipeline_share,test_rumble_menu,test_vfpx_elem,test_vibration_menu. The 19th,test_oot_transition_autosave, failed here only (its fixture had nohos_progress_pending) and is fixed in the last commit, with cases for the autosave that waits. New:test_menu_left_stick(fails on main:stick_dirsis new; checked to fail with the change undone),test_progress_catalog. The whole suite has not been run.Still to test:
docs/dev/reference/progress.md, "What a game run hasto confirm", 2 to 6: the Forest Temple done (its Sage awake, its chests open, its items given, the autosave waiting),
kept and saved then reloaded, put back, undone; a group part done; the Spiritual Stones moving the Three Spiritual
Stones; each split chapter's step (Ocarina of Time, Ice Cavern, Bottom of the Well, Gerudo Fortress, the child Spirit
Temple), expecting each as that page says (by hand).
the Debug tab's Progress page, or by hand).
it, expecting it to move the menu only (by hand).
Measurements
Verdict: not measured. The page does nothing with Debug tools off. With them on, the Debug tab shown starts one read
of the player's files on reader threads of its own (0.5 to 6 s, above, never on the game's thread), and while the page is
drawn the game's thread reads every flag's value each quarter second; that pass's cost to a frame has not been timed. The
menu fixes add a few key and stick reads to a tick of the open menu.
Risks
the chests' Bool64bitKey entries are written in place, and whether such a write reaches a save is still to confirm. A
change reaches a save file only through a save the player makes (Keep), or not at all (Put back); a group's end step for
a split chapter is read from where the game uses its steps and could be off by one (Still to test).
editor's are). The reads check every address against the guest's memory (
hos_guest_range) and read nothing withoutthe game's data manager; the writes call the setters at those addresses.
movement keys include one of the menu's own keys keeps the menu's meaning for that key.
MKWVK_API_VERSION45 to 46 (the host and the renderer are built together). Another pull request thattakes 46 first means one small renumbering commit.
longshot_options.iniare untouched until the player uses the page.Checklist
Ready for review
main; the title is a Conventional Commit. (The two menu fixes are the page's own input,found with it; they can be split out if wanted.)
mise run testpasses (any failure that also fails onmainis named). Not ticked:run_all --changedonly (above),not the whole suite.
main, or Measurements says why there is nothing to measure. Not ticked: the open page'squarter-second read is not timed yet.
third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.tests/that reads changed source is updated, not weakened.MKWVK_API_VERSIONbumped (MkwVkHostorMkwVkRendereringpu/vk/vk_api.hchanged).Linux build is CI's and the Test Farm's.
mainand here, for a change that shows on screen. Not ticked: the page shows thegame's own icons and words, read from the player's files, so none are attached.
Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
- A chapter's step (any Enum or Int) is drawn between arrows with where it is among its steps ("Step 05 (9 of 12)"), the menu's choice cell; Left and Right or a click on a half step it, Confirm takes it to its last or first step. - The Door of Time's chapter is two groups: Ocarina of Time ends at Step05 (the Song of Time learnt, the door shut, so the song opens it at the altar as the game does); Door of Time takes the door's own flag (Market_Child_TimeTempleDoor_Opened) and the light shaft's. - RSDB/Challenge's DependFlagName read: a group done moves the chapters that wait for its own from NotReady to Ready, as the game's end of a chapter does (the Door of Time waits for Hyrule Castle); undone, back. - The catalog's read is timed in the log, each part. Co-Authored-By: Claude Opus 5.5 <[email protected]>- The quest log's words (ChallengeMsg/Info_<chapter>.msbt of the text archive the game loaded, read from the player's RomFS with the catalog): a chapter's title ("Three Spiritual Stones"), under its line its step's next action, and a strip under the lines that tells the chosen line in more words (a step's summary and the steps either side; a group's switch and its chapters now; a flag's game name and kind). MkwVkProgress gets step_text. - Step_DoorOfTime is the Three Spiritual Stones: Hyrule Castle done takes it to Step02, and after any group it follows the stones' chapters (Step2_1, Step2_2, Step03), as the game's end of each does. - nx2/menu_icons.py makes the menu's icons at build time from the player's RomFS (the pause menu's item icons, the songs' symbols, a heart container, the map's markers) into the game folder's menu_icons.bin; ui::icon loads it on the first ask, and each line of the page has its picture. Co-Authored-By: Claude Opus 5.5 <[email protected]>Tested in game: Windows 11 Pro 23H2, RTX 3080 (NVIDIA 621.14), Ryzen 9 3900X: seven runs by hand on fresh saves at the start of the game, the last on this head's game code (b064de980 on main
90fae88c1). The Debug tab's Progress page opened and listed 23,114 flags (3,051 named, 33 groups, 194 chests) read in 766 ms; groups, switches, icons, the quest log's words, search, pinned headers, the scroll bar's drag, and the left stick and WASD moving the Insert menu all worked with the mouse, keyboard and a controller. No fatal, crash or device-lost line. The step-by-step checks of progress.md (a group done, kept, reloaded, undone) are still to test.Possibly related, for context:
The left-stick half of this PR is now in its own fix, #3307, ported onto current
main: the Insert menu it read for (gpu/vk/vk_menu.cpp) has since left the renderer, so this branch's copy could not land as it is. Yourstick_dirsreading is the base (host/nn_hid.cpad_left_stick_way, with a hold that keeps a way while its axis stays past 30 percent), and you are a co-author of both its commits. The movement keys part is not taken:mainrepeats W, A, S and D in the menu already.If #3307 merges first, this PR can drop its stick change; if you would rather land it here instead, say so on #3307.
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.