feat(control): a live map of Link, the area's collectibles and the 100%, on 127.0.0.1 #1655
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!1655
Loading…
Reference in a new issue
No description provided.
Delete branch "TrashPanda/Longshot:feat/live-map"
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
On the Switch, the ZELDA NOTES phone app gives this game a live map: where Link is, which chests and Gold Skulltulas
are still out there in the area, and how near the save is to 100%. It needs a Nintendo Account and Nintendo's servers,
and Longshot keeps the game offline, so players here have none of it. This adds a small page on your own PC that does
the same from the running game (through the control bridge) and your save (through #1401's save editor). See #582.
Read first:
scripts/longshot_map.py(new): serves the page on 127.0.0.1 only (serve()refuses any other address).follow()subscribes to the bridge'sootsamples and resubscribes with the area's chest flags (at most 64) whenLink enters a new area.
Trackkeeps the latest sample and a trail per map.Collectiblesloadsscripts/longshot_save_editor.py(#1401) as a library: the area's chests, Gold Skulltulas,heart pieces and containers with their places, and the save's 100%. A live chest flag overrides the save; Gold
Skulltulas and most heart pieces follow the newest slot (or
--slot), re-read when it changes.tests/test_longshot_map.py(new): a fake bridge on a Unix socket, plus #1401's made-up game and saves.docs/dev/reference/control-bridge.md: The live map under The client, and a row in Tools.Nothing of the game is in the repository, and nothing the game runs changes.
Testing
Tested: in the game on Linux 7.0, RTX 4070 Ti, NVIDIA 595.99.02, a game folder built from
main, on an earlier headof the map commit (
6753f3916; since then only its doc paths and one unused import changed). Started withkokiri-startthrough
longshot_ctl.py launch, ranlongshot_map.py --game <game folder> --save <its save>and walked with thebridge's
stick: the page followed Link inKokiriForest_Childand showed the area's 10 markers (7 chests, 3 GoldSkulltulas, matching #1401's catalogue), the bridge returned the 7 chest flags live, and the page read the slot the game
had just written: 0.6% (5/857). On the previous head
tests/test_longshot_map.py(8 cases), #1401's checks,tests/test_doc_anchors.pyand ruff passed. The checks and the full suite haven't been run on this head yet; CI runsthem on this push.
Still to test:
longshot_ctl.py launch <game folder>), runpython -I scripts/longshot_map.py --game <game folder>, open http://127.0.0.1:8765/, walk and open a chest,expecting Link's marker to move, the area's markers to appear and the opened chest to turn to an outline (by hand:
the Test Farm can't look at the page).
(by hand).
Measurements
Nothing to measure: a script that reads the bridge from outside the game; its only in-game cost is the bridge's existing
ootsampling (10 a second, up to 64 flags).Risks
Only the script itself can break: it reads the bridge and the save and writes nothing. If #1401 reshapes an entry's
wheretext or the names the script uses, the markers drop out while the map and trail still work. Don't run it, orrevert, to be rid of it. Nothing changes for a player who doesn't run it.
Checklist
Ready for review
main; the title is a Conventional Commit. (Stacked on #1401.)mise run testpasses (any failure that also fails onmainis named). (Not run on this head yet; CI's run on the push.)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
tests/that reads changed source is updated, not weakened.mainand here, for a change that shows on screen. (A new page: there is nomainpicture.)Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.--json prints one JSON object on stdout and nothing on stderr: for set, clear, give, start and copy what changed, the files written, the backup folder and a read-back verdict; for items and places the lists; for report a schema version. A refusal is {"ok": false, "error": {"code", "message"}} with a code a program can switch on (running, other_version, out_of_range, would_overwrite ...). The text output is unchanged. docs/save-editor.md has the keys and the codes. Assisted-by: Claude Sonnet 5.5 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>Tested in game: RTX 4070 Ti, NVIDIA 595.99.02, Linux 7.0: kokiri-start save, KokiriForest_Child. The page followed Link and showed the area's 10 markers (7 chests, 3 Gold Skulltulas); the bridge returned the 7 chest flags live; it read the slot the game had just written (0.6%, 5/857). No chest was opened in the run.
Possibly related, for context:
6753f3916528f744621bPushed
28f74462: rebased onto #1401's new head18e81a6c6, with that stack replayed unchanged onto currentmain(mooki's 16 commits keep their author). The map's commit is unchanged. Its 8 checks and #1401's 88 pass on the new head; the whole suite was not run again after the rebase (the description says so). The description now points at the new commits and has the checklist's two new boxes. Marking ready for review.WIP: feat(control): a live map of Link, the area's collectibles and the 100%, on 127.0.0.1to feat(control): a live map of Link, the area's collectibles and the 100%, on 127.0.0.128f744621bbabaf7a9e7Pushed
babaf7a9: rebased onto #1401's new headdce4dc389(on main after the docs revamp, #1802). The map's commit only follows the moves: its docs section is now indocs/dev/reference/control-bridge.md(with a row in Tools), the script's references point at the moved guides, and one unused import ruff found is gone. The map's 8 checks, #1401's editor checks and the doc anchors pass, and ruff 0.12.0 passes on both new files; the whole suite was not run again. The description is moved to the new template.babaf7a9e78794fd4850View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.