[Enhancement] Persist entrance and respawn information in saves #890
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pause saves almost already worked well enough, but shared grottos and cutscene entrances made that a no-go. This PR addresses those hurdles.
RespawnData
toShipSaveInfo
, using it to persistgSaveContext.respawn
. This affects multiple things. The most obvious is that it maintains respawn information, i.e. where a player will reload if they die. Less obvious is that this data is also used to handle shared grotto scenes, their chest contents, and their exit destinations. Persisting this allows pause saves to work from within grottos.OnPassPlayerInputs
as the entry point for unregistering the entrance cutscene skip hook. This seemed like the best existing hook to say "the player has assumed control, so don't skip any more cutscenes now". I tested various combinations of loading an entrance cutscene save and trying other cutscenes, as well as loading a non-entrance cutscene save and trying other cutscenes. This seems to work as I intended.SavingEnhancements_GetSaveEntrance
since this aims to remove the need for itThis has worked remarkably well from testing, both via resets and cold boots. However, there are hundreds of entrances in the game, so I welcome any additional eyes on this.
Build Artifacts