Apr 15 2014
Building Social Games in a Disconnected World
Ætheric Worlds is easing into building Social Games. The normal definition of a Social Game is one in which interacting with other players is a significant aspect of the game play, or gives significant benefit… but I'm going to broaden that definition to any game where a noticeable set of features are specifically for social interaction, including things like global high score lists, viewable player achievements, etc. These are features where communicating to the outside world is paramount, and the feature doesn't work if that communication fails.
On the flip side, Ætheric Worlds is also building games for use on multiple platforms, including mobile platforms. With desktop systems, we can generally assume that a network connection will be available (and treat the times when it is not as an unusual aberration), but with mobile systems, the availability of network is a much sketchier proposition. Despite this, we do not want our games to become unplayable just because the network is on the fritz and we cannot communicate with the rest of the world for a few minutes (or hours or days).
It might seem that the desire for communication and the impossibility to guarantee communication would lead to large periods of time when the social features couldn't be used. However, we can support both social interactions and frequent disconnections, if we relax the requirement for up-to-the-minute updates. For something like a global high score list, the important features are that it accurately reflect your own scores and give a flavor of the competition. It really doesn't matter if your copy of the game doesn't show you my latest high score as soon as I make it; instead, your system can keep a local copy of the high score list and synchronize it with the global list whenever convenient. The same is true to varying degrees for all the different social features of a game; timeliness of communication is negotiable, and that opens up all sorts of possibilities for keeping the game playable no matter what the circumstances of the network.
Of course, there's a cost to supporting disconnected operation: a local copy of interesting data must be kept. Sometimes that's fairly easy and contained. As an example, the high score list is easy to identify and can be kept to a reasonable size of a few hundred entries, even if keeping tabs on all your friends as well as the true global high scores. Other times, it's much more open-ended: finding new friends to add to the list of folks you communicate with generally requires the ability to search the global databases. Even there, though, some inroads can be made by making a local copy of all of your friends' friends, and allowing you to browse and add from that subset even when disconnected.
There's another cost to supporting disconnected operation, too: the local and global lists must be resynchronized when possible, without creating duplicates or undoing deliberate deletions, etc. This leads into a whole other area of complication known in the technical field as idempotence, and the details are far to lengthy to even brush on here… but the short version of it is making sure that updates can be applied once and only once, even if the existence of the update is communicated several times.
The most important aspect to all of this, though, is to simply remember that communication cannot be guaranteed, and to design games or game features to continue to work even when disconnected. It is far easier to do that by starting with the assumption that you cannot communicate, see how and what you can do, and then layer communication on top of that. Going the other direction and trying to accommodate disconnected operation as an extension of error handling is far, far harder, and likely to end up with odd cases where the game simply ceases to function for what seem like silly reasons. Ætheric Worlds is trying to take the former approach, because we want you to be able to play our games, no matter where you are.