Words On Wednesday

2016-08-17 Multiple Platform Video Game Emulation

What if you could start playing an emulator at home on your desktop, continue playing on the bus from your phone, and then pick back up on your laptop when you arrive at your destination? How awesome would that be?

Playing on Multiple Platforms

The thought occurred to me as I was playing EarthBound on my PSP (Yeah, I’m back on that after about a year and a half). Given the option, I prefer to play any game on a large TV rather than a small screen like a handheld game system or phone. However, with emulation options as they are at the moment, I’m mostly limited to doing one or the other. I can play on the TV only when I’m home, only from my PC if I’m using an emulator, and only when nobody else wants to watch TV or play something. On my PSP or other small screen, I can play basically whenever and wherever, but I’m limited to that tiny screen.

If I want to switch platforms, the process is fairly simple. First, I have to find and set up a SNES emulator on the new platform. This isn’t terribly complicated, and is only a 1-time procedure for each new platform. Next, I have to copy the ROM .smc over for whatever game I plan to play. Again, mostly a 1-time task for each game on each platform. If I so choose, I could move all the games I expect to play at once in bulk. At this point, I could play the game on any platforms that have been prepared, I just can’t continue where I left off from one platform to another.

The only thing I have to do in order to continue my progress is move my .srm save file from the current platform to the new platform. If we’re being honest, that really isn’t a huge deal. From PC to PSP or vice versa, I just hook the PSP up with a USB to MiniUSB cable, put the PSP into USB mode, and drag and drop the file. For PC to phone or vice versa, I could do the same thing with a USB to MicroUSB cable or some form of cloud storage like Google Drive. All in all, that’s not much of a problem. Where I have a problem with this is how repetitive and tedious it would be to do so day after day.

Problems with Multiple Platforms

Say I play it for a little while on my desktop and I’ve finished for the day. Since I’ll be going to work in the morning, I’ll load the .srm onto my PSP and maybe my laptop just to be safe. If I don’t play it again until a few days later when I’m on my desktop again, I was just wasting my time moving the save file to my PSP and laptop. When I finish playing the second time, I have to move the file again to keep my PSP and laptop up to date with my latest progress.

Instead, what if I only move the save file as I need it? If I know I’ll have some free time away from home one afternoon, I decide to grab the latest save from my desktop and load it onto my PSP. Even if that doesn’t take a ton of time, I hope I’m not running too late to manage it. Or maybe I’m not expecting to have any free time, and what do you know, I’ve got some down time with only my PSP and a week old save. I haven’t updated it from the current save on my desktop in quite a while because I didn’t expect that I would have a chance to play it. Without any way of transferring the save file while I’m away from home, I can’t possibly grab my latest version.

Oops, I forgot which platform I last played on. Do I look through each of them and check the timestamp on the save file? What if I start playing from an old save and have 2 branches of my “most current” save? Do I just scrap the progress on one and continue on the other?

Any of these options tread a thin line between convenience and reliability. Updating all of my platforms after every play session is the best way to have current data, but it would be a hassle to do this for 3 or more platforms every single time I play the game. Only updating as I transition to a new platform would be much less time consuming, but could easily run into situations where I have old data and no easy way to get current.

Possible Solution

Ideally, updating my save files could be automated to happen any time a save is changed on one of the platforms.

If I’m playing on my desktop, that .srm file is being updated each time I save the game. Possibly each time it’s updated, or at least when I’ve finished the play session, that file would be uploaded to my cloud storage and overwrite the old save. Each time the cloud version is changed, the latest save would be pushed to each of my platforms and replace the local version. If that is impossible, each individual platform could at least check the local version timestamp against the cloud version upon launching the ROM to see which is newer. That way, every platform has my most recent version when I want to play. If I want to transition from my desktop to a laptop, all I do is save the game on my desktop and boot up the emulator up on my laptop.

To prevent accidental overwrites, this solution might have an option to have multiple staggered saves on the cloud at any one time. As long as you catch a mistake within a reasonable time frame, you could reload a backup and everything would be fine. Another feature might be to upload an additional save for each platform, with an acronym appended to the file name. If I’m playing on my desktop, my laptop, and my PSP, I might have earthbound.srm, earthbound-dt.srm, earthbound-lt.srm, and earthbound-psp.srm files on the cloud.

Benefits

The benefits of this new solution stretch far wider than just being able to play continuously from one platform to another.

For one, saved data is automatically backed up in multiple locations. I would never again have to deal with the headache of finding my last game save the way I did last year (https://jakehennett.wordpress.com/2015/02/04/emulation-on-the-playstation-portable/). Any current platforms would always have the latest version. If you want to add a new platform, you would have several local versions to choose from, as well as the cloud save that is always updated. Even in the case of a hard drive crash or stolen device, you don’t lose any data.

Another great benefit is that you always know where the latest save is. Say you’ve previously moved the .srm file around manually, you don’t have to guess and check for which one has the most recent timestamp. If everything is working properly, all the instances of the file have the most current data and you can simply grab which is most convenient.

Perhaps the most relevant benefit to me, shifting from platform to platform would be absolutely seamless. If I’m playing on my desktop, I could just save the game and keep right on playing from my PSP as I walk out the door. No more moving save files around, no risk of being caught with old data, you’re current across all platforms and can resume playing from anywhere.

Problems with this Solution

Even beyond the technical feasibility of this solution, there are several issues that even non-technical people could identify.

What if multiple platforms are running the emulator and saving at any given time? This could result in a nasty situation of overwriting a save file while it is currently being played. If your local version is overwritten by an old version before you finish playing, you may lose data or possibly have the game crash. This risk might be mitigated with the “-xx” version option mentioned above, but that’s far from a guarantee of success.

For platforms like Windows computers, cloud storage updating should be mostly straightforward. Throwing in phones like Android devices and iPhones complicates things a bit, since they likely use different file structures and procedures. Bringing in handheld devices like the PSP makes this even more of a mess. Phones do have access to mobile data, but what if you enter an area of no service, or if you want to conserve data? Furthermore, the PSP can only have internet access when connected to a WiFi network. Is there any way to guarantee that all platforms will be current all the time?

To connect all your platforms, you need some way of identifying them as relevant. Do you sign in with an account of some sort? If so, what account? Even if I want to use my Google account because my cloud save is on Google Drive, not everyone has a Google account and may prefer Dropbox or OneDrive. Where is this login data maintained, if not by the developer?

Anyone who has played an emulator can tell you that there are 2 main ways to save games. You can create save states that are unique to the emulator, or you can use the in-game save method to update a .srm file (in the case of SNES games). Do you limit players to one or the other? Do you somehow try to manage both save states and the .srm file across all devices? If you do want to incorporate save states, do you run the risk of overwriting a save state slot that was supposed to be maintained?

Creating this Solution

Though the idea sounds mostly simple and straightforward, implementation could be extremely difficult.

Emulator Changes

What I imagine is the most reliable solution would be baking this functionality right into the emulator program. That would be the only way I can think of to guarantee that a .srm file can be updated consistently before you start playing. Even though you may be able to set triggers to update when the platform detects that the emulator program is running, you can’t guarantee that the process will be done reliably and in a timely manner. Plus, platforms such as the PSP probably have firmware limitations that you can’t always work around, no matter how good your programming skills are.

This would require altering the code of existing emulators or creating an entirely new emulator for every platform you want to play on. Considering how much is involved in creating an emulator, and how many platform options there are, this is a monumental task. Even if you limit the functionality to SNES emulators, the possibilities are more vast than I care to imagine.

Cloud Storage Updates

Perhaps a more elegant and useful solution would be to run a more generalized application that simply checks the location of each of your platforms for updated .srm files and upload that file to the cloud storage medium of your choosing. Though my coding experience for that sort of application is extremely limited, it doesn’t seem terribly difficult to have a script check these locations for more recent timestamps occasionally and upload any that have changed.

As for updating the local save files on each of your platforms, this could be a little more difficult. Platforms like Windows computers or Android devices could probably run code to check if the cloud version is newer than the local version occasionally, and intentionally when the emulator program is launched to ensure that any save file is up to date.

The main criteria for this check would have to be file name. Since the file is changed each time you play and save the game, I can’t think of any way to maintain an identifier to check that it is definitely the same file and should be updated. However, this runs the risk of overwriting a file that isn’t save data for the game in question. As unlikely as it would be to have a file in your cloud storage that is named “earthbound.srm” that isn’t saved data for EarthBound, there’s no way to check that for sure.

A more reliable method would be to play directly from the cloud location. Instead of dealing with local and cloud versions, and updating each platform appropriately, the emulator for each platform would just load directly from the cloud and update it each time you save the game. There are several issues with that idea, though. First, it would undoubtedly require changes to the emulator code. Also, it would require having internet access constantly from any platform you want to play on. Without internet access, you can’t access the save to load. If you lose internet access while playing, you could be “saving” and never actually update the file.

For not-so-easily connected platforms like the PSP, this could get a little more complicated. Though less convenient than a wireless connection, a wired connection would be much easier to implement updates for. Upon connecting the PSP to a PC and putting it into USB mode, the PC would detect it as a drive like any other location on the computer. At this point, the script could check the PSP’s .srm file against the cloud file exactly the same way it would for the local PC version, just looking at a different location. If the PSP version is newer than the cloud version, it could be uploaded to replace the cloud version. If the cloud version is newer, it could be downloaded and written to the PSP’s memory stick. Considering that USB mode charges the PSP while connected, this serves the added benefit of keeping the battery topped up. Plus, it’s much easier to just plug the PSP up at the end of every day and unplug it every morning, than it would be to manage files and move them around manually.

Rising to the Challenge

Though I could probably research and tinker with the cloud storage update option, I just don’t have the time right now. I get to play games so rarely at the moment that investing several hours into developing an application to maintain save files would be almost pointless. If I had more free time and got to play more often, I would love to figure out how to create this application and release it for others to you. For the next little while, that just isn’t feasible.

Any developers out there, I implore you to give it a shot. If you’re looking to flex your coding skills, show me what you can manage. Obviously, I’m not wanting to pay for something like this, since I could probably figure it out on my own eventually. I’m simply posing a task that you might attempt if you feel like you’re up to it.

Meta:

Words: 2501 | Characters: 13672 | Sentences: 120

Paragraphs: 39 | Reading Level: 11-12th Grade

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s