Thread: What in C++ to make MMORPG?

  1. #1
    Registered User
    Join Date
    Feb 2011
    Posts
    7

    What in C++ to make MMORPG?

    I'm aware how unintelligent I'm going to sound when I ask this. I'm completely oblivious in the subject of networking. But I don't need to be told how hard an MMORPG can be, I have done plenty of games. My question is what could I use from the C++ language to do the networking for an MMORPG? I heard ACE wasn't the best. I don't even know if it's a library in C++ I'm looking for, or if I just need to go for another language like Lua, or what. I really just wanted to know where to start so I could start buying books and researching. Also if anyone knows any good books that they could point out, that would be great. Thanks in advance.
    Last edited by Jayb; 06-03-2011 at 09:11 PM.

  2. #2
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    Standard C++ does not support networking so, if you intend to use C++, you will need to find a third party library. Even more so if you intend your game to be played across multiple operating systems - there are both substantial and subtle differences across systems in how they handle networking.

    ACE is actually pretty good. However, it is a pattern-oriented library which means it is quite powerful but also relatively difficult to learn unless you have experience with software architecture - one of the weaknesses of beginners to programming, and even quite a few professionals, is lack of understanding of software architectural concepts, particularly as those are applied to networked or distributed systems.

    Before bothering with choice of language or library, you might want to learn some of the basics of network programming first. There are lots of good tutorials available using google.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

  3. #3
    Registered User
    Join Date
    Feb 2011
    Posts
    7
    Thank you this has helped a lot. So you are saying that I should look up network programming tutorials not in a specific language? Also, what do you think about Lua for my networking?

  4. #4
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    Yes, I'm saying learn the basic concepts of networking. The basic concepts and techniques are independent of programming language (although programming language and APIs change the syntax of how things get done, they don't change the ideas).

    I don't know enough about lua to comment. There are networking libraries available for lua, but that's true of most programming languages. If you are determined to use lua, then that's your decision. Some people will try to talk you into using lua, others will try to talk you out it using it. Both groups of people will have good and bad reasons for doing so.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

  5. #5
    Registered User
    Join Date
    Feb 2011
    Posts
    7
    I bought a TCP/IP book for the basic concepts. But since I currently have the money to get a C++ networking book (and might not later) it would be nice to know what I should be looking into now. By the looks of it, ACE?

  6. #6
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    I've recommended "TCP/IP Sockets in C" for years.

    It is short, but has excellent coverage due to the simplicity of the layout and finely grained source dumps.

    Soma

  7. #7
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    Don't ask about making an MMORPG, no matter how intelligent you are people have a certain prejudice against those kinds of questions. Say you're trying to make a multiplayer game with networking and leave it at that.

    Learning how networking works can take a while. You could start from the basics that everyone should learn at one point, and figure out how BSD sockets work at the low level (google for Beej's guide to network programming). It's a bit tedious but you'll definitely understand how networking works if you get through that. Or you could use a higher-level library. If you're already using the C++ library Boost for example, there's a Boost.Asio library which makes networking fairly straightforward. (Stick with the synchronous networking for now, asynchronous is quite confusing.) There are other libraries too: if you're using the SDL for graphics, there's an SDL_net library which provides networking; essentially it's just a thin layer on top of BSD sockets.

    In any case the concepts are similar: for TCP you need to listen on a port for incoming connections, establish sockets and send packets. Don't try UDP just yet, stick with TCP.

    As for Lua . . . Lua is a scripting language. It's usually used to augment a (for example) C++ game engine, by allowing people to add game content (triggers, etc) without writing any C++ code. I would really suggest not doing all your networking from Lua, that doesn't make much sense. I wouldn't even use Lua to start with because if you don't know how to do networking or what have you in C++, then adding Lua into the mix is only going to be more confusing. A good point to introduce Lua would be when you have a simple game working and you want to get on with extending the game, and you're tired of how much C++ it takes to do that . . . .

    If you're serious about an MMORPG be aware that the networking for that kind of game requires a whole other level of sophistication. For example, a single server might not be able to handle the load of all the players in an MMORPG, so you need to set up several servers, which communicate and share information about the game state. Maybe each server is in charge of a portion of the world, maybe each server is in charge of a percentage of clients connected. You need to deal with disconnected clients in potentially invalid states, design a good protocol that won't overwhelm your bandwidth limits, do extrapolation on the clients because packets will be delayed, be aware of security concerns and handle bad requests and packets without crashing the server. It's extremely complicated, and I recommend not thinking about it for now until you understand networking much better.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  8. #8
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    Quote Originally Posted by Jayb View Post
    I bought a TCP/IP book for the basic concepts. But since I currently have the money to get a C++ networking book (and might not later) it would be nice to know what I should be looking into now. By the looks of it, ACE?
    I didn't actually suggest you start learning networking by learning ACE. All I did was respond to the statement you've been given that "ACE isn't the best".

    If you don't know basics of networking, you will definitely find ACE hard to learn. Even if you know networking, you will still probably find ACE hard to learn because it assumes a significant body of prerequisite knowledge. If you put in the effort to learn that prerequisite knowledge, however, you will find ACE is actually very very good.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. mmorpg
    By GameCreatoor in forum Windows Programming
    Replies: 10
    Last Post: 07-19-2008, 11:00 PM
  2. New MMORPG
    By Tantalar in forum Projects and Job Recruitment
    Replies: 1
    Last Post: 11-25-2007, 12:42 PM
  3. Mmorpg
    By Zakniall in forum Projects and Job Recruitment
    Replies: 17
    Last Post: 11-19-2007, 01:47 AM
  4. I wanna make an MMORPG ;)
    By VirtualAce in forum A Brief History of Cprogramming.com
    Replies: 67
    Last Post: 01-08-2006, 10:27 PM
  5. Designing an MMORPG
    By gamingdl'er in forum Game Programming
    Replies: 63
    Last Post: 12-06-2005, 08:06 PM