Advertisement
Guest User

how MMO servers work

a guest
Aug 11th, 2014
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.65 KB | None | 0 0
  1.  
  2.  
  3. Written by Loic "Atreid" Claveau on April 12, 2013
  4.  
  5. Hello, my name is David Ray and I am the Lead Network & Database Engineer here at Carbine Studios. A mini-bio for me is that I’ve been in the game industry for the last 19 years, having worked for some major studios such as Dynamix, Interplay, Activision, and Blizzard prior to starting at Carbine nearly 5 years ago. Prior to entering the game industry, I worked in aerospace (on the space shuttle project) and the cellular industry (working on bringing internet to cell phones).
  6.  
  7. A post was pointed out to me over on Wildstar-Central today with user “Mizpah” asking about how MMO servers work. I thought it may be nice to give you all a general overview. Obviously I’ll need to be vague about certain things, due to proprietary design, but this should serve to give you a basic idea of how things work.
  8.  
  9. Before we begin, some quick definitions for the less techy amongst us:
  10.  
  11. Daemon: In multitasking computer operating systems, a daemon (pron.: /ˈdeɪmən/ or /ˈdiːmən/) is a computer program that runs as a background process, rather than being under the direct control of an interactive user. (I stole this definition from Wikipedia.)
  12.  
  13. Realm: A collection of WildStar servers that collectively represent a full planet of the game. Each realm effectively represents its own planet, even though all of the realms are effectively identical. Some realms will have special rules that apply only to them, like PVP. In other MMO’s this is sometimes called “Server” or “Shard” or a wide variety of other names that all means the same thing.
  14.  
  15. Server Architecture
  16.  
  17. Our server architecture is currently made up of 11 daemons running across several server machines. For some of our daemons, there’s only one per region (i.e. country), where others there are dozens, or maybe even hundreds, per realm.
  18.  
  19. When you connect to play our game you first connect to our “Auth Daemon” (auth is short for authentication), this is the process that accepts your username and password and decides if you’re allowed to play. Authentication information is always kept secure, even in our databases. Once the daemon has decided that you’re allowed to play, it fetches your security permissions. Based on your permissions it will present you with a list of realms you are allowed to play on. Once you select a realm, you will be handed off to other sets of daemons, and the Auth Daemon is fundamentally “done” with you.
  20.  
  21. After that you connect to a “User Daemon”. This daemon is responsible for keeping track of you as a playing entity, it tracks all of your character data, including but not limited to; character stats, inventory items, quest progress, and pretty much anything else from within the game. There is one of these daemons per realm. This daemon also handles the character creation process. You stay connected with the user server for the entirety of the time you are playing.
  22.  
  23. Once you have selected or created a character, the “User Daemon” will then also connect you to a “World Daemon”. This daemon may have already been running, or in the case of instances it can be launched just for you and/or your group. This daemon is responsible for the bulk of what people would consider gameplay. It handles all the creatures and their AI, the loot that is dropped, any combat and spells cast by players or creatures, pretty much everything else that is “game” happens here. Whenever something changes about the players, the World Daemon reports it back to the User Daemon to record it in our databases.
  24.  
  25. That is pretty much the fundamentals of how the game works. All in all we have 11 daemons currently. I’m not going to go into detail about each of them, but they all have specialized tasks, one of the daemons only job is to figure out what machine each of the other daemons runs on based on CPU and memory load. And that’s really important, because of the way we have broken up our daemons, it should allow us to add more hardware to handle additional load whenever we need it. If we want more players on a realm, we can add more server machines to run more World Daemons.
  26.  
  27. Some Q&A
  28.  
  29. And now let me answer some of the specific questions that were asked in the thread from Wildstar Central:
  30.  What might the split be between worker infrastructure and storage look like ? How many server components and services are involved ? chat, login, federation, logic etc.
  31.  
  32. This is too big of a question to answer fully, but some details.
  33.  
  34. Our storage is MS SQL Server. We have a “few” realms per SQL server, this is one of our scalable components.
  35.  
  36. Chat can be handled on one to three of the daemons. If it’s a direct message from one player to another, then it can just be handled on the user daemon. If the chat is a say or a yell, it needs to go through the world daemon to figure out who is in the area to “hear” it. And then if the chat message is for a user who’s not…. Well I’ll leave that feature for a later announcement. ;)
  37.  Where are the most likely bottlenecks - db access?
  38.  
  39. The database is where we’re expecting our bottlenecks to be. But a lot of our daemons were written with scalability in mind, so if we find out bottlenecks are indeed the database we can rebalance that load and add more database servers with relative ease.
  40.  What db techs might be relevant ?
  41.  
  42. As mentioned above, we use MS SQL server.
  43.  I would love to see a topology of a 'real world' mmo server infrastructure and an article that covers a deep dive't this is what's going on'.
  44.  
  45. Well, you got what you asked for, at least the high level view above. If you want more details about what the other 9 daemons are, we do have an open network programmer position on our jobs page. ;)
  46.  I am also interested in how much innovation has impacted the mmo space sever and datacentre side in the last 5 years. If it follows the trends in the enterprise data centre, then the scalability and, provisioning and burst variations should have helped a lot...
  47.  
  48. Oh, lots of things have changed since I worked on my first MMO. The biggest in my opinion is the fact that all of our servers are running 64-bit now. It was a pain staying under 2 GB back in the day. Also, CPUs and hard drives are unbelievably faster than back then. I’m an old timer, when I first got into the game industry we were targeting 16Mhz-33Mhz machines with 1-4 MB of RAM, and distributing on floppy disks. So yeah, things have changed. :)
  49.  
  50. Thanks so much to David for taking the time to talk about servers. Do you have an idea for a cool blog post you'd like to see here in the future? Let us know on Facebook, Twitter, or one of our many fansite communities!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement