Board Thread:Game Discussion/@comment-3157402-20190812121742

Hi, although I've already posted about the bug in the thread about the event archives bug, I decided to create a new one in order to make it easier for anyone looking for a solution, and also since it's not exactly the same as the event archive bug anyway.

To summarize what I'm talking about, here's what my problem was (and at least someone else, Mildvex, is suffering from it as well): Since about a year, my game is reset to the previous savegame at least once a week (more recently even almost daily), and while a cloud restore reliably used to work in that case before, since the last few updates the game auto-saves to the cloud immediately after the game has been started when there hasn't been made significant progress for about 24 hours (which the game ASSUMES  to have happened when it resets the save game to the last day, even though the actual time that has passed since the last save is much less). When this happens, the cloud restore reproducibly fails with error code #4, so a whole day is lost, and consequently at least 30/60 gold as well, which you would get at the very last day of the month if you logged in every day of the month before.

In case a Firemonkey developer is reading this: This seems to be not only one, but actually two different bugs (the savegame reset bug and the cloud restore bug with error #4 after an auto-save), which only in combination have the result of a loss of game progress.

My educated guess as a software developer is that the savegame reset may be caused by a mismatch when handling the date and time of the savegame, maybe the game uses UTC as timestamp for the save but local time for in-game time (or vice versa) and therefore marks the save as faulty/fake and uses the previous (local) savegame at game start instead. This could explain why cloud restore usually works, as Google Play uses UTC for timestamps and doesn't care about local time at all. I assume the same applies to iCloud saves as well, but since I'm playing on Android, I can't verify that.

Since there's no public documentation about what error code #4 actually means, I can't really comment on that either, but as it happens 100% of the time when trying to restore a savegame after an auto-save has been triggered and only since a few game updates ago, I'm quite sure that a new bug must have been introduced to the auto-save algorithm fairly recently.

Anyway, back to the point of my post: I meanwhile have found a workaround for this problem, which reliably works to prevent the savegame reset for me: If you force close the game after you have saved your progress and immediately restart it again, the savegame reset may or may not be triggered, but the auto-save to the cloud isn't (probably because not enough time has passed even taking the presumed timecode bug into account). This means you should be able to restore the savegame from the cloud immediately and successfully if the savegame reset actually IS triggered, as the problem with error code #4 only seems to apply when trying to restore an auto-saved game.

If you cloud save immediately after the restore and perform the force-quit-and-restart-routine with the game again, you should see that the savegame reset doesn't happen after the game has started this time (or at least it never happened a second time to me yet). If it still happens for whatever reason, just repeat to cloud restore, cloud save, force quit and restart again until the actual game progress is kept after restarting the game.

If you managed to do that, you can safely quit the game for this day, because even though the game will most probably immediately auto-save again when you start it the next day (and consequently error code #4 would be triggered if you tried to restore the cloud save), it doesn't matter, since the last day's progress is still kept and therefore there's no need for a cloud restore at all.

And there you have it, sorry for the long post. I'd be interested to hear if my workaround works for other people suffering from the same bug as well (especially for @Mildvex and iOS users).

Regards, JD 