Jump to content
  • Advertisement
Sign in to follow this  
Asheh

Client/Server design

This topic is 4724 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

Im currently working on a mini mmo framework, nothing special, My aims are just to have clients connect and walk around, I want to see how it all works. Ive been progrmaming the server, now when I think about it, I cant test the server without clients, and I cant test clients without the server. So how do I go about this? Do I program somthing in the server, then in the client, then test it. Then move onto the next stage? Or program it all for the server, all for the client, then test it all later? Any advice appreceiated.

Share this post


Link to post
Share on other sites
Advertisement
"Test as you go" is always better than "test at the end".

Your test clients/servers don't need to be full-fledged things, especially in the beginning. e.g. a simple console app works just fine as a client to test your login code. You don't really even need networking fully hooked up - you can just simulate the data the would have been received from the net and inject it directly into your app.

Share this post


Link to post
Share on other sites
Of course you can't test either without the other. They have to be developed in parallel.

Plus there are likely to be bits of code common to your client and server (for example, message packing and unpacking - both will need to do this).

So yes - you have to develop them at the same time.

Initially you can make your server just send simple messages, and test it using "telnet" - then you'll want to be able to send/receive binary messages (probably) so you'll need to work on the client.

You can of course have a dummy client program which just sends specific messages to check the server is working - that's fine.

Mark

Share this post


Link to post
Share on other sites
Google for "test driven development" or "test scaffolding" to get some ideas about how to get from here to there in style.

Share this post


Link to post
Share on other sites
I'd develop the server and then create a very basic and simple client to test the server.

I'd then addon to the client and the server, as certain areas were completed.

Share this post


Link to post
Share on other sites
TDD is definately the way to go when building client/server applications.. and in my opinion the only way.

Share this post


Link to post
Share on other sites
As I develop my client/server app, I have always been attracted to agile development. Reading this thread makes me realize that (in complete agreement with Saruman) TDD IS the only way to do it.

I can't design the client and server independent of each other nor can I test them independently...thus it seems logical that I can't code them independently either.

I read an post mortem in a book or mag that related building a game to building a human and I really liked the analogy...don't remember that it was about c/s apps, but it fits...think of the head as the server and the body as the client (rather metaphysical, don't you think? :) ) :

first you start with the skeleton; this represents the basic foundation your game is built on and upon which everything else attaches itself, such as the network protocal and the connection procedure. Once the head is securely connected to the body, we move on.

Next is your circulatory system. This represents the basic flow that your system needs to stay alive across a network, such as "i'm alive" pings or time synch packets and basic information about server and clients. Once you have a nice steady flow going, we move on.

Next you put in the musscles. This is what will allow your foundation to be mobile and not static; this represents the ability of the client to disconnect and connect at will, the servers ability to kick clients and manage itself, the clients ability to switch servers, the servers ability to shut down and start up at will. Once our system can connect and disconnect at will, we move on.

Next comes the nervous system. This represents the main network traffic. This flows form the server to the client (head to body) and occasionally, in response to external stimuli (ie the player) from client to server (body to head). While related to circulatory system, the nervous system is proactive and responds to change while the circulatory system represents the more autonomous functions of your system. Now our c/s app is starting to take shape. Once you have defined and implemented the basic communication structure you will use, such as packet size and GUI options, we move on.

Finally, we put in the organs. Conviniently, the skin is the bodies largest organ and in a game, the graphics are also the largest part. The other organs represent the various componenets of your game, such as combat, inventory, etc. Notice that by this stage, you have four complete other stages behind you. This is important because you should have reached this stage ONLY if the previous stages were successful. This is nice, for that way you don't build, for example, a great GUI interface that your system can't techinically handle


This is a VERY rough analogy, but I hope it serves to illustrate how you might approach your development. Note that each step (skeletal, circulatory, muscular, nervous, organs) involves both head and body, server and client and that each step is self contained and complete only when the sub-system is working....the skeletal system has to be independetly up and running before you can put the circulatory system...it in turn has to be up and running in order for muscles to be put in, etc.


Hope this didn't confuse you too much... :)

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!