Fuchsilein

Devil Fox
Veteran
Joined
Aug 20, 2015
Messages
53
Reaction score
19
First Language
German
Primarily Uses
I'm looking into this for a few day now and i just cant figure out how to hell you would make your game save his savegames online..

I can work with PHP and MySQL but i dont get along with JS ..

So i kinda want a Plugin which would change to standard way of saving in the local storage into saving on a server as .json or .txt or in a Database.. smth like that :<

As well have the possibilty to load it from there again :o

I've looked around and only found a few people working on Complete MMORGP Frameworks.. x.x which isnt what i need.. i only want a simple serverside savegame so that you can continue on whatever device you want to and from every location you want.
 

Kaliya

// Caffeine Overload
Developer
Joined
Nov 1, 2015
Messages
506
Reaction score
569
First Language
English
Primarily Uses
RMMV
Well im sure you are aware that you will need some for of identification system to determine which save is which and for whom, so you'd need some form of authentication/login system. Assuming you knew this, what methods did you have in mind?
 

Nohmaan

Veteran
Veteran
Joined
Jul 7, 2012
Messages
182
Reaction score
49
First Language
English
I'm looking into this for a few day now and i just cant figure out how to hell you would make your game save his savegames online..

I can work with PHP and MySQL but i dont get along with JS ..

So i kinda want a Plugin which would change to standard way of saving in the local storage into saving on a server as .json or .txt or in a Database.. smth like that :<

As well have the possibilty to load it from there again :o

I've looked around and only found a few people working on Complete MMORGP Frameworks.. x.x which isnt what i need.. i only want a simple serverside savegame so that you can continue on whatever device you want to and from every location you want.
I think there's utility to this, but are you wanting to set up a server and storage for these saves for your players?  How long will this save location be around and does it have HA for people trying to play the game?  And how will you handle an account server for login and authentication?

Just logistically, can't the onus be on the player to save to a Cloud storage (OneDrive, DropBox, GoogleDrive, etc.) if they want to play somewhere else?
 

Kaliya

// Caffeine Overload
Developer
Joined
Nov 1, 2015
Messages
506
Reaction score
569
First Language
English
Primarily Uses
RMMV
Yeah you could do that, have them enter the url to get the save file from. I was just thinking he wanted something more robust and user friendly that that lol.
 

Nohmaan

Veteran
Veteran
Joined
Jul 7, 2012
Messages
182
Reaction score
49
First Language
English
Yeah you could do that, have them enter the url to get the save file from. I was just thinking he wanted something more robust and user friendly that that lol.
 Maybe,I can't speak for the request itself- I guess my comment was less 'can you' and more 'should you'.  

It would need to replace the save/load function with one that puts a file on the remote server or gets the file from a remote server.  So, the first time you load or save a new game you'd need an account.  (You could store the password info in a file for quicker save/load on a system you've already played on though).

But the bigger thing I was thinking was more of for just a save file, is it worth maintaining a server for that function so users can save and load?  What happens if you're at school/work and the server is down and people wanted to play?  (HA = High Availability)  What happens if a user wants to save and their internet connection dropped while they were playing?  Would they be unable to save or would it save locally and then flag a variable that it needs to sync the next time it tries to save/load?  How many people do you expect would play your game on several devices?

Totally not trying to hijack your request though-- also not trying to nay-say; just commenting on whether or not it's something that would really be useful to you?
 

Fuchsilein

Devil Fox
Veteran
Joined
Aug 20, 2015
Messages
53
Reaction score
19
First Language
German
Primarily Uses
Most of my players are complaining about that fact that they can play it in the browser online, but dont have to possibilty to accses their savegame from other places.

So yeah it'll be useful for me to maintaining a server only for save/load :p

How this is done, its up to the one making that script I'm fine as long it provides the possibilty to simply maintain savegames on a server accsesable for the user, if this is done through a "Export" "Import" system or overwriting the current savesystem is up to you guys

Like i said, i want it to be as simple as possible.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,647
Reaction score
15,742
First Language
English
Primarily Uses
RMMV
It saves to the cloud by default if you are on a mobile device.
 

Fuchsilein

Devil Fox
Veteran
Joined
Aug 20, 2015
Messages
53
Reaction score
19
First Language
German
Primarily Uses
So if i make a app out of it, it'll save within the .. google account (android)? So if the user would play the game on different MOBILE devices he would have the same savegame?

There must be a way to get this to work on "normal" browser to :x
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,812
Reaction score
889
First Language
German
Primarily Uses
RMMZ
If a mobile game saves to the cloud (which i didn't test, but i'm trusting Shaz), this will be handled by the OS (Android or iOS), since the StorageManager itself has no function to save data to the cloud. It either saves to a local file or to web storage (which is NOT online, but the local storage of your web browser).


Saving/loading on a cloud server wouldn't actually that different from local saving/loading. The main work would be setting up that server and services to interact with.
 

Purzelkater

cat as cat can
Veteran
Joined
Feb 20, 2016
Messages
86
Reaction score
69
First Language
German
Primarily Uses
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.
 
Last edited by a moderator:

Fuchsilein

Devil Fox
Veteran
Joined
Aug 20, 2015
Messages
53
Reaction score
19
First Language
German
Primarily Uses
Wow! sounds like you've got exactly what i need! :>


I've lost hope on that one already so its nice to see someone working on it <3
 

Purzelkater

cat as cat can
Veteran
Joined
Feb 20, 2016
Messages
86
Reaction score
69
First Language
German
Primarily Uses
Okay, I have added some simple session management (can be disabled on plugin properties).


With session management only one player (means game instance) can be the "active player". All other players are in "passive mode", can't save the game.


How does it work?


On the server there is a session table. Every time a player wants to continue a saved or start a new game the game ask the server if there is an active player already in the game. If so, the games runs in "passive mode". If no active player found, the game runs in "active mode". Doesn't matter which mode, every running game has an entry on the session table (so you can see, how many players are on the game this time).


In "passive mode", all commands in command window are hidden but options and end game. So in "passive mode" you can't save the game (auto save on game end is disabled in passive mode too).


To distinguish the game instances the server sends a GUID to the game on first connect. This GUID is unique for every session (expires if the whole game will be quit).


Important: An active session will be changed to passive if the player comes back to the title screen. But it the game is closed without come back to the title screen, the session is marked as active on the database furthermore and nobody can be active anymore.


I will add a timeout option in future to handle this.
 

Purzelkater

cat as cat can
Veteran
Joined
Feb 20, 2016
Messages
86
Reaction score
69
First Language
German
Primarily Uses
First release is out there. You can find it here
 
Last edited by a moderator:

Latest Threads

Latest Profile Posts

practice drawing start with duck :guffaw: 64*64010.PNG
FREE puzzle generator in steam workshops. It will randomly generate countless puzzles.
If you have the steam version of MV, you can see how I made the puzzles and freely copy/paste the events into your own project.

I might add more generators to the steam workshop in the future.

Enjoy!

Hit the ground running! first day back and got ALOT of things going and even have a bunch of fresh ideas on how to tackle old problems!
I've got like 15 game ideas that I'm working on at the same time, and I'm fresh out of motivation for all of them. the past couple of weeks have been me not working on anything at all and wasting my time instead of being productive... gosh I love myself so much
Well turns out I'm not going to the fair... COVID cases way too high in my state. Instead I'll just go to Chuck E Cheese's and transfer all my tickets from Orlando to my normal PlayPass wristband.

Forum statistics

Threads
118,762
Messages
1,118,523
Members
155,911
Latest member
aephemerial
Top