• Advertisement
Sign in to follow this  

Network Programming

This topic is 4932 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, Before I get too extensively into developing any sort of game. I will eventually get to using sockets and all that.. but I dont want to end up with a game thats not remotely easy to turn into a server/client. So basically anyone have some recommendations for game network programming, like tips and tricks other than just how to do it.. since well you can know how to do it but many people will end up making things client side that could work better server side and whatnot. For example most games I've played up until recently store the models and all the gigs of data on the clients computer. But recently games like Guild Wars have barely any data on the clients side and more just send data to be displayed on the screen, versus data requests to be displayed via a clients file... I had always heard that would be too slow, or whatever, but I see its being accomplished quite nicely and I want to make sure whatever type of networking or ports I get used it.. its something useful. Also any advice for anti-cheat coding styles, or securing your game tutorials, etc. would be appreciated (ie. server requests movement from client, not client sends movement as it pleases). Basicly ideas to keep in mind when programming for an (M)MORPG Thanks if anyone answers :-]

Share this post


Link to post
Share on other sites
Advertisement
have a read though the multiplayer and game design forums here, There is a large store of information there on what you are looking for.

Share this post


Link to post
Share on other sites
The most important thing to do is to design the game to use a client-server architecture throughout, even for a single-player game. All the Quake engines do this, and I would assume nearly any multiplayer game since then as well. Essentially what you end up with is a clear seperation between cause and effect. IE - The client process should never cause an effect directly; A client requests an effect through the server process, which is responisble for maintaing the gamestate, enemy activities, collision, etc. Now, all this is not to say that your client shouldn't be somewhat inteligent. If your client knows that another step forward will collide with a wall and the server will tell it that anyways, theres no reason to request to move forward. Not only is it a pointless exercise, but it wastes bandwidth as well.

If you've got a single-player (or multi-player single-machine) mode, you'll probably want an abstract communications layer. I suggest something like class BaseComm, from which LocalComm & NetComm are derived. Of course for local communication you *COULD* just do the NetComm and use the network loopback address for local communication, most OSes support it even without a networking device installed.

Good luck

Share this post


Link to post
Share on other sites
Great Ravyne, those are some of the tips I needed for how to think about the coding. I definetly want to program as if it will be multiplayer, even at single player stages.. thats exactly what I wanted to know, because I would rather get the whole server/client concept down now so I know if I should be writing the text, graphic, etc data to files or could I put it right inside the client files - no I couldnt if I were making an online game, especially a modern one with language features and easy server side abilities.

Alright Mykre, I'll see if I can find some thread requesting parts I was looking to get wrapped up here.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement