Search Unity

[UWP] [WindowsStore] [IL2CPP] Game crashes during Saving/Loading to and from ConnectedStorage.

Discussion in 'Windows' started by SkobbejakGames, Jan 10, 2019.

  1. SkobbejakGames

    SkobbejakGames

    Joined:
    Jun 3, 2016
    Posts:
    396
    Hi,

    I'm trying to get our first Xbox Play Anywhere game (ERA based) ready for release and I had everything running perfectly and smooth and I made some changes to the data being saved and loaded to ConnectedStorage and all of a sudden the game crashes when trying to Initialize the SaveManager on the following line:

    Code (CSharp):
    1. GameSaveErrorStatus status = await m_saveManager.Initialize(context);
    I'm not sure what's causing it as when I build out a Development Build with Debugging and Logging and adding the Unity Symbols Server I only get a Source Not Found message in Visual Studio and cant seem to find a more specific error message to determine the cause of the issue.

    Please any help on the matter would be greatly appreciated, if there is any other info that I can supply to help figure out the issue, please just let me know.
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    What's the callstack for the crash?
     
  3. SkobbejakGames

    SkobbejakGames

    Joined:
    Jun 3, 2016
    Posts:
    396
    @Tautvydas-Zilys Thanks so much for the prompt reply. Ive gotten the game to go passed the Initialization of the SaveManager however, it seems to get stuck when trying to either Save or Load the data to or from ConnectedStorage.

    The strange part is that the data still seems to save (and probably Load) as when I sign in with a new user without any Saved Data yet, the game crashes during the Saving procedure, however, the data still seems to be Saved as when I sing in with the same User again, Xbox Live is able to find that there is data stored in ConnectedStorage and attempts to Load the data (but seems to crash during or right after the Load process).

    The next lines in question are where the crashes seem to happen (as I dont get any LogLines after either of these lines):

    Save:
    Code (CSharp):
    1.  
    2.             Type myType = Type.GetType("XboxOneDataClass");
    3.             string xboxOneDataToString = MyFullSerializer.Serialize(myType, xboxOneData);
    4.             byte[] bytes = System.Text.Encoding.UTF8.GetBytes(xboxOneDataToString);
    5.             GameSaveErrorStatus status = await m_saveManager.SaveData(bytes);
    6.  
    Load:
    Code (CSharp):
    1. string xboxOneDataToString = System.Text.Encoding.UTF8.GetString(bytes);
    Please find attached a CallStack showing the result of a new user signing in and the crash that happens when trying to Save (XBL_SaveLoadError_Callstack.jpg) and then I also attached an image of the CallStack when a user that already has saved data in ConnectedStorage signs in and Loads data (XBL_SaveLoadError_Callstack2.jpg).
     

    Attached Files:

  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Can you press Debug -> Save Dump As when you're at that crash and PM me the resulting file?
     
  5. SkobbejakGames

    SkobbejakGames

    Joined:
    Jun 3, 2016
    Posts:
    396
    I managed to fix the issue. I was setting the Resolution to a non compatible resolution.
    Thanks again for the help and sorry for the hassle.
     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    What were you setting it to?
     
  7. SkobbejakGames

    SkobbejakGames

    Joined:
    Jun 3, 2016
    Posts:
    396
    I was setting it to blank, as I am using a Quality Settings Menu plugin that I modified in order to be able to save and load the quality settings info to and from Connected Storage, I just modified my implementation a bit more to prevent a blank resolution from being set.