Auto-sync savegames between Android and PC

Got an idea for OpenTTD? Post it here!

Moderator: OpenTTD Developers

Post Reply
pelya
Transport Coordinator
Transport Coordinator
Posts: 283
Joined: 18 Nov 2010 19:48
Contact:

Auto-sync savegames between Android and PC

Post by pelya »

Syncing savegames between Android and Windows is a long-requested feature, but while Android version has cloud saves using Google API, PC version cannot use it, because Google only provides cloud save libraries for Android.

But syncing local savegames is possible. When you plug your phone into PC and enable 'MTP device' mode to transfer files, you can find all your save files (incliding those that were saved to cloud) at predefined location at

Android/data/org.openttd.sdl/files/.openttd/save

so all you need to do is copy this directory to save dir on PC, and copy all savegames from PC to this location. Ideally, OpenTTD should do this automatically each time you create new savegame or open 'Load game' dialog, ignoring all MTP devices that do not have this directory.

Unfortunately, Windows does not have built-in commandline tools to access MTP devices like Linux has. Windows provides some over-complicated API for that, also there seems to be a usable commandline tool in Windows SDK examples, but then it will need to be redistributed inside OpenTTD installation.

It would be ideal to transfer savegames over network without plugging USB cable, but unless we want to create a dedicated server for storing savegames, this looks like the most practical solution.

User avatar
Andrew350
Director
Director
Posts: 569
Joined: 19 Dec 2011 07:54
Location: Washington State, USA
Contact:

Re: Auto-sync savegames between Android and PC

Post by Andrew350 »

Just want to point out that if you were going to synchronize savegames, you likely would also want a way to synchronize your add-ons too, e.g. NewGRFs, AIs, etc, since those savegames won't be playable without them ;) This is especially true if you're using things not available on the online content.

And yes, it is kind of a PITA to have to plug in my phone to my computer to transfer all of the files and keep everything lined up manually, so mostly I just don't do it and keep things separate. Not that I play often on my phone anyway, but some kind of automatic syncing would make it a little better :)


User avatar
Andrew350
Director
Director
Posts: 569
Joined: 19 Dec 2011 07:54
Location: Washington State, USA
Contact:

Re: Auto-sync savegames between Android and PC

Post by Andrew350 »

No idea since I don't use Google Drive, but I would imagine it is limited to only certain directories which wouldn't include the program files such as OpenTTD. Could be wrong though :)

pelya
Transport Coordinator
Transport Coordinator
Posts: 283
Joined: 18 Nov 2010 19:48
Contact:

Re: Auto-sync savegames between Android and PC

Post by pelya »

Saved games are counted against your Google Drive storage, but you cannot download them like other documents, to prevent tampering with savegames, you can only access them from the game itself.

Now Android OpenTTD could use Google Drive API instead, to save them as regular files, then you could set up Google Drive PC app to auto sync your save folder. But I don't want to touch cloud saves code that is already working (also I'm lazy, yeah).

User avatar
kamnet
Moderator
Moderator
Posts: 7249
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Auto-sync savegames between Android and PC

Post by kamnet »

I currently use Google Drive to store all my OpenTTD content, so that it's all synced between my computer. A simple symlink between the default shared directory and my Google Drive path and every game is instantly updated upon save. It would be a nice option if Android players could choose to enable saving to Google Drive.

Post Reply

Return to “OpenTTD Suggestions”

Who is online

Users browsing this forum: No registered users and 17 guests