feat(gameplay): a story-safe New Game+, off by default #1654
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1654
Loading…
Reference in a new issue
No description provided.
Delete branch "TrashPanda/Longshot:feat/new-game-plus"
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
Longshot has no New Game+: a second playthrough starts from three hearts and an empty wallet. This adds one that
leaves the story untouched, off by default. Turning it on warns that it can't be undone, backs the save up, and makes
that save New Game+ for good. After the credits, the next new file starts with the hearts, wallet and rupees you
finished with; bigger bags arrive when the story hands you the bag, and enemies hit harder each cycle. Each run is
timed, split at every dungeon. No story item, song or flag is ever given or written, since the story gates on items
(ocarinas, songs, the Master Sword, each dungeon's item). No issue asks for it (searched "New Game+" and "ngplus"); the
design is in
docs/dev/reference/new-game-plus.md.Read first:
host/oot_ngplus.c/.h:hos_ngplus_tickruns from Link's update undercheats_lock; it records a clear, makesthe once-only grant on a fresh file, gives deferred bag sizes on the story bag's 0-to-1 change, and times the run.
ngplus_carryis the only list of names it may give andng_giverefuses anything else;NgOpshas no flag writer.Everything is given through the game's own item event, as a chest or boss does, so the game saves it as a pickup.
host/hos_main.coot_ngplusfillsNgOps(oot_pouch_count/oot_pouch_change, the GameData readers,hos_atomic_write;oot_gamedata_intis new, read only).host/oot_damage.c: while the Debug tab's Damage taken isNormal, a New Game+ file's step applies (Double at New Game+ 1, Quadruple from 2, or the difficulty row's); heart
protection still wins.
gpu/vk/menu/ngplus.cpp: the Gameplay rows New Game+, New Game+ difficulty and Record New Game+ gear,after Skip opening, with a status line (clears, cycle, this run's time, best run, latest split). The row's
lockedhook refuses Off once the save is New Game+;
vk_menu.cppshows the warning for Off to On (the Debug tools' dialog,reused). Saved keys
new_game+andnew_game+_difficultyare frozen intests/test_menu_ini_keys.py; option idsHOS_OPT_NGPLUS*72 to 74 go through the existing option callback, so no API version bump.IsGameClear), the ending's flagSequence_ToTitleFromGameClear, or by hand (Record, on a file with Ganon's Castle's barriers cleared). The recordis
user/ngplus.json; the backup isuser/ngplus-backup/<date>_<time>/, and a failed backup grants nothing.Testing
Tested: in the game on Linux (Ubuntu 26.04, kernel 7.0), RTX 4070 Ti, NVIDIA 595.99.02,
main@9dff58e6with thisbranch, each run in its own
--userfolder on copies of saves, driven through the control bridge:cycle 1: max life 80, wallet 2, rupees 1000, bags 3 3 3, backed it up andlocked it (
"locked":1), nothing given; turning it Off was refused (new_game+ 1 -> 1 (On, for good)).assets/saves/kokiri-start) then got 17Obj_Heart_Container(20 in all),Item_Wallet_Largeand fiveObj_Rupee_Goldonce, after the backup; the bridge read life 80 of 80 and 1000 rupees, and the autosave keptMaxLife80,CurrentRupee1000 and the wallet'sIsGet. A restart gave nothing twice. Leaving the house playedSaria's meeting as usual. Two debug teleports kept it all; a teleport into Dodongo's Cavern logged its split.
"granted":1). No record, On: nongplus.json, no backup, the row back to Off.MaxLifeandCurrentRupeedirectly; the game put hearts back and saved rupees as 0, whichis why this gives pickups instead.
Since then the branch was rebased onto
main@0de25c3e(#1774's menu modules: the rows moved intogpu/vk/menu/ngplus.cppunchanged, checked by compiling and the game-free checks, not in the game) and now onto068fb8eb(the design page moved todocs/dev/reference/, no code change).tests/test_ngplus.pycompiles the moduleagainst a pretend game over eight restarts: no story item in the list, no flag writable, the grant once and not when
the marker can't be written, deferred bags, clamps, the ending's flag, Record, a corrupt
ngplus.jsonleft byte forbyte, backup first, splits, and the lock, each also shown failing on a broken copy. It and the full suite haven't been
run on this head yet; CI runs them on this push.
Still to test:
expecting the warning, then "On, for good" after Make it New Game+, and Off refused (by hand).
granted file (the Kokiri Sword then the Deku Tree, Saria's ocarina, Zelda and the Ocarina of Time, the Door of Time,
the Skulltula House's wallet reward, Dodongo's Cavern's Bomb Bag for the deferred size), expecting every chest to
open, every character to speak and nothing given twice or locked out (by hand).
kokiri-startwith New Game+ on and a recorded clear, expecting 20 hearts, the Giant's Walletand 1000 rupees, and
ngplus:lines inlongshot_log.txt(@Beanstalk windows: New Game+ on kokiri-start with arecorded clear).
Measurements
Nothing to measure for speed: off by default, and on it costs a few flag reads twice a second at Link's update; what it gives is in Testing.
Risks
An item given early could in theory change a story event: the Giant's Wallet sets
IsGet.Item_Wallet_Largeas apickup does, and the Skulltula House's reward may check it. The list is fixed and small, and the story pass in Still to
test is there to move anything that fails to "never". The row is Off by default; once a save is New Game+ the row
can't turn it off (the warning says so), and going back is restoring
user/ngplus-backup/<date>_<time>/by hand. Whatwas given stays as ordinary inventory. After updating nothing changes unless a player turns it on:
user/ngplus.jsonappears only then, saves are untouched until a granted file is played, and the caches and the vk interface don't
change.
Checklist
Ready for review
main; the title is a Conventional Commit.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. (The game's are attached; the menu rows' and the warning's are still to take.)Assisted-by:/Co-Authored-By:trailers.Tested in game: RTX 4070 Ti, NVIDIA 595.99.02, Ubuntu 26.04 (kernel 7.0), main @
9dff58e6+ this branch as a pack: a 100% save's slot recorded cycle 1 (20 hearts, Giant's Wallet, 1000 rupees, biggest bags); kokiri-start then got 17 heart containers, the Giant's Wallet and 5 gold rupees through the item event (life 80/80, 1000 rupees); all 20 hearts full on the HUD after leaving Link's house, Saria's meeting played normally; the autosave kept 80 hearts and the wallet; a restart granted nothing twice. Not yet seen: rupees in an autosave, the credits live, the bags and the damage step in play.New commit 38b381f8: the saves are copied to user/ngplus-backup/_
38b381f8da01714c2bb1mooki referenced this pull request2026-11-19 02:05:59 +00:00
Turning the New Game+ row On now asks first ("Make this save New Game+?"), then backs the save up to user/ngplus-backup and marks it New Game+ for good ("locked" in user/ngplus.json). After that the row reads "On, for good" and Off is refused, also when the options file is set back by hand. - A finished save is recorded and locked; its next new game gets the gear. - Any other save is topped up at once to what it lacks (wallet, hearts, rupees), never taken from. - With no finished game recorded, or a backup that fails, nothing is written and the row goes back to Off. Tested in the game (Linux, RTX 4070 Ti): a finished 100% save locked with its backup and Off refused; a new game on it given the Giant's Wallet, 20 hearts and 1000 rupees once; an older unlocked record locked and its gear given in play; no record left the row Off and wrote nothing. Co-Authored-By: Claude Opus 5.5 <[email protected]>Pushed
bba77f43: New Game+ is now a switch on the save. Turning it on asks first, backs the save up touser/ngplus-backup, and marks the save New Game+ for good ("locked":1); Off is refused after that. A save in play gets what it lacks at once; a finished save gets its grant on the next new game. With no clear recorded or a failed backup, nothing is written and the row goes back to Off.Tested in the game on Linux, RTX 4070 Ti: the five cases are in Testing.
tests/test_ngplus.pycovers the lock and catches five broken copies;run_all.py --changedhas no new failures. Still to do: the rebase onmain, and a screenshot of the warning.bba77f43b26654ebcb04Rebased on
main@0de25c3eand squashed to one commit (6654ebcb). #1774 moved every Insert menu row into a feature module, so New Game+'s three rows are nowgpu/vk/menu/ngplus.cpp, with the same texts and saved keys (new_game+,new_game+_difficulty, now intest_menu_ini_keys.py's FROZEN). Off on a New Game+ save is refused through the model'slockedhook (row_fixed), so the control bridge refuses it too; the warning and the reports stay invk_menu.cpp.Checked:
vk_menu.cppand the module compile with the build's flags;python -I -B tests/run_all.py: 726 passed, 43 failed, every failure also failing onmain@0de25c3e. Not run in the game again after the port; the in-game runs in Testing are from before it.WIP: feat(gameplay): a story-safe New Game+, off by defaultto feat(gameplay): a story-safe New Game+, off by default6654ebcb04553f25b59eView command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.