Sign in to follow this  
Vantage

How does an MMORPG work ?

Recommended Posts

I DO NOT WANT TO CREATE AN MMORPG What are it's elements. Sure we all play them, but I was wondering from the ground up, what are the individual parts that make it work. From my limited knowlegde there must be a; 3D engine, network engine, sound engine, server database, server code, particle system and a client at least. What are these elements made from (lets say open source or free/gpl), when compared to that of DAOC for example. How do these elements work together. What is the definition of a client and what are it's roles. What does the server do, and how are it's elements broken down (combat rules, player and world interaction, etc.) In DAOC for example, there must be a huge database which stores information on every item, every player's stats, every house, every monster. Then there must be an element which deals with what happens when player A hits player B, or buys from player B, or talks to player B. I am intreagued to find out how all of this works. Basically, what is each element responsible for, what is it usually written in, what do they typically run on etc.. What languages are the big MMORPG developers using , C++, JAVA, etc.. or a combination, by big i mean DAOC, EQ2, WOW. I am confuddled but amazed really. I know there is a lot of open source stuff, but it's like trying to read Mandarin. I saw an MMORPG (how they work) book in Chapters that i wish i'd bought now.

Share this post


Link to post
Share on other sites
Before we being, I'll point out I've never actually PLAYED a MMORPG, nor even looked at the code, but I do know programming.

Firstly, you'd have to be clear-cut on what computer you're talking about. The graphics, sound, etc, would be dealt with and displayed via the programming on a client computer.

Secondly, I'd say that a particle system would be part of a larger Physics system, which would reside on the client computer.

Thirdly, a Client is anything, ANYTHING, that requires data from something else (generaly known as the Server). This doesn't limit it to computers, your game engine can have many client objects in it that require housecleaning routines supplied by a corresponding Server object (think Kernal).

Thirdly, you've pretty much described yourself there, when you say they must have a huge database. Now, as far as I can tell, there'd be in fact two "sets" of databases. One would be all the numeric data stored on the Client computer, which would know the attack rating and defense and etc of every object in the game. That's why these games are big hard-drive eaters. The second database would indeed be a huge collection of every single account's data. So each person with a copy of the game (and an account), will have a character, and clothing and equipment, etc. And all of that will be stored on the server.

The interactions between things will be sent along to your client computer via the server, but all the processing of those actions will be done on the client.


I think that addresses some of your questions. For detailed answers, find detail-filled people.

Share this post


Link to post
Share on other sites
First I will say I have no experience programming an MMORPG but one of my ways to pass time in life is to study games and figure out how I would do such things.

I assume we're talking about graphical MMORPGS (While I still consider MUDs as simplistic MMORPGS and are quite interesting to investigate, I've done enough reading and programming to understand them, and they are quite interesting)

Ok first off, There's a client, The client is a multithreaded client of course, with threads for Graphics, Sounds, and Networking if not other stuff. I'd have to guess that they develop the code in C++ or something similar. Java is too slow for most games (though it is quite useful) Since most MMORPGS have heavy graphics and at least on Windows, it definatly is using something that is propriaty and links with DirectX and OpenGL, so I assume VC++, of course not .net. Each OS it's ported to will need a different API to do graphics, but this produces a better looking game for less overhead.

Server code is more propriaty, It can really be in any language (I'm assuming they use what ever language can do networking, have tight code, and work on a database) Remember here Speed is 100 times more important then readability as we are dealing with thousands of players) We're looking to have the most amount of players. The database likely has a player table, and a map table, and a Mob table (monster) as well as items, effects, merchants (extention of mob), and other stuff as well as combat rules.

As the player moves around a variety of maps And the networking must constantly be updating it's position on the map. There should also be constant checks to a chat part of the server.

Remember that there might not be one server for each "server" you might be talking to different servers depending where you are in the world (I remember EQ actually could shut down a single zone likely due to a computer needing matinence)

The rules depend on where the programmers want to put it, and find it quickest. The server is likely where it will be but it's possible to put it in the database.

Remember the Server and databases are NOT on the same computer, and the database might be on multiple computers. The amount of computers needed for one of these games' servers would shock you because you have so much load.

Finally the client should also have access to an update server (another computer from all those prior) That verify's your version and updates you with patches (not entirely new files necessarily if possible) on a Per bootup basis. The game will also need to have every player reset their client once a patch if possible.

I just want to meantion I never did program one, I just have spent hours considering how I would do such a thing. I'm sure I made a couple mistakes but that's how I'd tackle it.

Share this post


Link to post
Share on other sites
Why VC++ and not VS.Net 2003 for example.. I have a copy of .NET 2003 which I was compiling a copy of Ogre's 3D engine.

What is the difference between C++ and .NET ? and can Visual Studio .NET 2003 do both/either ? I do not understand.

Share this post


Link to post
Share on other sites
I was talking about the project type, not the compiler itself. I believe all VC++ systems can still do a non .net system. The difference is in librarys and overhead. In addition if you want to port something it's impossible to do so with .net functions.

Finally When you program with a .net project you require the users to use .net framework on their system. It's really quite wasteful and stupid to require a user to install any thing more then directX unless essential(every addditional installation on a users computer will annoy them a bit more) in addition .net framework is not available on many versions of windows. Games should be made to allow the most users.

But if you set up your VS .net 2003 project correctly (choose a project that doesn't have (.net) after it) you should be fine.

Share this post


Link to post
Share on other sites
Quote:
In addition if you want to port something it's impossible to do so with .net functions.

Wrong. (Consoles aside... not many MMORPG's on consoles though)
Quote:
It's really quite wasteful and stupid to require a user to install any thing more then directX unless essential

Really? I guess we shouldn't use OGRE, or Newton, or any other extra libraries then.
Quote:
every addditional installation on a users computer will annoy them a bit more

Silent install. They don't even notice.
Quote:
in addition .net framework is not available on many versions of windows.

Wrong. Unless your looking for 3.1 support...

Just my general purpose "dont use .NET" rebuttle... Thanks for listening.

Share this post


Link to post
Share on other sites
Quote:
Original post by kinglink
Ok first off, There's a client, The client is a multithreaded client of course, with threads for Graphics, Sounds, and Networking if not other stuff.


this is incorrect. a MMORPG does not need any more threads then any normal game, except maybe for the networking part.


Quote:

Since most MMORPGS have heavy graphics and at least on Windows, it definatly is using something that is propriaty and links with DirectX and OpenGL, so I assume VC++, of course not .net. Each OS it's ported to will need a different API to do graphics, but this produces a better looking game for less overhead.


why would each OS need its own graphics API? OpenGL works on both Linux, Mac, and Windows. also, VC 6 and VC.net are both compilers, not languages.

Quote:

Remember here Speed is 100 times more important then readability as we are dealing with thousands of players).


this is once again misinformation. speed is NOT 100 times more important then readability. speed is actually not really much more critical on a MMORPG server then it is for any other game. you write them to be as optimized as possible and you make it as scalable as possible. you should NOT sacrafice readability for speed, no matter what.

also, a good MMORPG architecture should be scalable. this means that it should be designed to work on multiple machines if nessasary. for example, a commercial MMORPG could have one machine / server program instance running which operates strictly on a set of maps or a "zone". this PC only has to worry about that zone. if more players start playing the game, then you can simply add more PC's to the "shard" to spread out the zones better. i believe Everquest does this architecture, and its how my game works [grin]. of course there are other architectures then this one that can make things scalable.

Quote:

There should also be constant checks to a chat part of the server.


you really dont need to "check" for chat. a player sends his message, the client sends it to the server, the server bounces it back to the clients who need it.


Quote:

The amount of computers needed for one of these games' servers would shock you because you have so much load.


its really not very many PC's to run a commercial MMORPG, i cant remember numbers off hand, but maybe someone here more knowledgable then me can post them.

@the OP

the question you are asking could fill a book really. if you are really interested in it, check out an open source MMORPG like Eternal Lands. if you have more specific questions then just ask and either i or someone else can try to answer them.

Share this post


Link to post
Share on other sites
It depends what OGRE and Newton is for (haven't seen it yet) but from what i understand, .net is a Microsoft only format. Is it possible to port it to Linux, and MAC OSX (not using a "hacked" format similar to the wine system (which is good but isn't a licensed version of windows), but using 100% legit programs (don't know the word I'm going for here but I'm sure you understand what I'm mean))

To install .net framework it's hardly a silent install,From what I've seen. I'm not sure about the others you meantioned but you have to manually go through licensing agreements for the .net Framework (as far as I understand it, I haven't done too much with the install programs just yet, and not showing that license probably violates Microsofts agreements)

I'm sure we've all installed software (VS 2003.net was the most recent one for me) where you have to install 4-5 different programs just to get the program to work, which I will accept for a heavy duty piece of software, but I would scream out if a game forced me to accept so much. That's what I was basically talking about.

I wasn't saying .net is bad, just not right for portability but maybe I'm still a bit behind in understanding this concept.

Share this post


Link to post
Share on other sites
Something that often gets left out is a strong web site that allows for checking of server status, forums, and of the most important piece getting playes credit card information. Other than that the may trick would seem to making sure your code is scalable.

Don't get hung up in the .NET vs. C++ or OpenGL vs. Direct X, these are all side issues when it comes to creating your MMORPG. Either choice could be made to work.

Share this post


Link to post
Share on other sites
Quote:
Original post by kinglink
It depends what OGRE and Newton is for (haven't seen it yet) but from what i understand, .net is a Microsoft only format. Is it possible to port it to Linux, and MAC OSX (not using a "hacked" format similar to the wine system (which is good but isn't a licensed version of windows), but using 100% legit programs (don't know the word I'm going for here but I'm sure you understand what I'm mean))

To install .net framework it's hardly a silent install,From what I've seen. I'm not sure about the others you meantioned but you have to manually go through licensing agreements for the .net Framework (as far as I understand it, I haven't done too much with the install programs just yet, and not showing that license probably violates Microsofts agreements)

I'm sure we've all installed software (VS 2003.net was the most recent one for me) where you have to install 4-5 different programs just to get the program to work, which I will accept for a heavy duty piece of software, but I would scream out if a game forced me to accept so much. That's what I was basically talking about.

I wasn't saying .net is bad, just not right for portability but maybe I'm still a bit behind in understanding this concept.


i dont think you understand what VC .net is. it is simply a C++ compiler, and nothing more. you do NOT need to have the .net framework to run code that was compiled with this compiler. it is simply an updated (and much better) version of VC 6.

Share this post


Link to post
Share on other sites
Quote:
Original post by graveyard filla

this is once again misinformation. speed is NOT 100 times more important then readability. speed is actually not really much more critical on a MMORPG server then it is for any other game. you write them to be as optimized as possible and you make it as scalable as possible. you should NOT sacrafice readability for speed, no matter what.


Actually that is wrong. on the server in the code, you can move away from common languages such as C++, java and more and go with a very specific language because the system there needs the speed. The faster the code runs the less servers you will have, which translates to savings. Readability is a score that is both for a language and for a snippit of code, As such if a language is harder to use/read it's likely not to be adopted. but in these cases on a server you can use such code as you're server is a smaller model, and you care more about speed. If you really think speed can be sacrificed then try running a unoptimized (no fancy tricks) server code written with Java, and C++ and tell me which one can support more.

Quote:
Original post by graveyard filla

i dont think you understand what VC .net is. it is simply a C++ compiler, and nothing more. you do NOT need to have the .net framework to run code that was compiled with this compiler. it is simply an updated (and much better) version of VC 6.


This is technically true and technically false, I was talking about the project. Vc .net as a PROGRAM is a compiler. But a .net project WILL REQUIRE .net framework. I know this for fact as I did this for my first few DirectX projects. Worked fine on my computer (because I had the framework) but when I showed an amusing little program to 2 seperete friends the code wouldn't run (which was quite vexing til I got infromation on the error messages) I then redid the project as a non .net project (Win32 app I think was the one I used) And it worked perfectly fine on the same two computers that the .net project executables failed, calling for .net framework .dlls.

Having VS .net is not detremental but creating projects as .net always or using stuff only available in .net projects will cause you to force other users to install .net framework. The saddest thing (and the biggest mistake for beginners) is that an "empty" project and about 9 out of 10 potential projects are .net configurations. There's only a couple that are not, it's not that intuitive. however I could be wrong, there might be a magical button that fixed my problems but no one on this site seemed to know a simple fix for it except making a new non-.net project and adding the files to that.

[Edited by - kinglink on February 14, 2005 2:18:05 PM]

Share this post


Link to post
Share on other sites
I'll concur with the two previous posters that caution against listening to kinglink...

Beyond that, MMORPGs can work however you damned well please.

They essentially evolved from chat servers. People scripted things to make certain chat "do" things. /hit joe for example would hit joe. It was just a chat server, so nothing much happened, but it was amusing.

Someone then made a game out of it. Give joe hit points, and suddenly /hit joe takes on a little more meaning. That's pretty much MUDs. Just beefied chat servers. MMORPGs are no different. On the back end, they just get a command /hit joe, interpret it, and spit it back to the client: "you hit joe for 20 points." and the client does what it will with it [render a swinging motion and a splurt of blood].

But note the rendering is completely pointless as far as the actual game is concerned. The client merely acts as a user interface, taking commands and displaying results.

The variety comes on the actual implimentation. How is joe's hitpoints stored? How are the game's rules implimented? What are the rules? Can players go between servers? Does the player know about the servers, or is it transparent?

Most are in C++ to my knowledge. Most MUDs are still plain jane C. Java is not unheard of. Most modern "big name" MMORPGs have databases behind them. Either way, you could make a MMORPG out of anything. Everybody can do if "attack" then attack() sort of things, and when you get right down to it, that's all they are.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this