Our Properties: Gamasutra GameCareerGuide IndieGames Indie Royale GDC IGF Game Developer Magazine GAO
My Message close
Contents
Building Games that Run on Poor Mobile Connections
 
 
Printer-Friendly VersionPrinter-Friendly Version
 
Latest News
spacer View All spacer
 
June 2, 2012
 
38 Studios' Downfall: The Gamasutra Report [65]
 
How Space Quest's creative duo buried the hatchet after 20 years apart [2]
 
Gamasutra's on-site E3 2012 coverage starts Monday
spacer
Latest Jobs
spacer View All     Post a Job     RSS spacer
 
June 2, 2012
 
Trion Worlds
Senior Content Designer
 
Trion Worlds
Senior Content Designer
 
Trion Worlds
Lead Systems Designer
 
Trion Worlds
Senior Producer - Live
 
Trion Worlds
Senior Gameplay Engineer
 
Trion Worlds
Senior Gameplay Engineer
spacer
Latest Features
spacer View All spacer
 
June 2, 2012
 
arrow The 20-Year Estrangement of the Two Guys from Andromeda [7]
 
arrow The Anatomy of a Bad Game [16]
 
arrow Old Grumpy Designer Syndrome [22]
 
arrow 10 Tips: The Creation and Integration of Audio [2]
 
arrow Beyond Heavy Rain: David Cage on Interactive Narrative [49]
 
arrow Leading Change - An Excerpt from Beyond Critical [4]
 
arrow Persuasive Games: Process Intensity and Social Experimentation [29]
 
arrow Culture Clash: How Video Games Are Crashing the Museum Party [8]
spacer
Latest Blogs
spacer View All     Post     RSS spacer
 
June 2, 2012
 
A Few Thoughts on Kickstarter [8]
 
Dust in The Wind: An Analysis of A Valley Without Wind [2]
 
The "Gratitude Update": Connectrode 2.0
 
Molleindustria's Unmanned: Excellence Through Boredom [11]
 
Story Design Challenge #4: Design a World [2]
spacer
About
spacer Editor-In-Chief:
Kris Graft
Features Director:
Christian Nutt
News Director:
Frank Cifaldi
Senior Contributing Editor:
Brandon Sheffield
News Editors:
Frank Cifaldi, Tom Curtis, Mike Rose, Eric Caoili, Kris Graft
Editors-At-Large:
Leigh Alexander, Chris Morris
Advertising:
Jennifer Sulik
Recruitment:
Gina Gross
 
Feature Submissions
 
Comment Guidelines
Sponsor
Features
  Building Games that Run on Poor Mobile Connections
by Bernt Habermeier [Programming, Social/Online, Smartphone/Tablet]
2 comments Share on Twitter Share on Facebook RSS
 
 
January 26, 2012 Article Start Page 1 of 4 Next
 

In this article we'll walk you through how you can make your mobile web game resilient to poor network conditions. Many excellent developers are used to developing games for the desktop environment, but often don't think about network reliability when they implement their apps. When you find that your app freezes up over a cellular network you can shrug and blame the carrier, or you can roll up your sleeves and fix the problem. We'll teach you how to fix such problems and discuss the creation of multiplayer games that play great even in areas where the user's cellular coverage is not great. 

It turns out that some of the old methods from way back came in handy when I recently wrote the cellular-network-friendly networking code for Moblyng's Social Poker Live. I have a few years experience working on games over questionable network connections, including 28.8k - 56k modems.


Try It Before You Buy It  

Before we dive into what the issues are and how to solve them, I'd like to quickly review the game so you can see what I'm talking about is a solution we used in a feature rich, live production quality title.

Social Poker Live is a multiplayer poker game that can be played in real-time, over any internet connection on iOS and Android mobile devices (phones and tablets), and it's resilient to spotty network conditions.

For example, you can play the game on Caltrain going from San Francisco to Redwood City, and will recover going through tunnels and the like.

Of course, the game also runs well on a desktop, but in this article we'll focus on the mobile experience. Try out Moblyng's Social Poker Live on your iOS or Android phone at http://poker.moblyng.com.

Here are some screenshots of the typical user experience, starting with the loading screen, all the way to the winning screen. One neat feature is that we'll discover which of your Facebook poker pals are online, and ask you if you'd like to join their table. Here is what that looks like:

I'd like to encourage you to load the game in Chrome, bring up the developer tools, look at the Network tab, and go back to the game to sit at a table. You'll see the data passed back and forth between the client and the server, including packet identifiers and acknowledgements that we'll talk about in the rest of the article.

Problems? What Problems?

The common perception is that it's difficult to implement real-time multiplayer games on mobile devices. It's true that this type of game is more involved than implementing a typical social game where the game doesn't require down to the second data synchronization across a group of players, but it's not terribly difficult either. There tends to be two problems with multiplayer real-time games: scalability and networking over a cellular network. This article talks about the latter -- how to get reasonable networking performance even over spotty 3G cellular networks using HTML and JavaScript.

Gimme Updates!

Traditional web technologies are decent with issuing requests to servers. The client knows when it wants some piece of information and hits the server with an HTTP request, and as a result the server scrambles to offer up the request as quickly as it can.

In multiplayer games the game client knows it wants game updates as quickly as possible, but it doesn't know when to ask for such information. This doesn't fit well with a model where the client has to initiate the request for data. When do you ask for an update?

You could just hit up the server once a second with an active poll request. Your operations manager could also decide to hit you once a second over your noggin because that's not efficient for neither the client or the server. All hitting aside, you won't get sub-second response times -- especially over a cellular network.

 
Article Start Page 1 of 4 Next
 
Comments

Ilya Belyy
profile image
That's interesting, thanks for sharing.



On a high level, it looks very much like an implementation of a reliable game protocol over something like UDP. This part of the task is essentialy the same, you are working on top of unreliable long polls and lost connections, rather than unreliable datagrams and lost packets.



That's annoying how the android browser lags behind chrome far more than ios browser compared to safari.

Anatoly Ropotov
profile image
Did you encounter a lot of unexpected crashes due to memory leaks in handling of socket.io on mobile webkit in iOS 4.x, terrible time restoring the game state after an incoming call or being disrupted by on-screen push message and all other crap like that? I doubt that realtime games as webapps will ever make sense, unless you wrap them with PhoneGap (which has some WebKit prev-generation limitations) and then you are still at disadvantage over native apps.


none
 
Comment:
 




UBM Techweb
Game Network
Game Developers Conference | GDC Europe | GDC Online | GDC China | Gamasutra | Game Developer Magazine | Game Advertising Online
Game Career Guide | Independent Games Festival | Indie Royale | IndieGames

Other UBM TechWeb Networks
Business Technology | Business Technology Events | Telecommunications & Communications Providers

Privacy Policy | Terms of Service | Contact Us | Copyright © UBM TechWeb, All Rights Reserved.