Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm making a game which have strong basic design based on multiplayer but also should provide a really interesting and self-sufficient solo game. A bit like a real-time strategy game. The events and actions taken shouldn't be as massive and immediate as in a FPS, so you can also think the networking like for an RTS. It's a PC game, targetting Windows, MacOSX and Linux (Ubuntu & Fedora). It's programmed in C++, using a variety of open source libraries, so I have great (potential) control over the performances.

So far I always considered that just making the game work with two applications, client & server, even in solo mode was ok.

However, as I'm in the process of starting the network code I'm having doubts about if it's a good idea. I'm not a specialist so I might be missing something in my analysis.

I see these pros and cons:

Pros:

  • The game works only one way so if I fix a bug it should apply on all game modes, whatever the distance with the server is;
  • Basic networking issues would be detected early, including behaviour with the protection softwares (firewall) installed (i am not specialist so this might be wrong);

Cons:

  • I suppose that even if it should be really fast enough, networking client and server on the same computer would still be slower than no networking and message passing in (one) process memory.
  • Maybe debugging would be more difficult? I don't have experience in this case but so far I assume that debugging with Visual Studio allows me to debug multiple process so it shouldn't be really different. Also, remote debugging.

My question is: is there a big disadvantage that I missed? Or maybe there are advantages that I missed and that should encourage me to just continue with only client-server game sessions?

share|improve this question
add comment

1 Answer 1

There are two ways to look at this:

  1. If you are decided as to the fact that you're going to be devoting a lot of time to this project, it would seem a good idea to build it multiplayer, client-server from the start. Changing a game design much later on to be multiplayer is a really bad idea, because it affects the entire dynamic, from the little things like latency right up to the high level design choices. The differences will lead to a completely different game, no doubt about that.

  2. If you're not yet 100% sure that this is something you want to turn into the full-blown game that you envision, then be careful going down this route that (as it is not your specialty) is probably going to take up a whole lot of time that might be better spent hashing out the basic game dynamic to see if it's a viable project -- and then adding multiplayer. Also note that although you have the joys of BSD sockets under all your supported platforms (if you are using those directly), while that's meant to be largely identical from platform to platform, I would think that porting and bugfixing that code across all of those will probably be quite "fun".

Having said the above about porting, I sincerely hope you intend to write for one platform first, unless you write very portable code indeed. Getting a running game on one platform should be your first goal.

Re message passing: A socket is a socket. I've played a number of games in the last 15 years that ran TCP client and server processes on the same machine. Performance was, if anything, better because latency was reduced.

Re debugging: distributed debugging is ALWAYS harder -- no doubt about it. The best you can do in that regard is to inform yourself as to the best network debugging tools available that are within your price range. Also, I think you have already answered your own question about VS and process-specific debugging on your dev machine.

The main advantage in going client-server now is that you will be able to effectively account for latency as part of your game dynamic -- nothing to sniff at. Another is that you will be able to get feedback from others, affording a more objective view of the game as it develops.

share|improve this answer
    
I'm not sure how this adress my question. As I said, it's clearly designed to be multiplayer, it's just that the solo would be with a bit more scenarized "maps" and some bots to help or fight. following what you're saying, I'm in the 1. case. But my question isn't about the design of the game or the potential difficulties implied by it on game balancing for example; but about the technological challenges that might occur if even in solo I have this client/server architecture, message passing through network on the same computer. The question isn't about my goals (cross-p isn't my problem). –  Klaim Sep 29 '12 at 21:34
    
If you are not strapped for time, and typically have good motivation, I would encourage 1. But just bear in mind that even the most glowing game mechanic can fall over. If your mechanic is tried and true (e.g. if it's a typical RTS), then I guess that's not too much of a problem. –  Nick Wiggill Sep 29 '12 at 21:35
    
I fully understand that, it's far from being my first game, but my question isn't about this... –  Klaim Sep 29 '12 at 21:37
1  
OK, I've adapted for your central, technical question. –  Nick Wiggill Sep 29 '12 at 21:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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