2

What are your thought about saving data (such as character stats, achivements, items) on a MMO game? Clearly you want as little dataloss as possible if(when) the server goes down for some reason.

  • Saving the character whenever something important has happend? Seems jumpy, performancewise?
  • Saving everything once very X Hours? Causes a few seconds freeze, but could be accompanied with a nice "The world is saving"-message.
  • Maybe having a save-timer for every character, where you queue the character for saving every once in a while, and the server works on this queue whenever it is not busy?

Out of these three i think the last one is a pretty good solution, but i might have overlooked something. But what are your thoughts, how are the "big boys" doing it?

Fredrik Widerberg
  • 3,068
  • 10
  • 30
  • 42
  • 4
    You might want to post you question on: http://gamedev.stackexchange.com/ –  Jan 28 '11 at 20:50
  • ACI (no D) in memory and some background threads flushing the states to some D (like database) – bestsss Jan 28 '11 at 20:57

4 Answers4

3

Saving the character whenever something important has happend? Seems jumpy, performancewise?

Not in the least. Compared to everything else that has to be done for such a game, this is utterly trivial. Any decent database engine will handle that. That's what they're built to do.

Michael Borgwardt
  • 342,105
  • 78
  • 482
  • 720
1

I would use a write-through cache for my database. Most aspects of a character don't change very often. Those that do, like position, already require some pretty heavy engineering to keep coherent across servers and clients.

nmichaels
  • 49,466
  • 12
  • 107
  • 135
1

maybe make a sort of cache server. game server would send read/write requests to cache server, cache server would write/read stuff from db and send back to game server. this way if certain query gets laggy it wont stop thread in gameserver, if server goes down - cahe server will still have cached data and save it if not saved already.

marrat
  • 534
  • 1
  • 6
  • 14
0

I wrote this http://onemanmmo.com/?doubleentry while solving how to record microtransactions and guarantee they survive a server crash for my game. The article is on using a double-entry accounting database schema on top of MySQL with some info on stored procedures and security.

Robert Basler
  • 371
  • 2
  • 9