WIP: feat(menu): a Progress tab, read live from the game #2943
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2943
Loading…
Reference in a new issue
No description provided.
Delete branch "neotoxic/Longshot:feat/progress-tab"
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
Players asked to follow their progress without leaving the game: what is done, what is left, where, and what it takes. This adds a Progress tab to the Insert menu, read live from the game being played. It lists what the launcher's Progress page (LongshotLauncher#366) lists, the same way: the story's next steps first, then area by area (the area Link is in first, marked here, then the areas with something feasible, then the story's order). Each line has the one thing to know about it in its value cell: what a chest or a minigame gives, what a Piece of Heart or a Gold Skulltula takes (an item, night, a price), what is still missing, or Done. The help box says the line's detail, reward, needs and area. Up and Down choose a line, Left and Right jump to the previous or next area, Enter (A) cycles what is shown: feasible now, what is left so far (up to the current chapter), or all of the game.
Read first:
gpu/vk/progress_track.h: the catalogue (assets/progress/catalogue.tsv, the launcher's, same bytes) and what it says of the game's values; plain C++.gpu/vk/progress_tab.h: the list, its order, the selection, each value cell's text; plain C++.game/oot_tracker.c: the live read, throughgame/flags.h(no call into the game, nothing written), and the area Link is in.gpu/vk/vk_menu.cpp:TAB_PROGRESSanddraw_progress, next to the Mods tab's own drawing.Cost: nothing runs while the menu is closed or on another tab. On the tab, the game is read at most every 250 ms (593 flags), and the list is worked out again only when a value changed.
The catalogue holds hand-written French and English words, the MurmurHash3 of field names and the 64-bit keys of placements: no game file. It is the one the launcher ships; HumanBean said names and IDs are fine for the launcher, and I am asking him for this repository too (see below). The approach to reading flags follows mooki's Progress editor (#1411); the reads themselves are main's
game/flags.h. #2421 (Dyst's debug page) is a different tool and touches none of these files.Testing
Tested: Windows 11, NVIDIA GeForce RTX 5080, driver 617.42. On a save at Lake Hylia (91 of 439 done, 27 feasible), the tab shows the same counts and lines as the launcher's page on the same save; Lake Hylia comes first, marked here; Left, Right and Enter do what Summary says; French and English menus. Screenshots in the first comment. The lines done and feasible match the launcher's on 12 saves, 5268 of 5268 (an off-tree check: the launcher's code and
progress_track.hfed the same saves).Checks added:
tests/test_progress_track.py(the catalogue, each kind of test, the real catalogue reads),tests/test_progress_tab.py(the list's order, the three choices, the selection, the value cells),tests/test_oot_tracker.py(the live read on a made-up GameDataMgr: no save, unreadable flags, Bool, Int, Enum, keys moved, the area).test_menu_*andtest_game_flags.pypass;test_menu_hooks,test_menu_keys,test_menu_save_atomic,test_oot_menu_mouseandtest_game_boundaryfail on main too on this PC.Still to test:
mise run teston Linux CI.Measurements
Verdict: no difference with the menu closed (
dev.py ab); on the tab, a read of the 593 flags costs about 21 µs every 250 ms and the whole tab about 87 µs a frame to draw.Setup: Windows 11, NVIDIA GeForce RTX 5080, driver 617.42.
Menu closed,
dev.py ab --scene hyrule-field(Hyrule Field, child; 67 % resolution, 2560x1440, frame generation Off, uncapped; 60 s each after warm-up, 3 interleaved pairs, the median):4908cc6deda219e8On the tab (a timing job; the menu opened on the tab for 67 s on a save at Lake Hylia, the game in a window; a build timed with
steady_clockaround the calls, not part of this PR):track_read, 593 flags (every 250 ms)track_areadraw_progress, the read included (a frame)Risks
A game version whose flag layout differs reads as no save or unreadable: the tab says so and keeps the last list, it never writes. Hyrule Field's map holds Lake Hylia and Lon Lon Ranch: there, the area comes from the location the last save named, so walking from the lake into the field shows the lake as here until the next save. Nothing changes after updating: no setting, no save, no cache.
Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). (the menu, flags and new tests run here; the full suite on Linux CI)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible. (the catalogue: names and IDs, waiting for the maintainers' word for this repository)When it applies
tests/that reads changed source is updated, not weakened. (tests/menu_model_fixture.py: the new tab)MKWVK_API_VERSIONbumped (MkwVkHostorMkwVkRendereringpu/vk/vk_api.hchanged).mainand here, for a change that shows on screen. (the tab is new: here only)docs/dev/reference/progress-tab.md)Assisted-by:/Co-Authored-By:trailers.🤖 Generated with Claude Code
Tested in game: Windows 11, RTX 5080, driver 617.42: the tab on a save at Lake Hylia, French and English menus, Left/Right/Enter; same counts as the launcher's page
The tab in the game (Windows 11, RTX 5080, French menu), on a save at Lake Hylia, Show set to what is left so far: the story's next step, then Lake Hylia first (here), each line's value cell saying what it gives, takes or still misses.
@HumanBean a question for you before this leaves WIP: the tab needs the same catalogue as the launcher's Progress page (LongshotLauncher#366), at
assets/progress/catalogue.tsv. It holds hand-written French and English words, the hashes of field names and the 64-bit IDs of placements, and no game file. You said names and IDs are fine for the launcher; is that OK for the Longshot repository too? If not, the tab could read the catalogue the launcher already installs instead of shipping its own.Replaced by #2957, as HumanBean asked: the same Progress list as a window of its own (F2, or Plus and B) in mod-api, a system mod; the catalogue shipped there with the game's flag names;
flags.getMany,flags.placementsandgame.state().savedPlacein the mod API; and two modtool ops so the launcher's Progress page asks Longshot instead of keeping its own copy. Closing this one.Pull request closed