The framework presented here is built on top of Microsoft’s XNA toolset and managed runtime environment. Its key objective is to unite all the necessary components in a single, comprehensive set of interfaces for developing networked games for the Xbox 360.

In principle, a managed runtime environment is the wrong approach for building high-performance applications. At present, however, it is the only way for an indie developer to gain access to the glamorous world of today’s games consoles.

Network Component

It is incredibly difficult to synchronise a real-time system with complex state over a conventional network with limited quality of service. Latency, packet loss and low bandwidth are the main issues to address. Take a global connection such as Zurich to New York: the distance between the two cities as the crow flies is roughly 6000 km. Signals travel through fibre at about 65% of the speed of light, so this connection already has a round-trip time (RTT) of around 60 ms. Intermediate routers make things worse, since each look-up and forwarding step takes additional time. Even so, games should still run well with average latencies of between 25 and 250 ms. We therefore developed a prediction-based algorithm that moves objects smoothly even when information is temporarily missing. We use TCP for critical packets that must be delivered reliably to keep the essential game state synchronised, and UDP for frequent, low-priority packets. In principle, the network topology can be chosen freely; for the two games released so far, however, we used a hybrid topology. Most positioning and voice chat data is distributed peer-to-peer, whereas critical game state and unit selection information is hosted by one machine that acts as the server, with the remaining participants acting as clients. Since Microsoft promises that every Xbox 360 online game can be played smoothly over an ISDN connection or better, the XNA framework limits bandwidth to 8 kB/s. To maximise transmission efficiency, we inserted another network layer on top of UDP/TCP/XNA that disassembles and reassembles value types, saving bandwidth at the cost of a small loss of precision. In our game, we are able to keep up to 8 players synchronised, including team-based voice chat, without exceeding the 8 kB/s limit! The network protocol we designed for this purpose consists of 36 different packet types.

Input Component

The XNA toolset provides some basic functionality for reading whether certain buttons on the gamepad are pressed. We improved on this basic concept with an event-driven component that dynamically invokes delegates on the object that currently holds the user focus. We then extended this component to work across platforms (Windows and Xbox 360) and added a mapping component that assigns keyboard, mouse and gamepad events independently to a common event-based input interface.

Today’s input devices often support tactile feedback technology, which applies forces and/or vibrations to the user’s input device. The framework automatically detects whether such a feedback configuration is available on the currently attached device. A set of functions makes it possible to output signals of different shapes, such as sine and square waves or simple ramp and constant forces. A proximity-dependent variable can be attached to this output signal in order to simulate a 3D feedback environment.

Graphics Component

The XNA toolset provides a low-level programming interface that takes advantage of hardware acceleration to translate and display textures and 3D objects. We extended this basic concept so that textures can also be rotated, scaled and faded smoothly. This was achieved by extending the Direct3D pipeline using HLSL (High Level Shader Language). Rendering large scenes, some of them many times the size of the user’s current view, can waste a considerable number of CPU/GPU cycles. It was therefore essential to build an intermediate graphics layer that decides which objects are actually rendered and which are not. The graphics component also contains a video player and a particle system for visualising smoke and explosions. Moreover, the terrain of the virtual game environment can be linked to metadata describing the properties of the surface (friction, slip, medium). Objects moving across the surface react according to this metadata. In addition, we designed and implemented a pixel shader written in HLSL that renders any 3D scene in anaglyph mode, so that games can be played in real 3D using red/blue glasses.

Audio Component

The audio system manages multiple output lines for mixing customised sound effects and simulates a 3D environment based on the user’s position in the virtual world. All effects can be parameterised (pan, pitch, volume and distance) at runtime. Metadata can be applied to simulate dynamic, location-specific sound effects (e.g. birdsong in forests or the sound of the sea on beaches).