Forum rules - please read before posting.

Issues with save files

Hi there,

Ben from Arrogant Pixel here. We are currently in the process of releasing a game called The Tale of Doris and the Dragon - Episode 1 on steam, the game is already available on app stores so I'm in a bit of a panic trying to sort this bug out.

I have been having a problem with the save file system in adventure creator. It seemed to be working fine at one point, during all bug tests there were no problems reported with the save system but recently a major issue has come up.

Originally there was a very odd issue with inventory items stacking in overwritten files, for example. If you were to pick up Item A and Item B and then use Item A and save upon loading Item A and B would still be in the inventory.

I opened up unity and quickly figured the save game file had spaces in the name (a big helpful warning was pointing it out to me). So upon correcting this I began testing the save system once again and it now seems to only save the first iteration of save files.

For example I will start the game, pick up an item and save, walk to the next scene, save again. Then I will walk to another scene and save, resulting in 3 save files. I will then attempt to load one of the three files and the file loaded will always be save 1. Whether I load save file 1, 2 or 3.

I'm wracking my brain for answers right now and I'm pretty sure the save system works for other people after scouring the forum, so I don't really want to go into core AC code and start trying to hack a fix together!

Any help will be much appreciated.

Thanks!

Comments

  • edited August 2016
    Be aware that if you change your save game file name, old saves will not be visible to your game.  While its not advisable to have spaces in your names, I don't see that as being the issue here.

    Which version of AC are you using?  I can't say if this is a current bug without knowing if you're on the very latest.

    With the first issue, what do you mean by "use Item A".  As in dropping it, so that only B should be there?  I can't recreate your issue from your description - what does your Settings Manager look like?

    With the second, is there any significance to picking up the item?  If you don't, does the issue persist?  Check the Console when saving and loading - it will tell you specifically which file is being handled at the time.  Is it saying specifically that Save 1 is being loaded?  If so, does this issue occur if you temporarily switch your assigned Menu Manager asset to Demo_MenuManager (i.e. the default Menu system)?
  • edited August 2016
    Thanks for the prompt reply Chris,

    I am using AC v1.52a.

    As for the first issue, I only knew of the bug to be present on mobile devices and it seems to have been resolved upon changing the file name for save games and items no longer stack in the inventory when overwriting a file, so that's good. Also yes I did mean dropping the item.

    For the second, the issue persists whether an item has been picked up or not, when checking the console it looks like the files are being written to and read from the correct filename. Upon further testing it seems that saving and loading the game works fine before leaving the first scene of the game, for example if I just walk around the first scene saving several times, all of the save files will be saved and loaded correctly so I'm pretty sure this is a very specific issue to my game.

    Are there any known bugs with other modules in AC that would affect how the save system operates? For example something seemingly unrelated like a missing translation or sorting map? I'm just trying to cover all bases.

    I'm going to try a few more things including switching to the demo managers and I'll let you know how it goes.

    Thanks for all the help anyway, when the game is released I'll send you over a steam key so you can give it a go. ;)


    EDIT: Upon further inspection it seems if I leave the first scene, enter the second scene and pick up an item and then save then proceed to load the game, the game will load the x & y pos and scene and inventory from the latest save in the first scene but when I then move into the second scene again the item I picked up from there is missing but still not present in the inventory. So AC seems to be saving all the remember visibility & remember script data but none of the inventory, x, y or scene data after leaving the first scene.... :S very confused.
  • I'm always atop of bugs when I learn of them, but I'm not aware of this one - but it could be critical.

    Some issues related to save games were fixed since v1.52a - particularly when you have either no player or use player switching.  I would recommend upgrading (in a test project) and test again to see if the issue is still present.

    Are you making use of multiple player prefabs, or local players within your scene?  Which version of Unity, also?
  • Ok, I'll upgrade to the latest version of AC and test some things out.

    I only have one player prefab but there is a local player in every scene. Since AC automatically detects this so that there is only ever one player in the game I did not think this would be a problem but hearing you mention this makes me think that it could be the local players that are causing issues.

    I am currently using Unity 5.4.0
  • Could well be - I'll do some testing of my own as well.
  • OK, done some testing on the second issue - unfortunately I can't recreate it in either v1.52a or the latest release, which means the issue could well be unique to your set-up.

    Here's a package file of what I understood your test as.

    It'll have two scenes.  Assign the Demo game's Managers, and list both of these (just these) in your Build Settings and build it.  In the first scene, you can click the left cylinder to pick up the sword item, and the right cube to the second scene.  I haven't been able to find a combination of clicks that causes an issue.

    If the same is for you, replace the Managers with your own and see if that changes anything.  If so, replace each of the Manager in turn - it may be that it's down to one of these, so this'll help narrow the problem.
  • edited August 2016
    YEEESSS I managed to get it fixed.

    Seems it was due to the fact that each player can have their own individual inventory, x, y and scene when saved even if the player instance is linked to the same prefab.

    As soon as you said that it could be due to the local players I figured that was the problem and upon removing them from each scene the save system started functioning correctly.

    I don't know whether a fix is needed or whether you can just make people aware that only the first instance of a player prefab is saved.

    Thank you so much for all your help and making such a fantastic and versatile engine.

    EDIT: Just realised you replied 4 minutes before my post just as I was typing! Now thats some good customer support haha. Thanks for everything!
  • Glad it's working for you - though it's still a bug, which I'd be keen to see fixed.  Not having been able to recreate it, we'll have to see if anyone else has this issue.
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.