Auto-sync savegames between Android and PC
Posted: 04 Jan 2020 01:50
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.
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.