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

This is a discussion on MMO Theory, How to make Gameloop & Sockets both work? within the Game Programming forums, part of the General Programming Boards category; Using,
.NET 1.1,
Managed DirectX,
C#. (This info is not really needed though)
Ok, i have a MMO in the ...

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

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!

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.

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.

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.