ID:161406
 
I've got 3 main save system types

Server Sided:
Pros: Autosaves arent a problem, when a player logs out or the server is shut down the auto saving still acomplishes its goal. Creates no lag
Cons: Saves are only stored on a single server limiting options for players. Hosts have access to save files

Global Server:
Pros: Players have access to their saves on all servers, greatest savefile security/manegement
Cons: If the host shuts down the server; autosave will not be available. Laggy due to all the file sending

Client Sided:
Pros: Players have access to their saves on all servers, but only from 1 computer. Mostly lag free in my experience
Cons: Autosave not available upon server shutdown and/or player logout. Savefile integrety severly comprimised due to saving on the player's machines

I'm looking for the best solution. Preferably some sort of global save server that will run without lag AND be able to auto-save players upon server shutdown
Any ideas?
Host a different server just for the saves using Export() and use Import() to load.

It's harder to do than to say it though.
In response to Subzero1 (#1)
Subzero1 wrote:
Host a different server just for the saves using Export() and use Import() to load.

It's harder to do than to say it though.

Global Server:
Pros: Players have access to their saves on all servers, greatest savefile security/manegement
Cons: If the host shuts down the server; autosave will not be available. Laggy due to all the file sending
In response to Falacy (#2)
How can it be laggy due to file sending ? You probably have auto save every minute or so.

You should just call auto save proc upon Logout().

That will lower the lag AND the "file sending"
In response to Subzero1 (#3)
Subzero1 wrote:
You should just call auto save proc upon Logout().

thats a genius plan! then when the host shuts the server down without warning the 100 people who have been playing for 8 hours lose all their work. GENIUS
In response to Falacy (#2)
You could keep a cached version of the savefile at the game server, and contact the several server every time the player logs in to ask it if a new version of the savefile has been uploaded. If a new version has been uploaded (you could compare file lengths or md5 hashes) download it, otherwise use the cached version. This would improve login speed for players who play on the same server a lot.

To be honest, I wouldn't advise having a central savefile system. Although they seem like a good idea, you might as well just have a dedicated game server instead. That way, other people can host their own 'version' of the game. Additionally, a central savefile system complicates any house or other persistant server-based systems.
In response to Hazman (#5)
Hazman wrote:
you might as well just have a dedicated game server instead.

The only problem with that is lag. I have a 10/1 MB connection and a quad core processor and my servers will still start to lag once about 50 people get on, once it hits 80 the lag starts to get bad. meaning at absolute best the average person isnt going to be able to host a decent server with more then 100 players on it at a time
In response to Falacy (#4)
Then call auto save upon world/Del() too.

world/Del() :

"When:
Called when the world is shutdown." <- Directly taken from the reference.
In response to Subzero1 (#7)
Subzero1 wrote:
Then call auto save upon world/Del() too.

world/Del() :

"When:
Called when the world is shutdown." <- Directly taken from the reference.

ive already tried this, it doesnt work
In response to Falacy (#6)
Unfortunately there's not going to be any magical solution that magically moves savefiles around without causing lag. Either you have to optimise your savefiles and send them as seldomly as possible (by caching them, as I mentioned, and by removing unnecessary mob vars, particularly those involving graphics).
At the end of the day, if you want to transmit a large amount of information then it's going to take time, there simply is no way around that.

Additionally, this is a public forum and no matter how 'noobile' a suggestion is, a person is still entitled to post it. You didn't mention that you'd already tried using world/Del() as a solution so please don't expect people to psychically work out what you've done and come up with a perfect solution to your problem.
In response to Hazman (#9)
Hazman wrote:
Either you have to optimise your savefiles and send them as seldomly as possible

Save files are already optimized, theyre only about 4kb each on average. and as for seldomly sending, the problem with that is i dont want players to lose their work when a host randomly shuts down so i tend to send saves semi-often

Additionally, this is a public forum and no matter how 'noobile' a suggestion is, a person is still entitled to post it.

there, i modified my post so that the balance of the world isnt disrupted <.<
In response to Falacy (#4)
Before being a smartass, I suggest knowing what you're talking about. Shutting down a server normally should still call Logout(). Don't call sleep(), though.
Go with a global server. Create a shutdown command for your host that systematically saves and boots each player while preventing new ones from logging in. When they're all gone have the server shut down on its own.
In response to SuperAntx (#12)
SuperAntx wrote:
Go with a global server. Create a shutdown command for your host that systematically saves and boots each player while preventing new ones from logging in. When they're all gone have the server shut down on its own.

HMMM if i cheated the interface up some i could make the X button call the verb i made which works somewhat like that, though it doesnt boot people or prevent them from rejoining <.< but! hmmm they could still close it other ways i supose... and hosting from deamon would still be a problem
In response to Falacy (#13)
If your main concern is your host terminating the server without saving everything, perhaps you should find a new one who follows instructions.
In response to SuperAntx (#14)
the goal is to be able to hand the host files out to anybody who wants to host
In response to Falacy (#10)
Falacy wrote:
Hazman wrote:
Either you have to optimise your savefiles and send them as seldomly as possible

Save files are already optimized, theyre only about 4kb each on average. and as for seldomly sending, the problem with that is i dont want players to lose their work when a host randomly shuts down so i tend to send saves semi-often


Sending 4kb files one at a time every 15 minutes, for even 100 players should not be an issue. If that is the case, then my suggestion is to get a global server that just doesn't suck. For 1,000 players sending every 15 minutes for a month you're still only talking 10gigs worth of bandwidth. Especially considering its nice and spaced out and not constant bursts, it should not be causing an issue.