KEMBAR78
MOHAWK: RIVEN: Fix autosave on exit during cutscene by macca8 · Pull Request #4820 · scummvm/scummvm · GitHub
Skip to content

Conversation

@macca8
Copy link
Contributor

@macca8 macca8 commented Mar 17, 2023

An issue exists where an autosave is performed when exiting the game during a cutscene, even though normal saving is disabled at this time.

When exiting the game during a cutscene, the game skips ahead to the first interactive frame outside the cutscene, then completes the exit.

Currently, the autosave is called after this change to the game state, creating the opportunity to complete an unexpected save that skips the unseen portion of the cutscene.

Fixed by repositioning the saveAutosaveIfEnabled() call to a position before the game state is changed, ensuring the autosave is always attempted based on the game state, and save condition, existing at the time the exit call is initiated.

In this example, the autosave fails to complete, as expected.

Fixes bug 11440.

Reposition autosave call to precede any changes to game state that follow the exit call.
Copy link
Member

@lephilousophe lephilousophe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but I didn't test it.

@antoniou79
Copy link
Contributor

If I understand correctly:
Before PR:

  1. The game saves at the exact scene where the player was when exiting, if autosave is enabled (regardless of autosave interval).
  2. Except for the cutscenes, for which it would save right after (the moment when interactive mode returns), if autosave is enabled (again regardless of autosave interval).
    Progress lost: The rest of the cutscene, and apparently in some cases it also lost the interactive part of some of those cutscenes (?) Like the Ghen one near the end (I've not tested that specific one, I'm going by the ticket description)

After PR:

  1. The game saves at the exact scene where the player was when exiting (if autosave is enabled).
  2. Except for the cutscenes for which now it does not create a save at all (if exiting while the cutscene in still ongoing).
    Progress lost: Everything since the last (auto)save up to the cutscene. This could potentially be a long period of progress lost. But in this case the user loses something that they experienced, rather than misses out on content they did not experience.

Is this a correct summary?

Would it be possible to save just before the cutscene plays (when autosave is enabled) so the user loses minimal progress?

@macca8
Copy link
Contributor Author

macca8 commented Apr 6, 2023

Is this a correct summary?

Yes. And just to clarify, currently exiting a cutscene containing an interactive component produces an autosave which displays a misleading thumbnail image of the exact scene at the time of the exit call. However, when launched, the saved game always begins after the entire cutscene is skipped, the same as a normal cutscene.

Would it be possible to save just before the cutscene plays (when autosave is enabled) so the user loses minimal progress?

The million dollar question! It's something I've often thought about, and would be a great improvement, but I simply don't know. And since the departure of bgK from the project, I'm not aware of any other devs with enough knowledge of the engine to reliably answer that question.

Nevertheless, it's not all gloom and doom. The user always has the option to manage the situation by selecting the minimum autosave interval, and accessing the main menu indicates that saving is disabled, so the user can opt to delay the exit at their discretion.

@antoniou79
Copy link
Contributor

As is, and since it is the intended behavior, the PR looks good to me too.

@sev-
Copy link
Member

sev- commented May 14, 2023

Thanks!

@sev- sev- merged commit db1ed9c into scummvm:master May 14, 2023
@macca8 macca8 deleted the fix-riven-autosave-on-exit branch May 16, 2023 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants