Thread: MMO Theory, How to make Gameloop & Sockets both work?

  1. #1
    #junkie
    Join Date
    Oct 2004
    Posts
    240

    MMO Theory, How to make Gameloop & Sockets both work?

    Using,
    .NET 1.1,
    Managed DirectX,
    C#. (This info is not really needed though)



    Ok, i have a MMO in the first stage. I simply setup my program, learned some sockets (newb) to make the programs talk to eachother. I called it a night, but by tomorrow morning (7-30), i'll have a working glorified Chat Program.

    Next step? Graphics! Wee.

    I am going to be using DirectX & DirectDraw (2d Zelda Style) for my graphics, which is not in question.

    What is in question is the fact under how i learned game programming in general, we have a Game Loop correct? This totally conflicts with how my Sockets are running...


    So my question is, what is the general Theory (idea) behind Online Graphics Programming? The only thing i can think of is create two Threads (which i dont know how to yet, keyword, yet), then simply run each on apposing threads. Each communicating back to the actual program when needed.. i think.


    I dunno, but i would much appreciate a very general description of how you would go about online game programming... Again, this is theory, so any info is good info, Thanks!
    01110111011000010110110001100100011011110010000001 11000101110101011010010111010000100000011011000110 10010110011001100101001000000111100101101111011101 0100100000011011100111010101100010

  2. #2
    vae victus! skorman00's Avatar
    Join Date
    Nov 2003
    Posts
    594
    You mean run your graphics on a different thread? There is no reason to do that, and your program may infact run slower if you do. MMO's do not send render data through the pipes. They only send movement data, action requests, yadda yadda yadda.

    One networked games I have worked on were built using a messaging architecture (request-accept-query). This was a turn based games however. Real time games can be done using the same techniques, however you'll have to make some predictions to make up for lag time.

    Oh...and your next step should not be graphics. Even after having a glorified chat program, you have a great deal of networking work to do.

  3. #3
    Game Developer
    Join Date
    Jul 2005
    Posts
    2
    Whew. If I had a dollar for every person I knew who said, "I'm going to make an MMO!" I bet I'd have my student loans paid off by now.

    Congrats on taking your first steps to learning networking. You still have quite a ways to go, but it's a fun skill that I personally enjoy.

    Now...back to this MMO business. You are going from the shallow end of the pool of programming straight into the Marianas trench of programming. I've personally created a couple networking games and it's already incredibly difficult just to get 16 or so people connected to a server and have everyone still have an adequate gaming experience(no slowdown, lag, etc.).

    Here is what you have to remember about networking. Anytime you have a client join, the server's workload increases exponentially. Remember that every client that joins you have to now deal with that players movement, that players collision, that players chat, that players inventory commands or battle commands, and anything else that player make have the ability to do.

    MMOs are run by massive, MASSIVE amounts of hardware and use powerful database servers to store data. They are incredibly difficult for any group of programmers and shouldn't be used if you are trying to learn.

    If you really want to do something online then I would just try to create a dungeon, let 1 player connect to it, and then toss a few monsters in there. If you can get that running smoothly then maybe you can make a bigger dungeon and allow for maybe 4 players total. You'll see the difference that just adding a handful of players will make to your code.

    BTW. I would suggest a UDP socket and a TCP/IP socket for each player. Send stuff like movement and chat along the UDP socket, and anything super important along the TCP/IP socket.

    Good luck.

  4. #4
    #junkie
    Join Date
    Oct 2004
    Posts
    240
    well overall i wasent looking for anything giant, i may have misused the word MMO, in the sense of what i am aiming for.

    Basically like i said i am learning, i'll do what i can when i can, so if immedietly two clients is a slow progress then it will be Turn Based. After all, this will most likely be something that spawned off of my old MMO, which, was a IRC MMO.

    So if its really that hard, i'll modify my goals and go for a smaller step program. IRC will integrated.. because i like it.. lol , and it will be turn based or something .


    Thanks for all the replies, and i am aware how difficult this will be, but like i said, it is a learning project and the means of 100% MMO Completetion is not needed. I take when i can from what i do, thats all i can ask hehe


    Thanks for the replies again, and the constructive comments



    FYI, More replies are always welcome. However, currently my home ( my computer via my dad's computer (long story) ), is currently computer-less. A Recovery attempt at one through the other basically shot them both. So until i am able to fix the System issues, i'll be down for a few days atleast. So there wont be a quick response, but thanks to email replies, there will be a response in due time.

    Thanks Again!
    01110111011000010110110001100100011011110010000001 11000101110101011010010111010000100000011011000110 10010110011001100101001000000111100101101111011101 0100100000011011100111010101100010

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. fopen();
    By GanglyLamb in forum C Programming
    Replies: 8
    Last Post: 11-03-2002, 12:39 PM
  2. cant make it work
    By papous27 in forum Linux Programming
    Replies: 0
    Last Post: 03-05-2002, 09:49 PM
  3. Make quicksort work the other way?
    By Nutshell in forum C Programming
    Replies: 4
    Last Post: 01-24-2002, 12:16 PM
  4. DPMI and how to make it work
    By Sunny in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 12-10-2001, 05:16 PM
  5. how do you make the X Y thing work?
    By bluehead in forum C++ Programming
    Replies: 2
    Last Post: 11-05-2001, 04:19 PM