I know this thread is a little bit outdated, but I hope it's okay to pick it up.
And I know the Cloud Based Save Demo from harvard1932, but I haven't found so much about it.
Well, because I need a cloud based storage system for my game idea, I have started to write my own. It's my first plugin and my first work with RMMV at all, so there would be better ways, I'm sure.
Some Basics
My cloud based storage system has two parts: a plugin for RMMV and php script(s) on the server. So you need a server who can handle php, but this should be self-evident for this kind of system. For simplification I have used SQLite3 as database at the moment. The advantage is you don't need a MySQL database server and all data are stored on just one file on your server (you can easily backup and investigate). But of course your server must have SQLite and PDO drivers installed.
I know it's easily to manipulate the data on client side but it's no my goal to make a high security cloud system for RMMV. It will be a system you can use for cross platform save/load of your games or for some simple asynchron multiplayer games if you know you can trust the others in this way.
If the plugin is activated, your game don't write or read savegames from you local drive or the browser local storage anymore. Never!
Also there are no save/load slots anymore. Your game will have just one savegame on your server. No more, no less. But with access to the database you have access to all previous made savegames (stored on your server).
So far I have tested it on my Ubuntu server (database and scripts) and game clients on Windows and the server (played on Firefox).
The PlugIn - Parameters
The PlugIn has some properties you can set for your project.
- gameName: This should be unique for all your games, because it makes sure you get the saved data of the right game from your server (so you can handle several different games on your server).
- gameVersion: The plugin verify the version of a game is up-to-date to handle the last game saved on the server.
- url: Right, this is where your php scripts are.
- saveOnEnd: If active your game is saved on every games end on the server. Well, of course you can save it at all times but with this option a player can't drop the last events and try it again.
- preventRestart: Usually you can start a new game at all times. This would overwrite the could saved data and reset the whole game. With this option active you can't start a new game if a saved game is on the server.
- logLevel: Well, just an option which messages are shown on the console.
Title Screen
On start the plugin checks if a savegame for this game is on the server. "Continue" is enabled, if a savegame was found and the game version is recent enough. If you select "Continue" the latest savegame will be loaded from the server and the game starts with it.
If you select "New Game" and preventRestart is disabled a new game will start as you know. If preventRestart is enabled the plugin checks for a savegame on the server. If there is no savegame you can start a new game. If a savegame was found but your game version is obsolete an error message is shown (well, you can't play the game until you have a newer game version). If a savagame was found and your game version is up-to-date the latest savegame will be loaded from the server and the game starts with it.
InGame Option Screen
If you select "Save" the plugin will send your current game data to the server, hopefully saves it on the database. There are no other options, just save and gone.
If you select "End" and "To Title" and saveOnEnd is active your current game data will be saved on the server before the title menu is shown. If saveOnEnd is disabled you will see the title menu without saveing the last state on server.
Server
On the server side there are 3 scripts (save, load, check) at the moment.
Check reads the game version of the last relevant savegame and compares it with your game version.
Load reads the last relevant savegame from the database and sends the json game data back to the game.
Save writes the transmitted json game data into the database (with game name and version, username and timestamp).
Overall it looks surprisingly simple at this state.
Next Steps
Well, the plugin needs some rework to make it more nifty, so I can show it here. ^^
I think it would be nicer if there is just one script handles all the requests from the plugin.
The next big step will be an user authentication. XMLHttpRequest has some basic HTTP Authentication techniques I would use. With this user registration/login is essential.