Pip
Posted: Thu Jul 03, 2008 5:10 pm
<p>Well, 1st blog entry. Hopefully there might be some interest in the behind the scenes goings on at the code face as we mine the Slitherine games.</p>
<p>Just back from our latest company meeting. These are always a good way to get everyone synced up with the details of the business, and also drill down into game design issues and features.</p>
<p>But it's back to multiplayer coding for me - jetlag and all. GBotMA uses a slightly different approach which in theory makes multiplayer a little less tricky, but it compensates for this with a more complex lobby (to support our user campaigns, which hopefully people will enjoy creating!) and slightly more tricky logic when players go to enter their orders.</p>
<p>We are using UDP for all our networking, as this is both faster (as it avoids the overhead of TCP stacks and the like, especially as we mix guaranteed and non-guaranteed messages) and also is more easily ported to other systems. We do have our own guaranteed system, but this is much more under our control than a TCP connection would be.</p>
<p>The biggest issue with multiplayer is making sure that you can allow both machines to run smoothly, but without running past the point where an order or system event should have been executed - the big problem here being that you need to make sure they <em>know</em> that they might have missed an order message if it failed to get through! Basically we handle this by including in every tick message the last order message that should have been recieved. If an order message has been missed, then you have no option but to ignore incoming tick messages until you get the order (ignoring incoming ticks will stall you - which in turn will stall the other player as they aren't seeing your tick count increasing. Thus you will both stall until the guaranteed messaging system manages to get the message through and everything can then start up again).</p>
<p>Feel free to comment on the kind of stuff you would like to see in my blog - it will tend to be programming based, but there are always general rants available on request!</p>
<p>Just back from our latest company meeting. These are always a good way to get everyone synced up with the details of the business, and also drill down into game design issues and features.</p>
<p>But it's back to multiplayer coding for me - jetlag and all. GBotMA uses a slightly different approach which in theory makes multiplayer a little less tricky, but it compensates for this with a more complex lobby (to support our user campaigns, which hopefully people will enjoy creating!) and slightly more tricky logic when players go to enter their orders.</p>
<p>We are using UDP for all our networking, as this is both faster (as it avoids the overhead of TCP stacks and the like, especially as we mix guaranteed and non-guaranteed messages) and also is more easily ported to other systems. We do have our own guaranteed system, but this is much more under our control than a TCP connection would be.</p>
<p>The biggest issue with multiplayer is making sure that you can allow both machines to run smoothly, but without running past the point where an order or system event should have been executed - the big problem here being that you need to make sure they <em>know</em> that they might have missed an order message if it failed to get through! Basically we handle this by including in every tick message the last order message that should have been recieved. If an order message has been missed, then you have no option but to ignore incoming tick messages until you get the order (ignoring incoming ticks will stall you - which in turn will stall the other player as they aren't seeing your tick count increasing. Thus you will both stall until the guaranteed messaging system manages to get the message through and everything can then start up again).</p>
<p>Feel free to comment on the kind of stuff you would like to see in my blog - it will tend to be programming based, but there are always general rants available on request!</p>