1
\$\begingroup\$

When writing a MMORPG game server...

Which storage design is better:

  • Should I only save character data from specific times?

    • On character log-out.
    • User disconnect.
    • From time to time. (every few minutes)
  • Should I save it immediately? Which would make writing be more extensive.

Other things:

  • What is the best practice when dealing with data on a real time MMORPG game?
  • Which database is best with being multi-platformed in mind?
\$\endgroup\$
1
  • \$\begingroup\$ There's no general best or better option. This is a decision you need to make on your own. Answers to this question would only be opinions. \$\endgroup\$
    – House
    Apr 2, 2014 at 14:01

1 Answer 1

1
\$\begingroup\$

This is sort of a vague question, but I will take a stab at it.

One thing for certain you do not want any of the user disconnects, character logs off or any other long interval saving. This is because if your server crashes you do not want to lose the players last 5h of gameplay. You want to relaunch the server process and be back without as little loss as possible. So basically the only really feasible process is storing almost immediately.

But you could actually take it a step further, use the database as the actual game world representation. Here is a nice article outlining the approach. (Ignore that it claims to be about entity-component system.) The gist of the article series is that the all the game state is in the database and each individual system only communicates with the database.

\$\endgroup\$
4
  • 1
    \$\begingroup\$ That is true, I have had experiences before having the same design. that when the server crashes all information rolls back. or technically lost. \$\endgroup\$
    – majidarif
    Apr 2, 2014 at 14:56
  • 1
    \$\begingroup\$ Just a follow-up, wouldn’t the read/write IO to the database be very heavy if implemented this way? \$\endgroup\$
    – majidarif
    Jul 8, 2014 at 16:44
  • \$\begingroup\$ Yes, no, maybe. This really depends on your game world and logic. On the one hand databases can be quite fast, on the other you do not want to query the database in tight loop. Many systems are either only consumers or producers of data. This can be used to your advantage so that you maintain the data in memory and only sync in a read-only/write-only fashion. Also the article talks about an MMO where chances are you can not maintain the entire world in memory anyway. Again it depends on what you are trying to do. \$\endgroup\$
    – rioki
    Jul 9, 2014 at 11:30
  • \$\begingroup\$ I'm still not too familiar with server side MMO development are there any good resources on this for most specially logic and implementation? \$\endgroup\$
    – majidarif
    Jul 9, 2014 at 12:23

Not the answer you're looking for? Browse other questions tagged .