Hello, I am looking for a persistence for our new game and there are several options, Unity Cloud Save is one of them. I would prefer to keep everything in the Unity ecosystem, however since the game could be played offline and online, it would be optimal if the persistency can support this too. I know Firebase supports it (used in another project), and I found some threads, that Cloud Save does not support it, however they were 2 years old. The current documentation is unspecific about this, unless i missed something.
So, long story short - does Cloud Save support offline+later-auto-sync, similar to Firebase?
Not to my knowledge. You’d have to “cache” any offline value changes and then sync them to Cloud Save when the user is online while operating your app.
The way I’d implement a combined online/offline mode is not to rely on keyed values on the Cloud Save service but - if possible - use a single data stream for cloud save values. Practically a classic savegame file, a single stream of bytes (a string) that encodes every state.
However this has limits if the state is very complex, and changes affect only very few items of the dataset and thus the stream may be quite large and synched frequently even for minor changes.
Thank for the info, much appreciated!
A bit disappointing, I was expecting more to happen for 2 years…
Would test a bit the behavior and consider using Firebase again, very happy how it worked on another project.
There’s just no one size fits all when it comes to temporary offline storage. Most apps simply don’t need this, or if they could use it they’d nevertheless not allow it due to security / cheat concerns.
And then there’s the issue of merging changes, if a user goes offline on one device but plays online on another with the same account. Even to this day, users are losing Steam savegames due to this despite the warnings.
Exactly my point, I really don’t want to implement such a mechanism myself, and Firebase already does it perfectly fine, including the sync after the device is again online. So, if Cloud Save does not support it, Firebase it is…
Pity, I really have hoped that I have everything in one cloud dashboard.
Firebase is a general purpose storage solution. It will happily synchronize the offline storage. But how does it resolve merge conflicts? I guess it doesn’t even concern itself with that, simply overwriting the data. Or maybe basing the decision only on a datetime tag. Or it may actually require you to implement a callback to decide yourself.
And then Firebase doesn’t care if the offline data could have been (unintentially) tampered with. This opens the door for (easy) cheating just by taking the device offline, have it store the data locally, inspect and modify the local data, go back online. Perfect for cheaters. At a minimum be sure to check whether Firebase encrypts the offline data. I suppose not because such client-side-only encryption is easily overcome.