Ok so I've been interested in building an online game for quite some time, mainly as a learning experience, but also as a fun project. Now don't go all anti-mmo, not good enough without 50,000 people on my team, whatever on me. This is a simple question to gain new knowledge.
So I've been studying various articles and posts and basically anything I could get my hands on, but one... well several questions keep popping into my head, but one major one in particular. And I can never seem to find a concrete answer just a lot of theory and discussion.
How does the server and database interact? For instance, when the server starts up, does it create a list/array of all the game objects (i.e. Mobs, Props, etc...) And store them as a simple unique id reference and then pull the data from the database when necessary, or does it create a new object based on a class, give it a unique id and then store all the data about that object that's necessary in it from the database and add it to the list/array? Or is it some sort of hybrid system that uses the best performance features of both systems?
Basically how does the server store the game world objects? I mean we're talking like... 10K+ objects just for a basic online game right? That's a lot... then considering having to sort through all of those when you need to get information on a specific one.... Is it just a giant list of all the objects or are they separated into several list/arrays, like one that holds all the mobs, one that holds all the items laying on the ground from the last plio-platipus monster you kicked the crap out of.... Then based on the interaction (method call) you sift through the list/array you need...?
I could think of a million ways to do this but I'm sure there is a best performance method that is commonly followed.... Any thoughts?
Edited by MakaiKingCross, 24 January 2014 - 10:16 AM.