Forum rules - please read before posting.

[Issue] Game properly working on Android. Fails to load XML savegames on iOS (malformed XML?)

edited December 2019 in Engine development

Hi there,

I'm really feeling bad for opening so many threads, yet, here's a thing I stumbled upon.

On Android, the game works as a charm. Saving and loading with profit :)

On iOS, it fails when loading the XML.

Actually, I'm getting this:

when trying to invoke SaveSystem.ContinueGame();

Also, when switching scenes, I'm getting a similar error:

Editor Log:
https://drive.google.com/open?id=1rLGyTunbVj-nWbI-tY1n74nMWeUS_vwj

SaveGame savx file:
https://drive.google.com/open?id=1cwrb0qVAZMwvcUSmoIJIJS0VBNra4IPp

PlayerPrefs content:
https://drive.google.com/open?id=1Tj6bCjdZ3rY1nll1gzo_t1P57U5dUq5j

Am I doing something wrong, or found a corner case scenario in the serializer/deserializer?

Comments

  • What is your AC version number? The latest release, v1.69.5, addressed bugs concerning the loading of save files that use XML or Json.

  • edited December 2019

    What is your AC version number? The latest release, v1.69.5, addressed bugs concerning the loading of save files that use XML or Json.

    Oh my, due to the black friday spam, I didn't notice that notification!

    I'm going to push a few changes to the repo, import the latest AC version and see if it solves this particular issue.

    I'm currently on 1.69.4

    I forced XML serialization on Android (playing the game on Windows, targeting Android), and I have the same issue as in iOS, so I guess it doesn't depend on OS but on the XML de/serializer. Or on something I'm serializing. Yet, I'm not doing any custom serialization, I simply created a few "Remember" scripts.

    I'd have tried Json, but it would take ages to check if, by scene and by each single object in the scene, more than one custom "Remember" is present on an object. I should be writing a script for that.
    A "Check for JSon compatibility" feature would be nice.

    Yet, I'm crossing my fingers about 1.69.5 fixing it, I'll keep you posted :)

  • edited December 2019

    I updated to 1.69.5, but had the same issue.

    I noticed the other thread about xml serialization and it solved my issue with savegames on iOS.

    BUT

    I had to rollback those changes because that solution tampered with the way AC saves Options.

    Yet, I can't save on iOS at all with 1.69.x, so I'm trying to find a middle ground.

    1.69.5 also somehow broke my camera system (iOS and Android), so I had to revert to the ActionCamera.cs in 1.69.4

    I will share more details later, I have to push a release build right today (really in a rush)

  • I had to rollback those changes because that solution tampered with the way AC saves Options.

    Options and save files currently share the same file format, but this raises a good point. I shall see about being able to override the options file format so that it can be separated from save files if necessary.

  • edited December 2019

    To elaborate on the fix in v1.69.5: this makes changes to the way saved games are written, which stops errors upon loading. Are you testing it with the old save file you first reported with? It should be that the issue no longer remains with newly-made save files.

    A quick-and-dirty hack to remedy existing save files is to replace line 438 in SaveSystem.cs:

    int divider = saveFileContents.IndexOf (mainDataDivider);
    

    with:

    int divider = saveFileContents.IndexOf (mainDataDivider + "<?xml");
    if (divider < 0) divider = saveFileContents.IndexOf (mainDataDivider);
    
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.