Forum rules - please read before posting.

Saving and loading to/from Autosave

edited September 2016 in Technical Q&A
My game auto-saves after certain cutscenes using the 'Auto-save after?' option in the inspector.  I can tell it's at least partially working because the screenshot in the folder with the save file changes correctly.  The problem is that when I load the game from the title screen, it loads the game at the first scene of the game (there is an auto-save there as well) with all the progress and items gone.  

I have tried deleting all the save files so that there is only one, I see the save file being created in the folder, but it's as if the subsequent auto-saves, after the initial one in the first scene, don't overwrite the initial save.  

Since I don't want any save slots in the menus or even any save button I try only to use the auto-save feature.  I tried 3 ways of saving the game.  The first way was to check the 'Auto-save after?' option in the inspector. The second way was to Override the auto-save slot in a cutscene action list.  The third way was to save to the first slot of a save list.  All three ways resulted in the same problem.

I also tried 3 ways to load the game from the title screen, all three ways were called in an action list activated by the continue button in the title screen menu.  The first way was to continue from last save.  The second way was to load the autosave.  The third way was to load the game from a slot in a save list.

I am completely stumped here.  I have no way of knowing whether the saves are not being overwritten or when loading the save isn't being read correctly.  Any help would be appreciated. 

Comments

  • Very odd - is this in builds, editor, or both?  All three of the ways you tried should have worked in principle.  What versions of AC and Unity, and on what platform?

    When a save file is read or written to, it is listed in the Console / debug log.  Let's first see if the issue is that the second autosave is not overwriting the first.  Play the game as normal, and after the first autosave occurs, manually delete the file while the game is open.  Then when the second autosave occurs, close the game, restart it, and see what happens when you load the autosave.

    Are you certain that the first autosave is being opened?  Could it be that the first scene is being opened by mistake but using the second save's data?  Is the player's position correct, for example?
  • This happens in both the editor and in builds.  I've tried in the editor of both Windows and Mac, though the build I only tried on Mac.  I'm sure the first save (or something like it)  is being loaded because it doesn't have the inventory items or position that the player has at the next save point.

    I tried what you suggested, a new save file is created at the second save point after I manually deleted the old one.  So it seems like it saves, but maybe it doesn't save properly.  Even after I tried what you suggested the character spawns at the beginning of the game, though the save was at a later scene.

    The button I have in the title screen scene loads the autosave file.  There are no buttons or action lists that load the scene in which the character keeps starting when I load the game.

    To make this clearer, I have 3 scenes A, B, and C.  When I start a new game it goes to A (video cutscene) which loads into B, then from B the player can move into C.  After a cutscene in B the game saves, after a cutscene in C the game saves.  Even if I delete the save file from B before entering C, when I save in C then restart the game and load, the scene I end up in is B.

    The logs show the game writing and reading the same file at the same location.

    The unity versionI'm using is 5.3.4f1
    The Adventure Creator version is 1.51d

    I know I haven't updated Adventure Creator in a bit, but I'm not sure how to do it safely, I'm scared of breaking our game.
  • A new development!

    I removed the first save point to see what would happen if the second save point was now the first save point.  The second point saves correctly, then I moved on to a third save point and that worked fine without me manually deleting it, it overrode the old save file properly.  I moved on to a fourth save point and that worked fine as well.  So it has something to do with that first save point.

    I can't see what the difference between the two save locations or the cutscene after which the game saves, though.
  • Is the video cutscene in A still an "AC scene", or is it separate?

    You will need to update your version of AC in order for us to determine if it is still an issue or has since been fixed.  You're right to be cautious at it is quite a jump - so I would recommend doing so in a duplicated project so that you can easily revert to the old version.  A guide to upgrading is covered in Section 1.6 of the Manual, and you will need to read the "Upgrade notes" of each version as listed in the included Changelog file - they will cover any changes made to AC that may affect your game.
  • Yes, the video cutscene is in an OnStart cutscene.

    I will attempt to upgrade the project.  I will update when I have any further details.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.