fix(saves): the save script's Windows default for Longshot is the launcher's %APPDATA%\Longshot\save #1397
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1397
Loading…
Reference in a new issue
No description provided.
Delete branch "mooki/Longshot:saves-windows-default"
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: fix · Risk: low · Tested on: Linux, Python 3.14, game-free checks with the Windows rules switched on (no Windows PC) · Needs: Windows
Why
On Windows a player who uses the launcher keeps one shared save in
%APPDATA%\Longshot\save\<user id>\: the launcher starts every build with--user %APPDATA%\Longshot(docs/saves.md, the launcher'sCore/Saves.cs, launcher PR 43, Longshot PR 1269).scripts/longshot_saves.pystill looked for Longshot's save only in the game folder,%USERPROFILE%\Games\Longshot\user\save, so for that playerlistandexportsay "no Longshot save found" and animportinto Longshot goes to a folder the game never reads. The script's guide told them to pass--longshot <game folder>, which is not where their save is.How to reproduce
Seen on: reproduced on Linux with the Windows rules switched on in the tests; not run on a Windows PC here (expected on Windows with the Longshot Launcher, any GPU)
Settings and switches: defaults
Steps: play once with the launcher so
%APPDATA%\Longshot\save\<user id>\exists, close the game, runpython -I scripts\longshot_saves.py list, thenpython -I scripts\longshot_saves.py import hookshotExpected:
listshows Longshot's save in%APPDATA%\Longshot; the import goes thereActual:
listsaysLongshot: no Longshot save found (looked in C:\Users\<you>\Games\Longshot); the import makesGames\Longshot\user\save\<user id>(or refuses when that folder is not there)What changed
The launcher's folder is now Longshot's Windows default:
%APPDATA%\Longshotis looked in first (itssave\<user id>is found as on Linux) and is where a save copied in goes when there is none yet, made if needed as the Linux data folder is. The old game folder is still looked in after it, so nothing that was found is lost, and the script says so: when the save it uses is in the old game folder, or both have one (the launcher's is used and the old one named, with how to use it), the line says where the launcher keeps it and that the launcher moves old ones in when it opens. Linux and Hookshot's defaults are unchanged.scripts/longshot_saves.py:LONGSHOT's Windows folders["{appdata}/Longshot", "{home}/Games/Longshot"];new_save_foldermakes Longshot's save at<launcher folder>\save\<user id>, and a folder named with--longshotor--hookshoton Windows is a game folder (user\save\<user id>) or, with asavefolder and nouserone, a folder the game was started with--user(save\<user id>); the newold_folder_noteis printed byside(import, export) andlist; the module docstring and--longshot's help say the new defaults.tests/test_longshot_saves.py: aWindowsDefaultclass (10 checks: the order of the folders, the launcher's save found and nothing said, the old folder found and said, both, nothing found names both places, a fresh copy goes to the launcher's folder, a copy goes where the save already is,--longshotwith a game folder, a user folder and an empty one, Hookshot keeps its game folder, Linux says nothing), and the old Windows import test now names its game folder with--longshot.docs/saves-script.md: the Windows rows of "Where Longshot keeps them" (with the launcher, and before it), the Windows paragraph, the--longshotrow, where a new save is made, the troubleshooting row.docs/saves.md(already right since PR 1269), the launcher, Hookshot's Windows folder (%USERPROFILE%\Games\Hookshot, its version folders), the backups (%LOCALAPPDATA%\Longshot\oot-save-backups, as the launcher).Measurements
Verdict: nothing to measure: a command line tool that never runs with the game and is in no build; no speed claim is made.
Flags and settings
None.
Testing
Tested:
python -I -B tests/test_longshot_saves.py(73 checks, 10 new),tests/test_doc_anchors.py,tests/run_all.py longshot_saves doc_anchors, on Linux with Python 3.14 and warnings as errors. The whole suite,tests/run_all.py --jobs 6 --strictthrough the idle gate in a fresh worktree and home, on this head (5e26d2c36) and onmain(544229a26): 660 passed, 44 failed, 17 skipped on both, the same 44 on both, so none is caused by this change;test_longshot_saves.pyandtest_doc_anchors.pypass on both. The 44 onmaintoo, in a temporary worktree (Tooling is not beside it, fixtures that compile need build state a fresh worktree lacks, one needs this PC's CPU build): test_bug_report.py, test_bug_report_defaults.py, test_cpu_report.py, test_crash_groups.py, test_crash_record.py, test_crt_options.py, test_damage_debug_menu.py, test_display_startup_failure.py, test_dlss_feature_size.py, test_failed_compile_keeps_objects.py, test_framegen_preset.py, test_fsr_uniform_ownership.py, test_guest_imported.py, test_hardware_report.py, test_hud_layout_row.py, test_import_reach.py, test_invalidate_vcore.py, test_linux_preflight.py, test_linux_pressure.py, test_linux_update.py, test_mirror_budget.py, test_missing_nup.py, test_mods_size_table.py, test_nonuniform_image_arrays.py, test_parallel_init_order.py, test_pending_guest_import.py, test_pipeline_play_cache.py, test_present_thread.py, test_profiling_mode.py, test_readback_timeout_source.py, test_replay_write_order.py, test_rumble_menu.py, test_run_all_changed.py, test_slow_frames.py, test_staging_burst.py, test_switch_table.py, test_target_image_pool.py, test_tested_configurations.py, test_upscaler_round_trip.py, test_upscaler_rows.py, test_vcore_escape.py, test_vk_occlusion_queries.py, test_vk_swapchain_compat.py, test_walk_key.py. The new checks fail onmain(8 failures and 1 error before the change) and pass here. They run the Windows folder rules on Linux by switchingWINDOWSon and pointingAPPDATA,LOCALAPPDATAandUSERPROFILEinto a temporary folder, as the file's other Windows checks do.Not tested: Windows. Nobody has run this on a Windows PC: the checks run the Windows folder rules on Linux with
WINDOWSswitched on and the environment pointed at a temporary folder, so real backslash paths,%APPDATA%resolution, a junction in a save and a portable launcher'sLongshotLauncher-data\usernamed with--longshotare untried.Must be tested:
python -I scripts\longshot_saves.py list, expectingLongshot: C:\Users\<you>\AppData\Roaming\Longshotwith the save's<user id>folder and its slots and no line about "the old game folder" (before this change it saidno Longshot save found (looked in C:\Users\<you>\Games\Longshot): that is the bug), thenpython -I scripts\longshot_saves.py export hookshot --dry-run --backup-dir %TEMP%\oot-backups, expecting "Would copy" from...\AppData\Roaming\Longshot\save\<user id>and "Dry run: nothing was changed" (by hand, one person, Python 3 on the PATH).%USERPROFILE%\Games\Longshot\user\save\<user id>and no launcher save, runpython -I scripts\longshot_saves.py list, expecting that save found and a "note:" line naming%APPDATA%\Longshot\saveand saying the launcher moves it in (by hand).python -I scripts\longshot_saves.py list --longshot "<its folder>\LongshotLauncher-data\user", expecting itssave\<user id>and its slots (by hand).Risks
What could break: only the script's Windows discovery for Longshot. A player with saves in both folders now gets the launcher's, where before they got the game folder's (the old one is named in the output and
--longshot <old folder>picks it); that matches what the launcher keeps and gathers. An import into a PC with neither makes%APPDATA%\Longshot\save\<user id>where it used to need a game folder: the launcher and the game started by it read that folder.Turning it off: revert the commit.
Compatibility: Nothing changes on Linux or for Hookshot. On Windows the script's default moves to the launcher's folder with the old one still found.
Checklist
Everyone
type(scope): description) of the status line's type.can't be run by hand is in Testing's Not testable by hand, with why.
in Risks.
main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named). (Named under Tested: the same 44 tests fail onmain@544229a26and on this branch; none is branch-only.)third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.tests/that reads changed source updated in this PR, not weakened. (test_windows_import_into_the_game_folderbecametest_windows_import_into_a_game_folder_named_with_longshot: the game folder is now named with--longshot, and the check still asserts the same copy intouser\save\<user id>; ten new checks cover the new default.)mainand passing here.New on this forge; not opened on GitHub.
WIP: fix(saves): the save script's Windows default for Longshot is the launcher's %APPDATA%\Longshot\saveto fix(saves): the save script's Windows default for Longshot is the launcher's %APPDATA%\Longshot\savePossibly related, for context:
Brought up to the ready-for-review standard (#1454): the checklist's Everyone list has two new boxes, added here from what this PR's description and comments show (please check they match what you know).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.