Posted November 24, 2010
I love Steam games that support saving your games to the cloud. Installing a game anywhere and continuing your game is a beautiful thing. I've come up with a slapdash way to add this functionality to possibly any game ever made.
IMPORTANT NOTE: During the writing of this post I realized something. This currently doesn't efficiently support saves requiring multiple files of various types where the files are intermixed with the game files. Basically, it will copy either one file, or all files in a folder specified. I'm fairly certain there is a way to specify multiple files in one line and loop through them. I just wanted to get this out ASAP.
You need two things:
A Dropbox account, or some similar system that allows you to treat a folder on your hard drive as a "cloud drive". Dropbox offers free accounts that can store up to 2GB at the time this was posted. From here on I'm going to assume Dropbox since that's what I'm using.
A batch file that will copy your saves to and from the cloud. I just happen to have a template below.
Follow these steps:
1. Create a batch file in the root directory of the game you are going to launch. A batch file is a file with a .bat extension that executes command line commands. If you don't know how to create a batch file see here (assuming you're in Windows).
2. Paste the following in the batch file:
@echo off
REM ------------------------------------------------------------------
REM Set variables
REM ------------------------------------------------------------------
set cloudpath=c:\MyDropbox\
set cloudgamepath=Might and Magic Series\Might and Magic 1 - Book I\
set cloudsavefolder=saves\
set cloudlauncherfolder=launcher\
set localsavepath=.\
set locallauncherpath=.\
set savefile=roster.dta
set launcherfile=cloudlaunch.bat
set launchcommand="C:\Program Files\GOG.com\Might & Magic VI Limited Edition\DOSBOX\dosbox.exe" -conf dosboxMM1.conf -noconsole -c "exit"
REM ------------------------------------------------------------------
REM Copy save from cloud
REM ------------------------------------------------------------------
echo.
echo "%cloudpath%%cloudgamepath%%cloudsavefolder%%savefile%"
if exist "%cloudpath%%cloudgamepath%%cloudsavefolder%%savefile%" (goto :copysavefromcloud) else (goto :launchgame)
:copysavefromcloud
echo , downloading from cloud
copy "%cloudpath%%cloudgamepath%%cloudsavefolder%%savefile%" "%localsavepath%%savefile%" /y
REM ------------------------------------------------------------------
REM Execute %launchcommand%
REM ------------------------------------------------------------------
:launchgame
REM %launchcommand%
REM ------------------------------------------------------------------
REM Copy save(s) to cloud
REM ------------------------------------------------------------------
echo.
echo "%cloudpath%%cloudgamepath%%cloudsavefolder%"
if not exist "%cloudpath%%cloudgamepath%%cloudsavefolder%" (goto :createcloudsavepath) else (goto :copysavetocloud)
:createcloudsavepath
echo , creating
mkdir "%cloudpath%%cloudgamepath%%cloudsavefolder%"
:copysavetocloud
echo , uploading "%localsavepath%%savefile%"
copy "%localsavepath%%savefile%" "%cloudpath%%cloudgamepath%%cloudsavefolder%%savefile%" /y
REM ------------------------------------------------------------------
REM Copy launcher to cloud
REM ------------------------------------------------------------------
echo.
echo "%cloudpath%%cloudgamepath%%cloudlauncherfolder%"
if not exist "%cloudpath%%cloudgamepath%%cloudlauncherfolder%" (goto :createcloudlauncherpath) else (goto :copylaunchertocloud)
:createcloudlauncherpath
echo , creating
mkdir "%cloudpath%%cloudgamepath%%cloudlauncherfolder%"
:copylaunchertocloud
echo , uploading "%locallauncherpath%%launcherfile%"
copy "%locallauncherpath%%launcherfile%" "%cloudpath%%cloudgamepath%%cloudlauncherfolder%%launcherfile%" /y
@echo on
2a. Edit the batch. The only parts you should have to edit are in the Set variables section. Note the back-slash '\' placement. When you customize this, that's likely to be the place to make mistakes.
- cloudpath : In the case of Dropbox, this is the path to your Dropbox folder. You can customize this to be any folder structure within your Dropbox folder.
- cloudgamepath : This is for more organizational purposes.
- cloudsavefolder : Again, more organization. I like to have my saves and launchers separate. Obviously this one is for saves files.
- cloudlauncherfolder : Again, more organization. I like to have my saves and launchers separate. I copy the launcher up to the cloud just to make it easier when setting up a new location since depending on setup the files may not be installed to the exact same location on each PC.
- localsavepath : Where to find the local save file or files.
- locallauncherpath : Where to find this launcher... it's always 'right here' so this is really unnecessary, but I like things to be uniform.
- savefile : The file the game uses for saving the game. You can also use wildcards (e.g. '*.dat', '*.*')
- launcherfile : Another sort of fluffy one, the name of the batch file
- launchcommand : The command line to launch the game. Above you'll see I'm launching DOSBOX which is running Might and Magic 1.
That's really it.
I'm sure there's mistakes somewhere within the explanation, but the batch should work just fine once properly configured. Also notice that folders and files will be created and copied after the game launches the first time. You don't have to setup the cloud directories prior to running your batch.
Enjoy!
IMPORTANT NOTE: During the writing of this post I realized something. This currently doesn't efficiently support saves requiring multiple files of various types where the files are intermixed with the game files. Basically, it will copy either one file, or all files in a folder specified. I'm fairly certain there is a way to specify multiple files in one line and loop through them. I just wanted to get this out ASAP.
You need two things:
A Dropbox account, or some similar system that allows you to treat a folder on your hard drive as a "cloud drive". Dropbox offers free accounts that can store up to 2GB at the time this was posted. From here on I'm going to assume Dropbox since that's what I'm using.
A batch file that will copy your saves to and from the cloud. I just happen to have a template below.
Follow these steps:
1. Create a batch file in the root directory of the game you are going to launch. A batch file is a file with a .bat extension that executes command line commands. If you don't know how to create a batch file see here (assuming you're in Windows).
2. Paste the following in the batch file:
@echo off
REM ------------------------------------------------------------------
REM Set variables
REM ------------------------------------------------------------------
set cloudpath=c:\MyDropbox\
set cloudgamepath=Might and Magic Series\Might and Magic 1 - Book I\
set cloudsavefolder=saves\
set cloudlauncherfolder=launcher\
set localsavepath=.\
set locallauncherpath=.\
set savefile=roster.dta
set launcherfile=cloudlaunch.bat
set launchcommand="C:\Program Files\GOG.com\Might & Magic VI Limited Edition\DOSBOX\dosbox.exe" -conf dosboxMM1.conf -noconsole -c "exit"
REM ------------------------------------------------------------------
REM Copy save from cloud
REM ------------------------------------------------------------------
echo.
echo "%cloudpath%%cloudgamepath%%cloudsavefolder%%savefile%"
if exist "%cloudpath%%cloudgamepath%%cloudsavefolder%%savefile%" (goto :copysavefromcloud) else (goto :launchgame)
:copysavefromcloud
echo , downloading from cloud
copy "%cloudpath%%cloudgamepath%%cloudsavefolder%%savefile%" "%localsavepath%%savefile%" /y
REM ------------------------------------------------------------------
REM Execute %launchcommand%
REM ------------------------------------------------------------------
:launchgame
REM %launchcommand%
REM ------------------------------------------------------------------
REM Copy save(s) to cloud
REM ------------------------------------------------------------------
echo.
echo "%cloudpath%%cloudgamepath%%cloudsavefolder%"
if not exist "%cloudpath%%cloudgamepath%%cloudsavefolder%" (goto :createcloudsavepath) else (goto :copysavetocloud)
:createcloudsavepath
echo , creating
mkdir "%cloudpath%%cloudgamepath%%cloudsavefolder%"
:copysavetocloud
echo , uploading "%localsavepath%%savefile%"
copy "%localsavepath%%savefile%" "%cloudpath%%cloudgamepath%%cloudsavefolder%%savefile%" /y
REM ------------------------------------------------------------------
REM Copy launcher to cloud
REM ------------------------------------------------------------------
echo.
echo "%cloudpath%%cloudgamepath%%cloudlauncherfolder%"
if not exist "%cloudpath%%cloudgamepath%%cloudlauncherfolder%" (goto :createcloudlauncherpath) else (goto :copylaunchertocloud)
:createcloudlauncherpath
echo , creating
mkdir "%cloudpath%%cloudgamepath%%cloudlauncherfolder%"
:copylaunchertocloud
echo , uploading "%locallauncherpath%%launcherfile%"
copy "%locallauncherpath%%launcherfile%" "%cloudpath%%cloudgamepath%%cloudlauncherfolder%%launcherfile%" /y
@echo on
2a. Edit the batch. The only parts you should have to edit are in the Set variables section. Note the back-slash '\' placement. When you customize this, that's likely to be the place to make mistakes.
- cloudpath : In the case of Dropbox, this is the path to your Dropbox folder. You can customize this to be any folder structure within your Dropbox folder.
- cloudgamepath : This is for more organizational purposes.
- cloudsavefolder : Again, more organization. I like to have my saves and launchers separate. Obviously this one is for saves files.
- cloudlauncherfolder : Again, more organization. I like to have my saves and launchers separate. I copy the launcher up to the cloud just to make it easier when setting up a new location since depending on setup the files may not be installed to the exact same location on each PC.
- localsavepath : Where to find the local save file or files.
- locallauncherpath : Where to find this launcher... it's always 'right here' so this is really unnecessary, but I like things to be uniform.
- savefile : The file the game uses for saving the game. You can also use wildcards (e.g. '*.dat', '*.*')
- launcherfile : Another sort of fluffy one, the name of the batch file
- launchcommand : The command line to launch the game. Above you'll see I'm launching DOSBOX which is running Might and Magic 1.
That's really it.
I'm sure there's mistakes somewhere within the explanation, but the batch should work just fine once properly configured. Also notice that folders and files will be created and copied after the game launches the first time. You don't have to setup the cloud directories prior to running your batch.
Enjoy!