Remixing and recompiling for different hardware



The PS3's Cell CPU has a very different architecture from a 45nm Intel Core 2 Quad CPU (pictured), but getting a game to work on both CPUs is now just a job for a recompiler

You don't need to be a 1970s stand-up comedian to know that there's a large lexicon of monosyllabic, four-letter words for describing something you don't like – but only PC gamers use the word “port” with such a fervent degree of repulsion. Common complaints about console ports include meagre graphics options, dodgy third-person camera angles, poorly thought-out controls and sparsely distributed save points.Making games for multiple platforms can't be easy though. After all, each current gaming platform has radically different processor architecture, as well as completely different controllers and graphics APIs. That's before you've even considered storage, memory and online abilities. Just how do you develop a game for so many different types of hardware, and is it possible to make a great game across three consoles and the PC?Let's start with the different CPU architectures. PCs use CPUs with Intel's x86 instruction set, the Xbox 360 and Wii use CPUs based on IBM's PowerPC architecture, and the PlayStation 3 uses the Cell architecture. You'd think that generating code for each CPU would be a job for master coders, but there's apparently little work involved here.This is because a huge chunk of the code for a game is written using a high-level language, such as C or C++. This is where the core code for the actual game is written, often using a number of industry-standard tools, such as Microsoft's Visual Studio, or specifically developed in-house tools. A particularly popular language is Lua, which has a C API and is used by plenty of developers, including Bioware, LucasArts and Telltale.In fact, the developers we spoke to estimated that around 90 per cent of the game code is shared between platforms, so what sort of game features are included in this huge block of code? Volition's Dave Baranec, the system architect on the PC version of Red Faction: Guerilla , explains that this includesOnce the basic code is written, it goes through an automated process of recompiling, which is often created in-house by a developer as a part of its tools pipeline, in order to make it run on other processor architectures. In this case, compiling refers to the process of transforming high-level source code into low-level code that can be understood by the processor. After that, there's usually a bit of tweaking in machine code (the native language of the processor architecture) or assembly code (a low-level, symbolic representation of numeric machine code), but this apparently occurs less frequently now.explains Visceral's Colin 'Bozz' Boswell, technical director on Dead Space , adding thatAs the game is written in C++ for all platforms, Bozz says that. Telltale Games' co-founder Kevin Bruner describes a similar process for porting Telltale's recent episodic adventure gamesandfrom the PC to the Wii and the Xbox 360.says Bruner, but adds,However, the recompiling process is now so efficient that it's not a major issue.That said, even though the bulk of the code is shared, developers often have to hop between different tools for different platforms.says Baranec.