views:

3921

answers:

4

I am trying to gain a better understanding of tcp/ip sockets in c#, as i want to challenge myself to see if i can create a working MMO infrastructure (game world, map, players, etc) purely for educational purposes as i have no intention of being another one of those "OMGZ iz gonna make my r0x0r MMORPG that will be better than WoW!!!", you know what im talking about.

Anyway, i was wondering if anyone can shed some light as to how one might approach designing this kind of system and what kinds of things are required, and what i should watch out for?

My initial idea was to break up the system into seperate client/server connections with each connection (on its own port) performing a specific task, such as updating player/monster positions, sending and receiving chat messages, etc. which to me would make processing the data easier because you wouldn't always need to put a header on the data to know what information the packet contains.

Does that make sense and is useful or am i just way over complicating things?

your responses are very much appreciated.

+1  A: 

I would advise against multiple connections for the different information. I would design some protocol that contains a header with information to be processed. Use as little resources as possible. Also, you may not want to send updates for various positions and stats from the client to the server. Otherwise you may end up in a situation where a user can modify their data being sent back to the server.

Say a user falsifies a monster's location to get past something. I would only update the user's position vector, and actions. Let the rest of the information be processed and validated by the server.

Nicholas Mancuso
A: 

Yeah i think you're right about the single connection, and of course the client wouldnt be sending any actual data to the server, more like just simple commands like 'move forward', 'turn left', etc. and the server would move the character on the map and send the new co-ordinates back to the client.

Jason Miesionczek
+2  A: 

I think you need to crawl before you walk and before you run. First get the design of the framework and connections right, then worry about scalability. If your goal is to learn C# and tcp/ip programming, then don't make this harder on yourself.

Go ahead with your initial thoughts and keep the data streams separate.

have fun and good luck

Tim
+17  A: 
grieve
can you name any of these network frameworks?
knoopx