fix(saves): the save script's Windows default for Longshot is the launcher's %APPDATA%\Longshot\save #1397

Open
mooki wants to merge 1 commit from mooki/Longshot:saves-windows-default into main
Member

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's Core/Saves.cs, launcher PR 43, Longshot PR 1269). scripts/longshot_saves.py still looked for Longshot's save only in the game folder, %USERPROFILE%\Games\Longshot\user\save, so for that player list and export say "no Longshot save found" and an import into 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, run python -I scripts\longshot_saves.py list, then python -I scripts\longshot_saves.py import hookshot
Expected: list shows Longshot's save in %APPDATA%\Longshot; the import goes there
Actual: list says Longshot: no Longshot save found (looked in C:\Users\<you>\Games\Longshot); the import makes Games\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%\Longshot is looked in first (its save\<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_folder makes Longshot's save at <launcher folder>\save\<user id>, and a folder named with --longshot or --hookshot on Windows is a game folder (user\save\<user id>) or, with a save folder and no user one, a folder the game was started with --user (save\<user id>); the new old_folder_note is printed by side (import, export) and list; the module docstring and --longshot's help say the new defaults.
  • tests/test_longshot_saves.py: a WindowsDefault class (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, --longshot with 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 --longshot row, where a new save is made, the troubleshooting row.
  • Unchanged on purpose: 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 --strict through the idle gate in a fresh worktree and home, on this head (5e26d2c36) and on main (544229a26): 660 passed, 44 failed, 17 skipped on both, the same 44 on both, so none is caused by this change; test_longshot_saves.py and test_doc_anchors.py pass on both. The 44 on main too, 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 on main (8 failures and 1 error before the change) and pass here. They run the Windows folder rules on Linux by switching WINDOWS on and pointing APPDATA, LOCALAPPDATA and USERPROFILE into 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 WINDOWS switched on and the environment pointed at a temporary folder, so real backslash paths, %APPDATA% resolution, a junction in a save and a portable launcher's LongshotLauncher-data\user named with --longshot are untried.

Must be tested:

  • Windows 10 or 11, any GPU, Longshot Launcher (nightly) installed with a save made by it: with Longshot closed, from a clone of this branch run python -I scripts\longshot_saves.py list, expecting Longshot: C:\Users\<you>\AppData\Roaming\Longshot with the save's <user id> folder and its slots and no line about "the old game folder" (before this change it said no Longshot save found (looked in C:\Users\<you>\Games\Longshot): that is the bug), then python -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).
  • Windows, a PC with only the old game folder: with the 2.x builder's save in %USERPROFILE%\Games\Longshot\user\save\<user id> and no launcher save, run python -I scripts\longshot_saves.py list, expecting that save found and a "note:" line naming %APPDATA%\Longshot\save and saying the launcher moves it in (by hand).
  • Windows, a portable launcher: run python -I scripts\longshot_saves.py list --longshot "<its folder>\LongshotLauncher-data\user", expecting its save\<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

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what
    can't be run by hand is in Testing's Not testable by hand, with why.
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and
    in Risks.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named). (Named under Tested: the same 44 tests fail on main @ 544229a26 and on this branch; none is branch-only.)
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • A check under tests/ that reads changed source updated in this PR, not weakened. (test_windows_import_into_the_game_folder became test_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 into user\save\<user id>; ten new checks cover the new default.)
  • A game-free test added for the fix, failing on main and passing here.
  • Docs updated.

New on this forge; not opened on GitHub.

**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's `Core/Saves.cs`, launcher PR 43, Longshot PR 1269). `scripts/longshot_saves.py` still looked for Longshot's save only in the game folder, `%USERPROFILE%\Games\Longshot\user\save`, so for that player `list` and `export` say "no Longshot save found" and an `import` into 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, run `python -I scripts\longshot_saves.py list`, then `python -I scripts\longshot_saves.py import hookshot` **Expected:** `list` shows Longshot's save in `%APPDATA%\Longshot`; the import goes there **Actual:** `list` says `Longshot: no Longshot save found (looked in C:\Users\<you>\Games\Longshot)`; the import makes `Games\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%\Longshot` is looked in first (its `save\<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_folder` makes Longshot's save at `<launcher folder>\save\<user id>`, and a folder named with `--longshot` or `--hookshot` on Windows is a game folder (`user\save\<user id>`) or, with a `save` folder and no `user` one, a folder the game was started with `--user` (`save\<user id>`); the new `old_folder_note` is printed by `side` (import, export) and `list`; the module docstring and `--longshot`'s help say the new defaults. - `tests/test_longshot_saves.py`: a `WindowsDefault` class (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, `--longshot` with 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 `--longshot` row, where a new save is made, the troubleshooting row. - Unchanged on purpose: `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 --strict` through the idle gate in a fresh worktree and home, on this head (5e26d2c36) and on `main` (544229a26): **660 passed, 44 failed, 17 skipped on both, the same 44 on both**, so none is caused by this change; `test_longshot_saves.py` and `test_doc_anchors.py` pass on both. The 44 on `main` too, 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 on `main` (8 failures and 1 error before the change) and pass here. They run the Windows folder rules on Linux by switching `WINDOWS` on and pointing `APPDATA`, `LOCALAPPDATA` and `USERPROFILE` into 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 `WINDOWS` switched on and the environment pointed at a temporary folder, so real backslash paths, `%APPDATA%` resolution, a junction in a save and a portable launcher's `LongshotLauncher-data\user` named with `--longshot` are untried. **Must be tested:** - Windows 10 or 11, any GPU, Longshot Launcher (nightly) installed with a save made by it: with Longshot closed, from a clone of this branch run `python -I scripts\longshot_saves.py list`, expecting `Longshot: C:\Users\<you>\AppData\Roaming\Longshot` with the save's `<user id>` folder and its slots and no line about "the old game folder" (before this change it said `no Longshot save found (looked in C:\Users\<you>\Games\Longshot)`: that is the bug), then `python -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). - Windows, a PC with only the old game folder: with the 2.x builder's save in `%USERPROFILE%\Games\Longshot\user\save\<user id>` and no launcher save, run `python -I scripts\longshot_saves.py list`, expecting that save found and a "note:" line naming `%APPDATA%\Longshot\save` and saying the launcher moves it in (by hand). - Windows, a portable launcher: run `python -I scripts\longshot_saves.py list --longshot "<its folder>\LongshotLauncher-data\user"`, expecting its `save\<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 - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what can't be run by hand is in Testing's Not testable by hand, with why. - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and in Risks. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). (Named under Tested: the same 44 tests fail on `main` @ 544229a26 and on this branch; none is branch-only.) - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. (`test_windows_import_into_the_game_folder` became `test_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 into `user\save\<user id>`; ten new checks cover the new default.) - [x] A game-free test added for the fix, failing on `main` and passing here. - [x] Docs updated. New on this forge; not opened on GitHub.
fix(saves): the save script's Windows default for Longshot is the launcher's %APPDATA%\Longshot\save
All checks were successful
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 9s
CI / Workflow lint (actionlint) (pull_request) Successful in 12s
Guide screenshots / Guide images and local UI source review (pull_request) Successful in 13s
Website / Website on Cloudflare (pull_request_target) Has been skipped
Third-party parts / As their notes say (pull_request) Successful in 16s
PR description / Description follows the template (pull_request_target) Successful in 8s
5e26d2c368
On Windows longshot_saves.py looked for Longshot's save only in the game folder (%USERPROFILE%\Games\Longshot\user\save), but the
launcher starts every build with --user %APPDATA%\Longshot and keeps the one shared save in its save\<user id> (docs/saves.md,
LongshotLauncher Core/Saves.cs, #43, #1269). So a launcher player's save was "not found" and an import went to a folder the game
does not read.

The launcher's folder is now the default (found, and made when a save is copied in), and the old game folder is still looked in
after it: when the save it uses is there, or both have one, the script says so and where the launcher keeps it. --longshot takes
the launcher's folder, a portable launcher's user folder (save\<id>) or a game folder (user\save\<id>). Hookshot's default and
Linux are unchanged.

Assisted-by: Claude Sonnet 5.5
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
mooki changed title from WIP: fix(saves): the save script's Windows default for Longshot is the launcher's %APPDATA%\Longshot\save to fix(saves): the save script's Windows default for Longshot is the launcher's %APPDATA%\Longshot\save 2026-11-17 11:28:50 +00:00
Collaborator

Possibly related, for context:

  • issue #639 Saves: Every time I launch the game, the save folder gets moved and the game thinks there is no saves and I have to move it back — Related Windows save-folder moves and launcher migration behavior
Possibly related, for context: - issue #639 Saves: Every time I launch the game, the save folder gets moved and the game thinks there is no saves and I have to move it back — Related Windows save-folder moves and launcher migration behavior
Owner

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).

  • Tested on my own PC: ticked: Testing's Tested: the author ran the save script checks on Linux with Python 3.14 and the suite.
  • Nothing gets worse that I know of: ticked: A command-line tool with a one-line reason for no measurement, and Risks names no slowdown or memory cost.
Brought up to the [ready-for-review standard](https://git.magicbean.dev/MagicBeanDev/Longshot/src/branch/main/CONTRIBUTING.md#ready-for-review-out-of-wip) (#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). - *Tested on my own PC*: ticked: Testing's Tested: the author ran the save script checks on Linux with Python 3.14 and the suite. - *Nothing gets worse that I know of*: ticked: A command-line tool with a one-line reason for no measurement, and Risks names no slowdown or memory cost.
All checks were successful
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 9s
CI / Workflow lint (actionlint) (pull_request) Successful in 12s
Guide screenshots / Guide images and local UI source review (pull_request) Successful in 13s
Website / Website on Cloudflare (pull_request_target) Has been skipped
Third-party parts / As their notes say (pull_request) Successful in 16s
PR description / Description follows the template (pull_request_target) Successful in 8s
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'saves-windows-default:mooki-saves-windows-default'
git switch 'mooki-saves-windows-default'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
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/Longshot!1397
No description provided.