Page 1 of 1

Auto-sync savegames between Android and PC

Posted: 04 Jan 2020 01:50
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.

Re: Auto-sync savegames between Android and PC

Posted: 04 Jan 2020 02:54
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 :)

Re: Auto-sync savegames between Android and PC

Posted: 04 Jan 2020 03:09
by kamnet
Will Google Drive back up those directories to your account?

Re: Auto-sync savegames between Android and PC

Posted: 04 Jan 2020 03:35
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 :)

Re: Auto-sync savegames between Android and PC

Posted: 04 Jan 2020 10:07
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).

Re: Auto-sync savegames between Android and PC

Posted: 04 Jan 2020 21:24
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.