The multiplayer is a really important part of Payback 2, so we really wanted to make it as robust as possible. We went to great lengths to make the game cope gracefully with high latency and low bandwidth connections such as 3G and sometimes even EDGE.
Coping with poor connections comes down to two key things - minimising latency and bandwidth usage, and hiding network issues as well as possible.
To keep latency as low as possible, we use peer-to-peer connections (to avoid the extra delay of going though a server) and unreliable data packets to allow lost messages (which we probably don't care about any more) to be discarded rather than be retransmitted (which would delay newer packets).
Bandwidth usage is a particular concern in an open world game like Payback 2 as there can be hundreds of objects active at once. To mitigate these issues, we heavily compress the data we send and limit the rate we send it, including sending updates for less important objects less frequently and trying to move nearby objects to local control when possible. We also try to spread the load evenly between devices to minimise the chances of one of them becoming a bottleneck.
As a result of all this, the bandwidth usage is generally under 40kbps even with lots going on, which is low enough to play on even a poor 3G connection or a good EDGE connection. (Although of course Wi-Fi or LTE are still preferred if possible.)
To hide the latency that remains, we blend objects from their old to their new positions, but also run physics on them locally so the player can still interact with them to a degree. Of course, there are always going to be times when devices disagree about an important event, so we made sure that we always picked the least annoying option in those situations. For example, the death of the local player is decided by the local player's device, as it's more annoying (and noticeable) to be killed unfairly than it is to not be able to kill someone unfairly.
|