Level Up Your Retro Gaming: Effortless Save Synchronization

Level Up Your Retro Gaming: Effortless Save Synchronization
Photo by Ravi Palwe / Unsplash

One problem that I recently faced is the following. I love to play retro games. This includes all games, let's say, Game Boy Advance games.

And I love to play these games across different devices and form factors. For instance, I might want to play these games through a web browser or on my computers, on my tablet, on my phone, even on a couple of retrogaming handhelds, those very cheap and small devices with a nice screen.

A d-pad and a few buttons that let you play old games. And just that. Of course. All these games have their own progress and their own save files. How do you keep them safe? Because, well, nobody really likes to play the same level over and over. And over. I would get bored pretty quickly.

So, the problem I'm facing is, how do I keep those save files in sync without losing my progress across many different systems and devices? Well, first, we need to introduce a few key technologies.

First, it's RetroArch. RetroArch is a frontend for emulators and lets you play different games, from Amiga to Game Boy, Game Boy Advance, PlayStation, and even Switch. Everything can be played through RetroArch. This is important because RetroArch manages all the configurations for all of these emulators.

RetroArch runs on almost every platform, from low-power Linux handhelds to powerful Windows machines, to Android and iOS smartphones and tablets, so that is settled.

Next, we're going to use a piece of software called Syncthing. This software lets you synchronize and version (more or less like Git does) different files across multiple devices. Syncthing is a piece of software that runs as well on many platforms: Android, Linux (including Raspberry Pi), Windows, and so on.

Installation

I won’t dive deep into how to install these two software programs, as there are many guides that describe these processes in detail. I will limit myself to linking them below:

RetroArch

SyncThing

How it works

Every game has a save file where the information related to the progress is stored. We don’t need to know exactly what it contains; we just need to know where to look for it. In the RetroArch menu, we can specify that we want all the saves in the same folder and decide where this folder is located. RetroArch adds the interesting functionality of saving custom states of a ROM, which can be quite handy for speeding up the execution of the game, and this is stored as a file as well. In the same way, you can ask RetroArch to save them to a single folder.

Once all of your save and state files are in a single and precise location, you can use SyncThing to synchronize them across multiple devices.

SyncThing architecture

SyncThing works like a peer-to-peer synchronization mechanism that saves the latest edit to all the devices specified in the configuration, more or less like this:

Of course, this idea fails to scale when you start adding more devices, as you have to manually authenticate them all on each of them:

So, rather than leveraging the P2P capabilities plainly, I decided to use a star-like architecture: I used a ProxMox LXC to host the first instance of SyncThing and authenticated each device to it, so that every time a new change is uploaded on any device, the server will be notified, and it will distribute the (versioned) change to everyone else. If I add a new device, I only have to authenticate it to the server, and that means the effort to scale it up remains O(1), pretty neat!

Of course, I was afraid of losing my save files anyway, so I used a spare Raspberry Pi (but anything would do, actually) as yet another device where I could sync everything to.

The real power behind this architecture is that you are in absolute control from a single central location, and you can decide which files are synchronized where. Let’s say that both my son and I like to play our games on multiple devices, but we don’t want our save files to mix. We can simply create two folders on the server, sync our devices to these folders, and only sync the specific files to the relevant devices:

Of course (part 2), since I was also afraid of losing all my settings, I decided to leverage ProxMox Backup Server (which was already running on my network) to back up the container, so that everything is securely stored (or safe until something fails).

Conclusion

Is this overkill? Absolutely. Do I need it? Probably not. But it makes my life easier, I had fun setting up this architecture, and I learned something new. Plus, if I ever pick up another retro console (I’m joking, I know I will), all my saves will be automatically available already.