feat: add local achievement tracking and toasts #2307
Open
Varonal wants to merge 4 commits from
Varonal/codex/oot-achievements into main
pull from: Varonal/codex/oot-achievements
merge into: MagicBeanDev:main
MagicBeanDev:main
MagicBeanDev:github/pr/2893
MagicBeanDev:github/pr/2890
MagicBeanDev:github/pr/2887
MagicBeanDev:github/pr/2878
MagicBeanDev:github/pr/2875
MagicBeanDev:github/pr/2874
MagicBeanDev:github/pr/2873
MagicBeanDev:github/pr/2871
MagicBeanDev:github/pr/2756
MagicBeanDev:github/pr/2897
MagicBeanDev:github/pr/2896
MagicBeanDev:github/pr/2718
MagicBeanDev:github/pr/2842
MagicBeanDev:github/pr/2691
MagicBeanDev:github/pr/2895
MagicBeanDev:github/pr/2743
MagicBeanDev:github/pr/2765
MagicBeanDev:github/pr/2708
MagicBeanDev:github/pr/2732
MagicBeanDev:github/pr/2755
MagicBeanDev:github/pr/2817
MagicBeanDev:github/pr/2876
MagicBeanDev:release-please--branches--main
MagicBeanDev:release-please--branches--main--release-notes
MagicBeanDev:github/pr/2778
MagicBeanDev:github/pr/2888
MagicBeanDev:github/pr/2866
MagicBeanDev:github/pr/2877
MagicBeanDev:github/pr/2800
MagicBeanDev:github/pr/2829
MagicBeanDev:github/pr/2850
MagicBeanDev:github/pr/2889
MagicBeanDev:github/pr/2882
MagicBeanDev:github/pr/2860
MagicBeanDev:github/pr/2849
MagicBeanDev:github/pr/2886
MagicBeanDev:github/pr/2794
MagicBeanDev:github/pr/2840
MagicBeanDev:github/pr/2830
MagicBeanDev:github/pr/2834
MagicBeanDev:github/pr/2719
MagicBeanDev:github/pr/2742
MagicBeanDev:github/pr/2741
MagicBeanDev:github/pr/2820
MagicBeanDev:github/pr/2771
MagicBeanDev:github/pr/2859
MagicBeanDev:github/pr/2858
MagicBeanDev:github/pr/2823
MagicBeanDev:github/pr/2757
MagicBeanDev:github/pr/2769
MagicBeanDev:github/pr/2844
MagicBeanDev:github/pr/2843
MagicBeanDev:github/pr/2673
MagicBeanDev:github/pr/2855
MagicBeanDev:github/pr/2739
MagicBeanDev:github/pr/2807
MagicBeanDev:github/pr/2851
MagicBeanDev:github/pr/2789
MagicBeanDev:github/pr/2814
MagicBeanDev:github/pr/2818
MagicBeanDev:github/pr/2774
MagicBeanDev:github/pr/2772
MagicBeanDev:github/pr/2750
MagicBeanDev:github/pr/2786
MagicBeanDev:github/pr/2785
MagicBeanDev:github/pr/2782
MagicBeanDev:github/pr/2779
MagicBeanDev:github/pr/2775
MagicBeanDev:github/pr/2706
MagicBeanDev:github/pr/2766
MagicBeanDev:github/pr/2747
MagicBeanDev:github/pr/2759
MagicBeanDev:github/pr/2745
MagicBeanDev:github/pr/2740
MagicBeanDev:github/pr/2733
MagicBeanDev:github/pr/2725
MagicBeanDev:github/pr/2727
MagicBeanDev:github/pr/2728
MagicBeanDev:github/pr/2729
MagicBeanDev:github/pr/2721
MagicBeanDev:github/pr/2722
MagicBeanDev:github/pr/2715
MagicBeanDev:github/pr/2714
MagicBeanDev:github/pr/2707
MagicBeanDev:github/pr/2703
MagicBeanDev:github/pr/2705
MagicBeanDev:github/pr/2697
MagicBeanDev:github/pr/2679
MagicBeanDev:github/pr/2676
MagicBeanDev:github/pr/2669
MagicBeanDev:docs/what-hookshot-connects-to
MagicBeanDev:fix/hdr-encode-test
MagicBeanDev:fix/main-tests
MagicBeanDev:fix/play-cache-files
MagicBeanDev:perf/game-barrier-order
MagicBeanDev:feat/heap-lazy
MagicBeanDev:feat/texture-detail
MagicBeanDev:perf/astc-opaque-bc1
MagicBeanDev:fix/fs-dir-lock
MagicBeanDev:fix/framegen-native-kept
MagicBeanDev:fix/update-no-downgrade
MagicBeanDev:port/k10-gcn-f16-mirrors
MagicBeanDev:fix/framegen-mult-cap
MagicBeanDev:chore/release-as-2.1.1
MagicBeanDev:perf/pcache-load-switch
MagicBeanDev:fix/prepare-progress-log
MagicBeanDev:fix/update-closes-stale-game
MagicBeanDev:fix/hdr-scaled-sampled
MagicBeanDev:perf/first-start-preset
MagicBeanDev:perf/zero-upload
MagicBeanDev:fix/vcore-escape-2s
MagicBeanDev:test/fake-gh-atomic
MagicBeanDev:perf/batch-idle-flush
MagicBeanDev:test/finish-stub-a
MagicBeanDev:chore/record-2.1.0
MagicBeanDev:fix/main-red-tests
MagicBeanDev:fix/test-display-startup-driver-cache
MagicBeanDev:feat/mesh-shader-mode
MagicBeanDev:fix/menu-probes-at-startup
MagicBeanDev:fix/fps-counter-classic
MagicBeanDev:fix/test-log-batch-flake
MagicBeanDev:fix/narrow-screen-hud
MagicBeanDev:ci/prereleases
MagicBeanDev:release/v2.0.15
MagicBeanDev:hotfix/v2.0.15
MagicBeanDev:fix/present-ahead-replay
MagicBeanDev:release/v2.0.13
MagicBeanDev:fix/bracket-paths-2013
MagicBeanDev:fix/hdr-overlays-2013
MagicBeanDev:fix/fps-counter-scale-2013
MagicBeanDev:fix/stick-seen-at-rest
MagicBeanDev:hotfix/menu-fits-screen
MagicBeanDev:fix/f1-always-opens-menu
MagicBeanDev:fix/ini-keep-lines
MagicBeanDev:claude/cranky-pike-7cf247
MagicBeanDev:perf/texture-answer-flat
MagicBeanDev:fix/stamp-test-modules
MagicBeanDev:fix/appimage-fonts
MagicBeanDev:fix/display-awake
MagicBeanDev:release/v2.0.12
MagicBeanDev:fix/discord-windows
MagicBeanDev:rc/v2.0.12-tests
MagicBeanDev:fix/dlss-keep-feature
MagicBeanDev:rc/v2.0.12
MagicBeanDev:button-icons
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
autorelease: pending
autorelease: tagged
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
github_actions
Pull requests that update GitHub Actions code
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
question
Further information is requested
testing wanted
wontfix
This will not be worked on
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
2 participants
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/Hookshot!2307
Loading…
Reference in a new issue
No description provided.
Delete branch "Varonal/codex/oot-achievements"
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?
Why
Hookshot needs a local progress page and visible feedback for gameplay achievements, with progress stored separately from game saves.
What this PR contains
Remaining work
Validation
python -I nx2/build.py --standalone --jobs 2(RX_VK_ONLY=1).tests/test_fps_overlay_order.pyto cover a toast as the only visible overlay; tests and in-game validation have not been run in this update.Thanks for the work on this. The menu page and the toast queue are tidy. But several things have to change before it can merge. I covered the licensing, the build, the tests and the unlock triggers, and only skimmed the drawing code.
blocking
assets/oot-achievement-badges/*.png(~100 files) andassets/oot-achievement-badges.jsonare RetroAchievements badge images, downloaded frommedia.retroachievements.org(nx2/achievement_icons.pydownload()). The ones I opened are renders of Nintendo's characters and items (Zelda, the Iron Boots). They come with no license, so the project can't put them under the GPL. CONTRIBUTING says nothing derived from the game goes into the repository, and that third-party parts need a compatible license and aPROVENANCE.mdnote. These have neither. The titles and descriptions are also RetroAchievements' set, written by their community, so that needs the same question answered. Please drop the badge PNGs and the download script. Original icons, or generic ones built from what the repo already carries, would avoid the issue. Then check with the maintainers whether the RA titles and texts can be used at all.blocking Player builds would stop.
nx2/build.py:904runsachievement_icons.write()whenever it compiles the Vulkan back end.header()opensassets/oot-achievement-badges.json(nx2/achievement_icons.py:87) and raisesFileNotFoundErrorfor any missing PNG (line 81). The Windows builder's package copies only the trackedgpu,host,nx2,scriptsandthird_partyfolders, plusassets/pipeline_states/(scripts/release_parts.py:197,state_list). So a player's build there has neither the JSON nor the PNGs and stops.logo_rgbahandles the same situation by writing an empty header when its PNG is missing. Whatever replaces the badges needs either that fallback or to ship in the package.blocking
tests/test_fps_overlay_order.pyfails at this head. It cutsmenu_recordout ofvk_menu.cppand compiles it with stubs, and the newachievement_toast_visible/draw_achievement_toastaren't declared there (vk_menu.cpp:3797). It passes at this PR's base. Per AGENTS.md the check should be updated in this PR so it covers the toast as another thing that shows (one ImGui frame when only the toast shows). Don't weaken it. CI hasn't run here yet (only the title check), so it hasn't caught this.blocking Merge conflict with main in
gpu/vk/vk_api.h. Main is atMKWVK_API_VERSION 17. This PR only adds an enum (HOS_OPT_ACHIEVEMENT_BASE) and doesn't changeMkwVkHostorMkwVkRenderer, so the bump isn't needed: drop it when you rebase.should fix Several automatic unlocks don't match their descriptions:
oot_achievements.h:21) unlocks on anyItem_Bottle. Bottles come from several places.Item_Chick, which you have before meeting Zelda.OOT_ACH_MANUAL, buthost/hos_main.c:600unlocks it whenever the current map isKokiriForest_Child. That includes loading any child save there, as the comment admits.More generally, on first start with an existing save every item-based entry unlocks at once, and each toast lasts 4 s. Consider no toasts for the first pass after a save loads. Better still, unlock only the entries you've verified in the game: the description says in-game validation is still to be done, and the pouch names (
Armor_Adult_HeavyBoot,Item_RoyalLetter, ...) are unconfirmed.minor
achievement_toast_id(vk_menu.cpp:1060) is a plainint.menu_tickwrites it (line 3302) while the render thread reads it indraw_achievement_toast, which is a data race. Make itstd::atomic<int>, or read it underachievement_toast_mu.minor Screenshots of the page and the toast are needed (CONTRIBUTING, Commits and pull requests 5). The description should also open with why the PR is needed.
The earlier blockers are gone (no RetroAchievements assets or download, no API bump, atomic toast id), and
test_fps_overlay_ordercovers the toast. What's left is 98 rows named "Local Achievement NN" with nothing that can unlock them, plus leftovers: four unused probe names inoot_cheat_items.hand an unused declaration athost/hos_main.c:593. Whether a page with no working achievements should ship ahead of the triggers is a maintainer call. Screenshots would help either way.This now conflicts with main in
gpu/vk/vk_menu.cpp,host/hos_main.c. Could you merge main into the branch (or rebase) when you get a chance? I'll take another look once it's up to date.Thanks both for the careful follow-up and for taking another look. I’ll continue the achievement work and game testing locally on my fork, remove catalog entries without verified triggers, and resolve the branch conflicts as part of that work. I’ll push a commit and update the PR once I have a working, tested result, then ask for another review. I appreciate the thorough feedback.