Jump to content
  • Advertisement
Sign in to follow this  
graveyard filla

client / server : make them seperate ?

This topic is 5467 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, im working on networking my 2d pong clone using Enet. i'm not sure, should i make the client / server seperate programs? it seems like its really hard to put the logic for both the client and the server in one program... should i make a console app which just does things like bounce back messages, check for collisions, etc ? also, keep in mind i'm only networking my pong clone for practise, so i can start networking my 2d RPG. NO, not a MMORPG! i just want to be able to connect around 4-8 people to death-match each other, one map, with no NPC's or anything like that. i'd like to try to keep as much of this re-usable as possible. and i don't really mind if the person has to start a server program seperate if they want to play online, if it will make coding at all easier. thanks for any help.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Indeed I would separate them. Its easier to implement. Only problem is that one computer should run this host and the client which might give timing problems but its a small apllication so i dont think you have to worry avbout that

Share this post


Link to post
Share on other sites
thanks guys. i actually didnt think that was the correct answer, i mean, all games i ever played, the client was built into the server. well, maybe not all games, but, something like warcraft 1/2/3 im assuming used a client / server relationship, with the server built into the app. but it 's just so hard to switch your mind-state to write both client AND server logic in the same place... you have to picture either one or the other in your head while your coding, otherwise things start getting screwy =).

anymore opinions are greatly appreciated.

BTW - what would these timing issues be and why would they happen? thanks again.

Share this post


Link to post
Share on other sites
You will definitely want to share code between the client and server. Even if it's only constants.

If you make them the same program, that is an easy way of sharing code.

Just because it resides in a physically identical executable file, does not mean it needs to behave even remotely similarly - just read a command-line parameter to become a server or something.

Mark

Share this post


Link to post
Share on other sites
I think Age of Empires had only clients, which shared the data of the moving units and the changes to the map. Then all clients started with the same random seed so some stuff could be randomized but still happen exacly the same way in all clients (or is it called peers?).

Share this post


Link to post
Share on other sites
If you specifically want a small group of players in your game you might want to consider using the peer-to-peer networking model instead of the server/client model. Server/client is designed for many people, whereas peer-to-peer is more designed for small scale groups.

The upside of peer to peer is that your game doesn't have to crash and burn if the server dies.

Share this post


Link to post
Share on other sites
Quote:
Original post by Braik
The upside of peer to peer is that your game doesn't have to crash and burn if the server dies.


which reminds me: i'm pretty sure that most (if not all) blizzard games use p2p.
when the host left the game, it still went on.
could also be that another client became server instantly.
(no, i'm not talking about blizzard-hosted battle.net games)


but to your question:
i also agree with markr, keep it in one program. (and don't try to write the client and the server code at the same time)

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!