I would like to know what events are best for saving during level transitioning.
The game is single player so that simplifies a lot of the requirements.
The game is structured in various levels, each with its own GameMode. When the user enters a specific game task they travel to the appropriate level. Levels have specific UIs related to the task. Once the player completes the task the player gets a summary/message and makes the player travel back to the base level.
The user is allowed to exit the game at any point. I have built logic that keeps the GameSave up to date during task steps. So when the player exits the GameSave can be written to disk.
I know how to save information with GameSave, etc. My question is more about the best place to put the hooks for saving in each case.
At the moment, the GameInstance contains the travelling and saving logic. When the player loads a save it sets the info and opens the new level. When the GameMode starts I use Event HandleStartingNewPlayer to move them to where they were and resume the tasks or idling state.
-
Saving after each task step is simple. I just update the save at the end of the task step.
-
Saving on close is not quite clear. Should I save on GameMode EndPlay or Destroy? Or, should I hook the logic to the end of the Task to be certain? I could have quite a bit of data to save, in terms of tables, etc. So, what is best? Save before the GameMode is torn down by the Engine or by my own logic?
-
What about saving on travelling? I mean, if the player decides to abandon the current task. Is it better to use my own logic through the my Leave button or again use one of the events on GameMode?
Thanks!