I'm starting to make a small multiplayer game, and even though I have experience with games and networking, there's just one thing that keep me from making this.

The question is: When starting a multiplayer game, should one start making the server first, or the client first?

This looks like a dead-lock for me, because while starting on the client, seems to be the a good option (you'll make a game, which you are already very good at doing probably, and you'll have something to look for progress), you will fall on the trap that probably most of the code effort you put into making that game will have to be thrown away and remade on the server side.

And starting on the server-side is just the opposite: You'll have nothing to look upon, so you can't know if you're making progress. And if that wasn't bad enough, you'll also have to throw lots of stuff away, since you have no game to check if that will have to indeed work like that.

Is there a correct answer for this?

  • 2
    \$\begingroup\$ How about developing both at the same time? Iteratively? \$\endgroup\$ – Vaillancourt Jan 24 '17 at 0:48
  • \$\begingroup\$ @AlexandreVaillancourt A possibility! But I found that this slows down a lot the process, since having to switch the codebase often is not very nice. \$\endgroup\$ – Gustavo Maciel Jan 24 '17 at 0:49
  • 2
    \$\begingroup\$ Switch the codebase? No; both projects will be stored in the same solution, and they'll share common code in a 3rd project (a dll of some sort). If you make a client-server game, I guess you'd have to code it client-server :P \$\endgroup\$ – Vaillancourt Jan 24 '17 at 0:52

You develop both at the same time, inside the same executable or a DLL loaded by the game executable.

The game always run on a server, even when running single-player.

When running single player only an internal connection is used and the server is closed to the outside world (not listening to any sockets/ports).

Once you have the game working you can create a stand-alone server executable without the game code using the same code base.

This also lets you add the option for the player to "Open To LAN" his/her 1 player game and/or host without a dedicated server.

  • 1
    \$\begingroup\$ I believe Quake3 was built like this. \$\endgroup\$ – Vaillancourt Jan 24 '17 at 0:55
  • \$\begingroup\$ Great answer! Really, I haven't thought about this. Gonna wait a few moments to check if new answers come. If not, then will accept this one! \$\endgroup\$ – Gustavo Maciel Jan 24 '17 at 0:56

I would build the server first, this is a personal opinion, but I consider the server-side processing the 'heart' of the game.. The client will need the server's feedback to know what to do.


Not the answer you're looking for? Browse other questions tagged or ask your own question.