2

I build an android game and I am working with google drive to synchronize the progress of the user.

Rite now I build a mechanism to sync file to drive. This file may include game progress-information or user settings.

Users can play my game offline, and once connection is available their progress will be saved.

This created a few problematic scenarios for me.

  • User is playing on Tablet, his progress is saved. Next day he is playing on handset without internet connection, making a small progress, and then entering the application again with internet connection. So I got two files, his local changes from when he played offline and the progress on tablet from yesterday. What should I do?

    1. Use tablet progress as it's the most recent file on drive
    2. Use handset progress as it's the most recent file from the two.
    3. Present the problem to the user and let him to decide.
  • Same scenario as above only it's happening in the middle of the game, suddenly I am getting connection and see a progress from yesterday with different device.

closed as off-topic by tohster, JohnGB Mar 30 '15 at 9:58

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about Implementation are off-topic because this site is for User Experience design questions, not questions around how to implement these designs. Therefore, questions around the use of programs like Photoshop or languages such as CSS or JavaScript are off topic." – tohster, JohnGB
If this question can be reworded to fit the rules in the help center, please edit the question.

  • This isn't really a UX issue. It's an issue of syncing online/offline data with a cloud repository, so I think it needs to be solved at the data layer. – tohster Mar 28 '15 at 20:41
  • @tohster May be. But I don't know what would be the best solution. So I thought someone from here could help. This is definitely not a technical question. – Ilya Gazman Mar 28 '15 at 20:45
  • For multi device gaming usually the game design either 1. Forces online-only, to enforce data integrity, or 2. Keeps each device separate so there are no sync issues. You may want to look at how games like candy crush do this since it's non-trivial and it's approached through the data layer and not the ux: gaming.stackexchange.com/questions/128271/… – tohster Mar 28 '15 at 20:53
  • I think this is a valid UX question, because there are multiple ways to approach this problem, and the way you approach it has a direct impact to the user. – DallonF Mar 28 '15 at 21:15
  • @Ilya_Gazman is your game progress achievement-based or artifacts-based? That is, the game play (map, session, etc) are reset, but the achievements, experience points, or magic items stay. Merging of progress is much easier if you don't have to save everything on the game map. – rwong Mar 28 '15 at 22:38
1

Syncing files from two potentially offline sources is a hard problem that is basically impossible to solve in a way that makes sense all the time. For evidence of this, look no further than the complexity of the tools programmers use to solve this problem for source files rather than game saves:

To be clear, I'm not suggesting you use one of these! Just illustrating the widespread and unsolved nature of the problem.

The problem, as you touched on, is not so much in syncing the files as much as determining what to do when a file changes in two different ways. One option, as you mentioned, is to simply choose one version of the file over the other. It's very difficult to choose exactly which one, though!

You can also attempt to merge the files, as the aforementioned source control tools do. In doing so, you look at both the files, determined what's changed, and attempt to create a new file that contains both sets of changes!

Inevitably, this has cases that source control tools call merge conflicts - when two files have mutually incompatible edits compared to their previous version and the correct resolution cannot be determined by the software. UI to resolve merge conflicts is nasty and unintuitive and you'd be better off just asking the player which save file is the right one.

Depending on your game, though, you might be able to cheat. If your game doesn't have any incompatible decisions (ex: branching storyline), you can just keep the best value available. Let me dive into this a little more...

Let's say the save file online has one star each on levels 1, 2, and 3. The user plays the game on their tablet (offline) and earns three stars on level 1. The user plays the game on their phone (offline) and earns three starts on level 2. The user suddenly gets an internet connection on their phone and the game automatically saves to the cloud. The user then connects to Wi-Fi on their tablet and loads the game - the game recognizes what happened and shows 3 stars on both levels.

If the game does have cases of mutually incompatible decisions, it may be preferable just to support multiple save files and, in case of a merge conflict, keep the newer one (by local time) and save the older one to the list as a backup.

  • Those programing tools called source controls, I use git. Unfortunately in my case merge is not an option. I do like your idea of backups. How ever I am trying to make it transparent for the user, there is no place at the app where the user need to press the save button. It saves everything automatically, so I am not sure how to implement backups in this aspect, not from technical aspect but from ux.. – Ilya Gazman Mar 28 '15 at 22:02

Not the answer you're looking for? Browse other questions tagged or ask your own question.