Skip to main content
gamedev.net
🔒 Locked

server/client engine

Started by CodeBoy504 Dec 19, 2004 at 12:48 AM 3 replies 550+ views
Original Post
CodeBoy504
CodeBoy504
hey, i'm designing my first simple client-server game (pong). I was wondering what the best way to do this is. My client is obviously going to behave a bit different than my server. Should I create two different engines for the client and server? I think this would probably be the best choice if my server and client were a separate program but I am putting them both into one.
Kaze
Kaze
if your pong game has only 2 players a peer to peer system would be just as easy, in fact almost the same
graveyard filla
graveyard filla
in my online Pong, i made the server a different program then the client. the server was just a windows console application, and the client had all the graphics and stuff. you can do it whatever way you want. i prefer to make the server seperate, because i feel putting both the client and server in the same program will kind of be overwealming, e.g., you have to look at code and think "hmm, is this for the server or the client?". to me it just confuses my logic when trying to keep them in the same spot.

also, writing it as a client / server model as opposed to p2p is probably a good idea. it will help you prepare for writing a bigger game which you would most likely want to use client / server for.
FTA, my 2D futuristic action MMORPG
dave
dave
Quote:
Original post by graveyard filla
in my online Pong, i made the server a different program then the client. the server was just a windows console application, and the client had all the graphics and stuff. you can do it whatever way you want. i prefer to make the server seperate, because i feel putting both the client and server in the same program will kind of be overwealming, e.g., you have to look at code and think "hmm, is this for the server or the client?". to me it just confuses my logic when trying to keep them in the same spot.

also, writing it as a client / server model as opposed to p2p is probably a good idea. it will help you prepare for writing a bigger game which you would most likely want to use client / server for.


Although im sure that if you were a competant enough programmer and split the code up extensively into its client and server components it would be easily readable. Take the Quake 2 source it has the cpp files split accordingly.

ace
oliii
oliii
everytime I tried, it's always been a good idea to split the files, entities, systems into two separate client and a server objects. Also, it make it a lot easier if you decide to have your client and server into separate DLLs. keeping everything rolled up into one and separating the paths for both client/server is just adding to the confusion.

Two different engines is a bit far fetch, since there will be a lot of components shared by both clients and server. Just have a good naming convention, then it should be quite easy (Pong_Client_EntityPlayer, Pong_Server_EntityVehicle, Pong_Client_ConnectionState, Pong_Server_GameState...).
Everything is better with Metal.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.