Skip to content

GameState: Persist current scene in global, not scene, state#2045

Open
wjt wants to merge 1 commit intomainfrom
wjt/gamestate-persist-current-scene-in-global-not-scene-state
Open

GameState: Persist current scene in global, not scene, state#2045
wjt wants to merge 1 commit intomainfrom
wjt/gamestate-persist-current-scene-in-global-not-scene-state

Conversation

@wjt
Copy link
Member

@wjt wjt commented Mar 11, 2026

Previously the current scene was persisted as part of the quest state.
When you return to Fray's End after completing a trio of Sokobans, all
quest state is erased from the saved data, meaning that the current
scene path is lost.

As a result, if you:

  • Complete a quest
  • Complete all three Sokobans & return to Fray's End
  • Exit the game
  • Relaunch the game

then you were previously offered the chance to Continue. However this
would try to change scene to empty string, which fails and reloads the
title screen.

Fix this in two ways:

  1. Persist the current scene as part of the global state, not as part of
    the quest state.
  2. Only offer the chance to continue a saved game if the current scene
    is known.

Add some assertions at relevant points.

Resolves #1946

Previously the current scene was persisted as part of the quest state.
When you return to Fray's End after completing a trio of Sokobans, all
quest state is erased from the saved data, meaning that the current
scene path is lost.

As a result, if you:

- Complete a quest
- Complete all three Sokobans & return to Fray's End
- Exit the game
- Relaunch the game

then you were previously offered the chance to Continue. However this
would try to change scene to empty string, which fails and reloads the
title screen.

Fix this in two ways:

1. Persist the current scene as part of the global state, not as part of
   the quest state.
2. Only offer the chance to continue a saved game if the current scene
   is known.

Add some assertions at relevant points.

Resolves #1946
@wjt wjt requested a review from a team as a code owner March 11, 2026 14:12
@github-actions
Copy link

Play this branch at https://play.threadbare.game/branches/endlessm/wjt/gamestate-persist-current-scene-in-global-not-scene-state.

(This launches the game from the start, not directly at the change(s) in this pull request.)

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.

Can't continue after finishing quest then quitting from Fray's End

1 participant