2004: HTTP multiplayer technology
Making games on mobile is somewhat diverting: on one hand you have a very limited platform to work on — which is extremely demanding as you lack almost everything: memory space, speed performance — and on the other hand you have to make people play your game despite all these limitations.
You find yourself back in time, programming ‘80s systems: ZX-81, TO7, etc.
But things have changed: playing gorgeous titles on PlayStation and Xbox is common. How could people play ‘80s titles nowadays?
Trying to answer this question leads you to a less common question: what makes a mobile phone a unique gaming platform when compared to others?
Connectivity! In space — you connect to other players — and in time — you “wear” your phone almost 24/7.
Connecting players
Connecting players in 2004 was quite challenging. You want people to play together, regardless of their actual handset technology — Java, BREW, Symbian, etc. — and also regardless of their operator.
Most of the available systems widely support HTTP connections. Sockets were not always available: for example, with Java, only MIDP2 defines TCP support, and unfortunately its implementation was optional.
The system had to use HTTP support then. Unfortunately, the performance of HTTP connections is not really impressive. Though HTTP is an application-layer protocol that lies on top of TCP/IP, it only defines peer-to-peer connections.
HTTP is a peer-to-peer protocol
Peer-to-peer basically means that when connecting from one end to the other, intermediate routers or servers can relay the connection to the next “hop” by choosing whichever type of HTTP connection is best suited for it.
All these “hops” are time-consuming, each peer creating a new socket to the next hop, and potentially checking and rewriting HTTP headers.
As a result, round-trip performance drops dramatically when compared to a direct TCP connection.
Radio-to-Internet connection
Another issue of importance is certainly the radio-to-Internet part of the connection.
On the operator side, you don’t really have access to the infrastructure. The only thing you know is that your connection is routed by a special piece of equipment called an APN. It is the gateway to the Internet; think of it as an HTTP proxy.
Behind it, on the operator side, IPs are local. When on the Internet, you basically have the operator’s public IP.
Some operators block packets sent to “unknown” server IPs, and in that case, you have to deal with the operator in order for it to let you pass through the APN down to your server.
How to authenticate players on your server
When HTTP connections arrive at your front server, IPs are usually not a means to authenticate the player. At most, you can know which operator they come from, if you have recorded all possible APN IPs somewhere in a database.
Some APNs kindly add an HTTP header extension that tells which IMEI number the mobile has; but you shouldn’t count on it, as this is the exception.
You have to rely on a custom mechanism of your own, such as a login/password system or a smarter approach.
What type of game to expect?
An HTTP connection usually gives you an average round-trip time on GPRS networks of about 2,400 ms. Yes, you read that right: 2 and a half seconds to send a small message and get a response from the server.
If you tell me you can’t make any game with such latency, well, my answer is: you’re wrong.
Of course, you cannot design a car racing game where you expect real-time collision detection over the network. A 2,400 ms round-trip is an order of magnitude too slow to make such a game.
But if you design a game that does not have high sensitivity to latency, you really can make fun games.
For example, we designed a multiplayer version of the Microsoft/Rare Mr. Pants license.
Mr. Pants and Battle Bubble Multiplayer
Basically, Mr Pants is an action puzzle game where you have to make rectangular blocks with the pieces you get from the game by rotating them appropriately within a limited time.
Every time you complete a block, the surface it occupies is cleared and you collect bonuses and points.
Adapting the game to the above-mentioned constraints, the team designed a gameplay mechanic that wouldn’t suffer from very high latency.
First, the opponent’s screen is also displayed on the player’s screen in the top-right corner, so you can watch their progress.
Second, when you complete a block, the game sends a penalty (malus) to the opponent, causing their time limit to shrink a little bit, thus increasing the match pressure.
This way, it does not really matter whether the malus arrives “on time” or not. What counts is that it arrives!
As a result, the multiplayer version is really fun, and maintains interest over time.
