How do MMORPGs store data

How do games like runescape store every last detail of what you have d

  • (2 Pages)
  • +
  • 1
  • 2

21 Replies - 6073 Views - Last Post: 20 August 2009 - 08:57 PM Rate Topic: -----

#1 xssvgamer  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 22
  • Joined: 20-March 09

How do MMORPGs store data

Posted 22 March 2009 - 04:03 AM

On games like runescape for example, you move three squares forward and logout. When you login you're still in those three squares, or if you walked around for a bit, got up some levels and got some new items then just suddenly turned of your computer, when yo login.. its all there still.

How do they store all of this information? I'm pretty sure they dont do constant database updates? that would be mental on server load etc?

Just looking for a bit of information really, not related to any projects im doing, just a bit of a wonder.

Thanks.

Is This A Good Question/Topic? 0
  • +

Replies To: How do MMORPGs store data

#2 TMKCodes  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 48
  • View blog
  • Posts: 440
  • Joined: 21-March 09

Re: How do MMORPGs store data

Posted 22 March 2009 - 04:05 AM

Why they couldn't do constant database updates? They just update your coordinates into the database when you log out and constantly while you play.
Was This Post Helpful? 0
  • +
  • -

#3 xssvgamer  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 22
  • Joined: 20-March 09

Re: How do MMORPGs store data

Posted 22 March 2009 - 04:17 AM

View PostTMKCodes, on 22 Mar, 2009 - 03:05 AM, said:

Why they couldn't do constant database updates? They just update your coordinates into the database when you log out and constantly while you play.


That seems alot... if i click a different coordinate (x5,y5) for example, i get to about (x3,y4) and my computer turns off, when i log back in im on x3,y4 again. That means it monitors every step..

I just find it hard to grasp that for 200,000 members online at once, each member doing about 5 actions per second (moving/training, chatting, slecting a tab...probably more) they just keep updating the database.

Are you talking from knowledge and experience or is it guess work?
Was This Post Helpful? 0
  • +
  • -

#4 TMKCodes  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 48
  • View blog
  • Posts: 440
  • Joined: 21-March 09

Re: How do MMORPGs store data

Posted 22 March 2009 - 04:20 AM

They might not monitor every step. They may use 10-20 steps to save it, but they save on logout the latest steps and try to save on disconnect.

Knowledge, because i've worked on similar game, well it was not 3d, but 2d mmorpg with java.
Was This Post Helpful? 1
  • +
  • -

#5 xssvgamer  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 22
  • Joined: 20-March 09

Re: How do MMORPGs store data

Posted 22 March 2009 - 04:24 AM

View PostTMKCodes, on 22 Mar, 2009 - 03:20 AM, said:

They might not monitor every step. They may use 10-20 steps to save it, but they save on logout the latest steps and try to save on disconnect.

Knowledge, because i've worked on similar game, well it was not 3d, but 2d mmorpg with java.


Oh ok fair enough, thats some pretty intense server needed.. You would think the game would be slower than expected, that must mean that at every change point they get all the data again from the database too? or maybe im just not experienced enough with games yet, thanks for your reply anyway.
Was This Post Helpful? 0
  • +
  • -

#9 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5761
  • View blog
  • Posts: 12,574
  • Joined: 16-October 07

Re: How do MMORPGs store data

Posted 22 March 2009 - 04:26 AM

View Postxssvgamer, on 22 Mar, 2009 - 05:03 AM, said:

I'm pretty sure they dont do constant database updates?


Of course they do. :P You mean for like every little footstep? Probably not.

The game server knows all, right? Periodically, the "state" of the entire server will get flushed to a database. In the case of an individual account, the state of the character is stored when they log out or time out. It's then read and restored when they log back in.

Reasonably, there are a number of in game actions that will flag a character for a database update. That probably won't mean immediate update, but rather a position in the queue for when the storage processor gets around to it. It's possible you could log out and log back in with never a database hit; the state is still in the server.

As long as the middle tier, the game server itself, is running it probably doesn't even need a database. But it will need one for startup, shutdown, and most likely the catalog of all the objects that make up the environment.
Was This Post Helpful? 1

#10 xssvgamer  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 22
  • Joined: 20-March 09

Re: How do MMORPGs store data

Posted 22 March 2009 - 04:32 AM

Wow ok thanks alot, i just thought maybe they would have something like a datafile or something stored where they would just add all of the actions to, then as they logout just do a big query all at once or something...

Wouldn't that be easier and less stress on the database?
Was This Post Helpful? 0
  • +
  • -

#11 TMKCodes  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 48
  • View blog
  • Posts: 440
  • Joined: 21-March 09

Re: How do MMORPGs store data

Posted 22 March 2009 - 04:34 AM

Why they need datafile if they can keep the stuff safe in the server memory?
And saving to datafile takes also resources as would querying to SQL database.

This post has been edited by TMKCodes: 22 March 2009 - 04:36 AM

Was This Post Helpful? 0
  • +
  • -

#12 xssvgamer  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 22
  • Joined: 20-March 09

Re: How do MMORPGs store data

Posted 22 March 2009 - 04:42 AM

true but what takes up more? my guess would be the SQL query..?

Thanks for the replys aswell.
Was This Post Helpful? 0
  • +
  • -

#13 TMKCodes  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 48
  • View blog
  • Posts: 440
  • Joined: 21-March 09

Re: How do MMORPGs store data

Posted 22 March 2009 - 04:45 AM

SQL querys are not that heavy if the sql database is on same server as the game server
Was This Post Helpful? 0
  • +
  • -

#14 Imdsm  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 103
  • View blog
  • Posts: 362
  • Joined: 21-March 09

Re: How do MMORPGs store data

Posted 22 March 2009 - 08:30 AM

View Postxssvgamer, on 22 Mar, 2009 - 03:42 AM, said:

true but what takes up more? my guess would be the SQL query..?

Thanks for the replys aswell.


I would say a system call to read from a file would take more resources and time than it would to make a quick connection (or use a persistent connection) to the database server and query. Along with opening your datafile, you also have to seek the data you need, it'd get very clogged up and you'd need to build a whole system around how you store data in the said file.. and as the games authors are game makers, they probably aren't able to spend all their time on the datafile software to make it quicker unlike the people at MySQL, PgSQL, MsSQL + more ;)

This post has been edited by Imdsm: 22 March 2009 - 08:31 AM

Was This Post Helpful? 1
  • +
  • -

#15 WolfCoder  Icon User is offline

  • Isn't a volcano just an angry hill?
  • member icon


Reputation: 782
  • View blog
  • Posts: 7,610
  • Joined: 05-May 05

Re: How do MMORPGs store data

Posted 22 March 2009 - 08:59 AM

Typically, the server program has everything in it's memory. It only needs to save everything when you log out or get disconnected- hard disk writes are costly.
Was This Post Helpful? 0
  • +
  • -

#16 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5761
  • View blog
  • Posts: 12,574
  • Joined: 16-October 07

Re: How do MMORPGs store data

Posted 27 March 2009 - 04:04 AM

It should be noted that commercial databases are very quick and keep an in memory cache. They typically write to disk only when a particular event happens; periodic checkpoint, manual checkup, shutdown, etc. Writing data to a database is usually far less costly than just writing directly to a file system. In an optimized system, the database has a pre allocated chunk of file system that handles on it's own. Big databases handle millions of transactions a minute without showing any strain; it's what they're made for.
Was This Post Helpful? 1
  • +
  • -

#17 Mike Chambers  Icon User is offline

  • D.I.C Head

Reputation: 22
  • View blog
  • Posts: 59
  • Joined: 30-March 09

Re: How do MMORPGs store data

Posted 30 March 2009 - 04:43 PM

game servers for stuff like this HAVE to know exactly where/what is going on for every player for EVERY single step of the game, or the game wouldn't work. if you logout or you connection drops, it saves the latest info it had for you to their hard drives. it's that simple.

if the server didn't know every little tiny tiny detail from every millisecond, the games wouldn't work.
Was This Post Helpful? 1
  • +
  • -

#18 combat_kid  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 01-April 09

Re: How do MMORPGs store data

Posted 02 April 2009 - 06:55 AM

these easiest way to grasp ths is, the fact that you log out saves the game were you are stud and if it crashed the server still has you logged in untill a time out is called and then it logs you out saving all the data you beleive is stored in your memory which it clearly isnt
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2