2005: Web-to-Wireless MMO Technology
In 2004, I designed and created the HTTP-based multiplayer system that enables mobile phone owners to play peer-to-peer games through a central node so that NxN gameplay is possible.
I chose to use only HTTP connections because, at the time, it was the only connection available on ALL phone models.
In 2005, I proposed to the company to push the envelope one step further, and I designed and created a second-generation system that enables both PC players and mobile phone owners to play together in the same MMO; that’s what we now call "web-to-wireless" gaming.
Defining the actual objectives
Market segmentation is probably one of the most challenging issues to address when talking about wireless gaming development.
Though more than 800 million brand-new handsets were sold during 2005 — and probably 1 billion will be in 2006 — the installed base still needs to be addressed in order to maximize
Another issue of importance is certainly the notion of scalability: this is the term used to define the differing nature and performance across many handset models. Some handsets have small screens, others larger ones; some have 3D capabilities, some support TCP connections while others don’t, etc. It is then important to categorize our game features in order to know which features are required by the set of targeted handsets.
Keeping that in mind, I set three goals for the project:
- Cross-visual representation: Enable both 3D and 2D gameplay of the same game. As most mobile handset models only support 2D displays, it was a MUST to support those in addition to 3D-capable models.
- Cross-network, cross-operator: Support 3G networks as well as GPRS. Despite their very different performance characteristics, we needed to cover as many handset models as possible. We also wanted users to play together regardless of their operator.
- Cross-platform: Enable both personal computers (Internet) and mobile phones (radio networks) to play together seamlessly.
Building the 3D world and the PC engine
The game implements capture-the-flag gameplay. As a player, you are provided with a car, appearing somewhere in the world. Your goal is to capture the flag — a cup in the final game — and keep it as long as possible, avoiding any chasing cars trying to steal it.
PC users — taking PC as a general term, as we support any platform running Java™ — benefit from real-time 3D graphics, as do 3D-capable mobiles such as Sony Ericsson JP-6 phones, for instance.
Non-3D-capable phones implement the 2D view of the same game.
3D players benefit from a 3D perspective view of the scene with a third-person camera, while 2D players benefit from an orthogonal, top-down camera.
The world database is designed in such a way that it provides all the necessary information efficiently to all types of clients, whether 2D or 3D for PC or 3D for mobiles.
MMO worlds are very large and cannot be held in memory as a whole: for this reason, the engine supports streaming, meaning required parts are downloaded from servers on demand.
The world is made of a grid of square modules: each module is tile-based in the x, z plane — 64×64 quads — while the altitude y is taken from a heightfield image.
As the world is potentially very large, a tessellation system generates primitives on demand,
The collision data structure is similar to the one for the geometry — with an LOD system — and is sub-sampled on demand, JIT.
Obviously, a caching system assists the tessellation and sub-sampling processes in order to maximize memory cache efficiency and minimize computation.
When possible,
Extreme programming, the best way to organize yourself or a team, by far
As you may already know, I have always used extreme programming to develop my software. Once again, I defined a series of micro-milestones throughout the development stage.
This way, every week I can show off or demo the technology to the numerous visitors I have daily at my desk! In addition, by meeting my own weekly objectives, I can visually demonstrate new features or improvements every week.
I started off with existing assets — my Mario™ database — as placeholders. They are 2D sprites projected onto a transparent cube, as you can see in the first screenshot on the right.
For the background, I first used a zero-height field, which makes the ground look like a flat plane. But of course, it is made of 4,096 quads in order to reflect real speed performance.
Each square is mapped with a tile taken from a relatively “large” tile map, and each quad can undergo any rotation or flipping operation.
Network infrastructure
Designing the network protocol and developing an implementation
Based on my prior experience in MMO design — and mainly on the previous system — I decided to develop a brand-new protocol with the following features:
- High performance: we need to handle hundreds to thousands of simultaneously connected players
- High extensibility
- Built-in diagnostic system: the system must enable any human or software administrator to detect and prevent performance drops — due to overload — as well as future failures such as a hub or bridge shutdown
- Built-in auto-optimization and auto-healing system: the system must self-regulate bandwidth usage and have fallback mechanisms in order to overcome any failure automatically
Additionally, the system must cleanly handle software lifecycles as follows:
- Automatic software updates without requiring service shutdown
- Game data deployment, again without requiring any service interruption
All these requirements have led to the creation of both:
- The SLLTP protocol: a binary data-packet protocol with built-in routing functionality, well suited for wireless networks as well as Internet or LAN connections
- A decentralized system architecture where each server module operates independently, connected by software buses that enable communication paths to be created on demand
Server modules have built-in hot-upgrade functionality: if an upgrade is available, a module can upgrade itself in a snap without requiring the infrastructure to stop. Once up and running again, it reconnects to the bus and resumes.
Infrastructure features
The SLLTP protocol enables administrative communication between modules. A set of control messages can travel through the MMO in order to instruct other modules or a specific target to perform actions.
This forms the basis for diagnostics: administrators can connect from one point to another, including game clients running on a handset. You can, for instance, instruct a module to export its internal terminal to your screen…
This human communication goes through the chat console from a game client or a server module front-end.
A large set of commands is available:
- whosthere, whois, shutdown,
- ping, traceroute, uptime,
- export console, export graphics,
- spawnbot, etc.
Load balancing, by design
When a client or a server module tries to connect to the infrastructure, it is first routed to authentication servers in order to determine rights and access.
Once granted, the system asks the load-balancing server to choose an IP and port on an available machine that can handle the connection: the IP and port are returned to the client or server module along with a temporary session ID.
Upon reception, the module disconnects, reconnects to the given IP and port, and authenticates itself with the session ID before the session expires.
This solves most load-balancing issues.
Hiding latency with the protocol
Solving car-to-car collisions across the network
One of the biggest issues in an MMO is synchronizing events over the network in a way that remains consistent for all clients and server modules.
In my case, I wanted any player to be able to steal the flag held by an opponent.
Unfortunately, instant notification does not exist over a network because the time it takes to transport a piece of information — the latency — is non-zero. As a consequence, a collision detected in one module at time t is unlikely to be detected at the exact same moment in another module handling the same situation.
A consequence of this could be a chaotic ping-pong switching of the flag between the two cars during the brief window in which they collide with each other.
I implemented a message hierarchy that can be sorted deterministically by any module attached to the bus. This resolves most of the difficulties.
Reducing the effect of latency
Latency renders the notion of simultaneous events meaningless.
Though you can achieve different levels of performance depending on the underlying technology, there is no miracle technique to eliminate it…
Wireless networks perform particularly poorly in this area: UMTS gives you around 600 ms of latency, while GPRS gives you 100 to 1,200 ms!
Hiding latency is accomplished through message transactions: a distributed finite-state machine was successfully implemented and cleanly solves almost all issues for this kind of game.
How to handle a very high number of simultaneous connections
Having hundreds of connections at the same time yields thousands of messages flowing across the buses in the infrastructure.
Bandwidth usage becomes very high and network congestion appears. Server modules — especially the hub — become saturated, yielding continuously increasing latency.
This phenomenon leads to overloaded CPUs and message saturation, eventually blocking the whole infrastructure.
In order to limit this disastrous effect, I implemented three main solutions:
- Buses and modules continuously monitor the effective bandwidth available to them. When performance drops, they throttle outgoing message emission.
- The SLLTP protocol has built-in support for “message importance”, which enables the infrastructure to prioritize and reorder message delivery.
- Hubs implement a saturation mechanism: when a hub detects that the bus is about to overload, it discards less important messages in order to relieve connection saturation. The discard rate depends on the real-time congestion level.
The final wireless 2D version uses two sets of graphics that you can choose from the start menu. The 2D graphics were designed from real 3D meshes that we pre-rendered in 3ds Max. The resulting images were cleaned up manually, pixel by pixel.
Regarding the perception of quality the game gave to players, I noticed that lag caused by dramatically varying network conditions was really damaging the perception of fluidity.
For this reason, I created a set of playful icons that I asked my artist to illustrate. Each icon symbolizes the current network condition, a system very similar to weather-forecast iconography.
Should network conditions change at any moment, a sliding icon replaces the previous one to indicate the new state, as shown below where you can see the “sunny face” denoting a “good, no problem” connection.

I also innovated in the area of car controls. Most car games — if not all — use a relative control system where you are placed “in” the car: you must press the left arrow to turn left, regardless of the actual orientation of the car on the screen. Holding the left key down makes the car drive in a circle.
Instead, I programmed an absolute control system where pressing left steers the car toward the left side of the screen. Unlike the relative system, holding the left key down makes you travel in a straight line in fine.
Clearly, this system yields superior playability and is much better suited to casual players because it feels completely natural.

3D Wireless Client
NVIDIA GoForce 3D Chip
For this specific part of the project, I partnered with NVIDIA in order to get early access to their forthcoming GoForce 4500/4800 3D graphics hardware accelerator.
In June 2005, I received a development board featuring a Motorola phone running a Linux kernel, equipped with a GoForce 4500 chip and a QVGA color screen.

The board had to be connected to a PC running Red Hat 7.3 in order to access the network and disk storage.
An ARM C compiler had to be used to produce OpenGL ES 1.0 C code; unfortunately, at that time no Java VM with JSR-184 was available. A few weeks later, NVIDIA sent me a C upgrade implementing OpenGL ES 1.1 and providing access to shaders, which I experimented with as well.
I created a stripped-down port of my J2SE code, and within a couple of days, I had 32 cars driving around the world. I was able to experiment with the hardware and benchmark real-world performance.

JSR-184 J2ME version for Sony Ericsson W800i
By the end of the year, I received a pre-release unit of the W800i equipped with the same GoForce 4500 chip.
Unlike the development board, the handset runs a Java Virtual Machine and implements JSR-184.
After many experiments, I observed that several factors dramatically impacted performance compared to what I achieved on the board in straight C:
- First, Java introduces performance overhead. Ease of use, flexibility, and its “write once, run anywhere” motto come at a price.
- Second, most phones have poor memory-access throughput, and this handset — though comparing favorably against other existing phones — does not escape this penalty. Note that this handset implements JP-6, the Sony Ericsson Java Platform. At the time of writing — June 24th, 2006 — Sony Ericsson has just released the new JP-7 platform, which dramatically improves performance in this area.

3GSM 2006, Barcelona: Putting it all together
In April 2006 in Barcelona, MobileScope/In-Fusio demonstrated Project X at its booth; visitors were invited to play a persistent capture-the-flag game together using either their mobile phones or PCs.
