-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wind Waker: Allow users to refresh, save/load, or share cutscene scenes at a specific point in time #726
base: master
Are you sure you want to change the base?
Conversation
Wind Waker uses this to save/load the paused state when playing demos
@magcius The main alternative to what I've done here would be to have WW demos have their own pause state, so the demos could be paused even if noclip is still reporting deltaTimes (and could also pause non-demo actors). But I think it makes more sense to use the master play/pause functionality and just expose that to the save/load state system. Thoughts? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I see the utility of this? At one point I had the time and pause state in the save state, but removed it since people would get linked to a paused save state and end up confused.
For developing, it's super useful to be able to save/load from a specific time in a cutscene (and it needs to load as paused to be useful). For users, I could see utility in being able to share an interesting point in a cutscene. I wouldn't want to add time and pause state to all save states, but it feels important for demos. |
I'd be OK with something that saves the current pause state and time to localStorage if IS_DEVELOPMENT is enabled, and this could be done across all scenes if wanted, but I wouldn't want it on by default, and I don't think I'm ready to have it in a savestate yet. |
Oh wow I never knew about IS_DEVELOPMENT. Good thinking, that should work well for my purposes. |
…class No logic changes, this just moves all of those variables into a single class. This also does not change how individual scenes access the time data. E.g. `ViewerInput.time` and `ViewerInput.deltaTime` are unchanged
… override the pause state
`time` is now public, so it doesn't make much sense for that function to exist
…t only) Demo scenes will save their time/pause state when the demo is paused. If the page is reloaded (or code is modified), the scene will reload at the same time and maintain the paused state. If the demo is resumed, the time/pause state is cleared. Reloading will then restart the demo. Very useful for debugging.
I've updated this PR so that the scene's time/pause state is not included in the savestate. If requested, a scene can save and load the time/pause state to localStorage. ZWW demo scenes are currently the only scenes that do this. Changes for all scenes:
Changes for ZWW demo scenes:
|
The current demo time and pause state are now added to the save state string.
This allows users to refresh, save/load, or share demo scenes at a specific point in time. Since the pause state is also captured, if the demo was paused it will still be paused on load. This is also very useful for debugging. Pausing during certain actor animations will save the state, and then subsequent code changes will trigger refreshes which will load the demo back into the same state.
The big change here is that we need to a way to expose to the scene a way to play/pause noclip. I've done that by exposing the
UI.togglePlayPause()
method because of its simplicity, but there are several other alternatives.