views:

477

answers:

5

How are Massively Multiplayer Online RPG games built?

  • What server infrastructure are they built on? especially with so many clients connected and communicating in real time.

  • Do they manage with scripts that execute on page requests? or installed services that run in the background and manage communication with connected clients?

  • Do they use other protocols? because HTTP does not allow servers to push data to clients.

  • How do the "engines" work, to centrally process hundreds of conflicting gameplay events?

Thanks for your time.

A: 

The Software Engineering radio podcast had an episode with Jim Purbrick about Second Life which discusses servers, worlds, scaling and other MMORPG internals.

olle
+5  A: 

Many roads lead to Rome, and many architectures lead to MMORPG's.

Here are some general thoughts to your bullet points:

  • The server infrastructure needs to support the ability to scale out... add additional servers as load increases. This is well-suited to Cloud Computing by the way. I'm currently running a large financial services app that needs to scale up and down depending on time of day and time of year. We use Amazon AWS to almost instantly add and remove virtual servers.
  • MMORPG's that I'm familiar with probably don't use web services for communication (since they are stateless) but rather a custom server-side program (e.g. a service that listens for TCP and/or UDP messages).
  • They probably use a custom TCP and/or UDP based protocol (look into socket communication)
  • Most games are segmented into "worlds", limiting the number of players that are in the same virtual universe to the number of game events that one server (probably with lots of CPU's and lots of memory) can reasonably process. The exact event processing mechanism depends on the requirements of the game designer, but generally I expect that incoming events go into a priority queue (prioritized by time received and/or time sent and probably other criteria along the lines of "how bad is it if we ignore this event?").

This is a very large subject overall. I would suggest you check over on Amazon.com for books covering this topic.

Eric J.
EVE Online is an exception to the "segmented world" approach used by e.g. World of Warcraft. You can read about the setup they use at: http://highscalability.com/eve-online-architecture
Ian Kemp
@Ian: Interesting read. It looks like they essentially segment their world along the lines of what's happening in each solar system and rout events from the client-facing tier to the server responsible for a particular geographic area of the game world.
Eric J.
A: 

Take a look at Erlang. It's a concurrent programming language and runtime system, and was designed to support distributed, fault-tolerant, soft-real-time, non-stop applications.

ryeguy
Erlang does seem like it would be good, but I don't think it is used to make MMORPGs in practice.
Chuck
It's not, so it has nothing to do with how MMOs are built.
Whatever
The reason it isn't used in practice is because it's a functional language and most programmers don't know anything but OO. I also remember reading about an MMO server having been written in Erlang. Trust me, Erlang is better suited for building servers than any other language out there, hands down.
ryeguy
I understand what you're saying, but the question isn't really about what you would use for the task in a hypothetical world where you made MMORPGs; it's about what techniques are actually used to make MMORPGs.
Chuck
+2  A: 

Because MMOs by and large require the resources of a business to develop and deploy, at which point they are valuable company IP, there isn't a ton of publicly available information about implementations.

One thing that is fairly certain is that since MMOs by and large use a custom client and 3D renderer they don't use HTTP because they aren't web browsers. Online games are going to have their own protocols built on top of TCP/IP or UDP.

The game simulations themselves will be built using the same techniques as any networked 3D game, so you can look towards resources for that problem domain to learn more.

For the big daddy, World of Warcraft, we can guess that their database is Oracle because Blizzard's job listings frequently cite Oracle experience as a requirement/plus. They use Lua for user interface scripting. C++ and OpenGL (for Mac) and Direct3D (for PC) can be assumed as the implementation languages for the game clients because that's what games are made with.

One company that is cool about discussing their implementation is CCP, creators of Eve online. They have published a number of presentations and articles about Eve's infrastructure, and it is a particularly interesting case because they use Stackless Python for a lot of Eve's implementation.

http://www.disinterest.org/resource/PyCon2006-StacklessInEve.wmv http://us.pycon.org/2009/conference/schedule/event/91/

There was also a recent Game Developer Magazine article on Eve's architecture:

https://store.cmpgame.com/product/3359/Game-Developer-June%7B47%7DJuly-2009-Issue---Digital-Edition

Whatever
+1  A: 

What server infrastructure are they built on? especially with so many clients connected and communicating in real time.

I'd guess the servers will be running on Linux, BSD or Solaris almost 99% of the time.

Do they manage with scripts that execute on page requests? or installed services that run in the background and manage communication with connected clients?

The server your client talks to will be a server running a daemons or service that sits idle listening for connections. For instances (dungeons), usually a new process is launched for each group, which would mean there is a dispatcher service somewhere mananging this (analogous to a threadpool)

Do they use other protocols? because HTTP does not allow servers to push data to clients.

UDP is the protocol used. It's fast as it makes no guarantees the packet will be received. You don't care if a bit of latency causes the client to lose their world position.

How do the "engines" work, to centrally process hundreds of conflicting gameplay events?

Most MMOs have zones which limit this to a certain amount of people. For those that do have 100s of people in one area, there is usually high latency. The server is having to deal with 100s of spells being sent its way, which it must calculate damage amounts for each one. For the big five MMOs I imagine there are teams of 10-20 very intelligent, mathematically gifted developers working on this daily and there isn't a MMO out there that has got it right yet, most break after 100 players.

--

Have a look for Wowemu (there's no official site and I don't want to link to a dodgy site). This is based on ApireCore which is an MMO simulator, or basically a reverse engineer of the WoW protocol. This is what the private WoW servers run off. From what I recall Wowemu is

  • mySQL
  • Python

However ApireCore is C++.

The backend for Wowemu is amazingly simple (I tried it in 2005 however) and probably a complete over simplification of the database schema. It does gives you a good idea of what's involved.

Chris S