If you want clues to where Insomniac is taking gaming with the Cell, look at the company’s roots. When the company’s cofounder and chief executive, 38-year-old Ted Price, was a kid, he spent his time coding games in Basic for his Apple II and dreaming of starting his own computer game company. The graphics were impressive at the time, but by today’s standards look like a glorified Lite-Brite toy. ”I would spend all day writing a program that displayed a person who looked like a block,” Price says. But when he attended Princeton University, Price quickly gave up coding for a degree in English literature. ”Programming felt way over my head at the time,” he says.
Nevertheless, Price found himself coding again after college as part of his first job at a medical company, where he programmed marketing research databases. Yet his passion for games and the dream of getting into the industry drove him to found Insomniac Games in late 1993. While attempting to write a design document for the company’s first game and doing the general organization needed to get the company off the ground, he realized that he needed some serious help. Fortunately, in the summer of 1994 he met two star programmers, Alex and Brian Hastings. The brothers joined the fledgling company with the same dream of creating cutting-edge console video games. The trio built a PlayStation shoot-’emâ''up called Disruptor while sharing an apartment in Los Angeles.
The game world is divided into games played on consoles or other dedicated hardware and games for PCs. Though Disruptor sold 200 000 copies after its release in 1996 and won Insomniac several industry awards, it failed to match the splash associated with PC game companies like Id Software, in Mesquite, Texas, maker of the hit shooters Doom and Quake [see ” The Wizardry of Id,” IEEE Spectrum, October 2005]. Id’s powerhouse graphics engines pushed PCs to their limit and single-handedly created a new market for three-dimensional graphics cards from companies such as Markham, Ont., Canada–based ATI Technologies and Santa Clara, Calif.–based Nvidia. Id set the bar for Insomniac. At the time, PC games--particularly first-person shooters like Doom --were getting all the attention for pushing technology to its bleeding edge. ”Our goal was to create a first-person shooter as good as or better than Doom, but on a console,” Price says.
While consoles didn’t get the press for pushing computing technology, they held a special appeal for the Insomniac guys that continues to this day. ”Consoles are easier to develop for because the technology moves in chunks,” says Price.
Unlike PCs, which are constantly and rapidly improving in terms of performance and memory while sticking with the same basic architecture, consoles progress in waves, roughly every three to five years when the new generations of machines are released. Console programmers must periodically acclimate to a new machine, but then they have several years to optimize their programming before the next console arrives.
Insomniac has taken advantage of knowing the ins and outs of PlayStation machines. In less than a decade it has sold more than 20 million copies of titles like Spyro the Dragon , which followed the adventures of a bratty purple dragon, and the fantastical action series Ratchet & Clank . And Insomniac’s success hinges on what’s become its trademark--innovative game play. In Ratchet & Clank , for example, players have a giddy assortment of weapons beyond the usual railgun and rocket launcher. A gun called the Morph-O-Ray turns enemies into cackling chickens. Another weapon, the Inflato-Ratchet, burps out inflatable decoys of the hero in order to dupe would-be attackers.
The company had a few goals with its new PS3 game. While other game companies are porting existing games onto the PS3 or developing new installments of existing titles, Insomniac wanted to break from its Ratchet & Clank franchise and develop an entirely new title. The company also wanted to show its versatility and impress the hard-core gamers who, it believes, put any new system on the map. ”We wanted to make the type of game that would be attractive to them,” says Price. That meant returning to its roots and the industry’s hotbed of technological innovation, the first-person shooter. Powering it all would be the Insomniacs’ greatest weapon yet: the Cell.
But, as they discovered from the start, showing off the Cell would require the company’s 40 programmers to figure out how to take full advantage of the chip’s multiple processor cores. ”It raises issues of complexity management,” Alex Hastings, Insomniac’s chief technology officer, says. ”Wrangling a system as large as a modern game is a huge challenge.” Wrangling a system for an entirely new kind of chip is an even bigger one.
In a PS3 game, the graphics are rendered mainly by a separate graphics processor, while the Cell orchestrates the rest of the in-game action: keeping track of players and monsters, computing the physics of how bodies rag-doll off buildings, and coordinating the collisions of bullets with alien flesh. The Cell conjures its magic by dividing the work among the nine processors.
Having multiple processor cores on the same chip is nothing new; in fact, it has quickly become the norm. The Xbox 360 also has a multicore chip, but the Cell is different in both scale and kind. The Xbox 360 relies on a chip with three virtually identical cores. The Cell, on the other hand, has cores of two different types.
The real brains of the chip reside in the Power Processor Element (PPE), which is similar to the PowerPC processors found in previous generations of Apple computers. Essentially, the PPE organizes, schedules, and doles out tasks to the eight other processors, preferably in the most efficient way.
The eight remaining processors are completely different animals. Known as the Synergistic Processor Elements (SPEs), they are specially designed to do the kind of fast but not necessarily precise calculations needed for multimedia tasks, such as compressing and decompressing sound files and decrypting data.
”[The Cell’s] architecture is very well suited toward running a game and not terribly suited toward running a desktop computer,” says Alex Hastings. ”You have to customize code for the Cell processor. If you want to take advantage of these [SPEs], you have to write code specifically targeted to them.”
That’s not so easy. The SPEs were built around a new but limited list of instructions--the basic set of things a processor can do. These instructions are devoted to data crunching as opposed to controlling things, which is the job of the PPE. In other words, they can blast through a simple process like audio decompression, but they’re incapable of running an operating system.
What’s more, each SPE has access only to its own 256 kilobytes of on-chip memory. The programmer must ensure that the SPE’s memory is filled with the data it needs before it needs it.
Game programs have historically been written as serial sequences of instructions. With the exception of graphics rendering, which has long been off-loaded to specialized chips, the program generally requires that the processor do one thing at a time. But the Cell offers the chance to accelerate gaming by executing some parts of the program in parallel.
Moving to a system where there are potentially nine processors computing at once improves the game play dramatically, but it also vastly increases the complexity of the programming challenge. In game-development lingo, the work of a program is divided into what are called systems. A system can range from a bit of code that draws a puddle to something more broad and complex, like computing the gore-splattering details of the meeting of a bullet and an alien’s leg. Last summer, Insomniac was in the process of moving roughly 12 major systems onto the SPEs at once.
Bringing a game to life on the Cell is a tightly syncopated process. It revolves around queries sent by the PPE to the team of SPEs. The queries request information on real-time events--such as at what point a piece of shrapnel hits an object in the game. By off-loading functions to the eight SPEs, the system has more time to devote to the delectable details: more characters onscreen, more complex artificial intelligence routines, more realistic skeletal structures within the game characters’ bodies, and, overall, an environment that makes you feel like you are inside the game. There is surround sound instead of stereo, with over 100 sounds happening simultaneously versus the 24 possible on the PlayStation 2. In Ratchet & Clank on the PlayStation 2, Insomniac was able to support 10 players competing against each other online; in Resistance: Fall of Man , they set a new record--40. On the PlayStation 2, a character could have only 30 different animated movements in a game; on the PS3, there are over 330. The payoff: the characters won’t resemble awkward manikins anymore--they grimace, scowl, and follow you with their eyes.
So how do programmers decide which tasks the PPE should be doing and which tasks the SPE should tackle? Alex Hastings asks two key questions about each task to make the choice. First, would the task take up a lot of the PPE’s time if it ran there? And second, is it the kind of job that lends itself to what the SPEs do well? ”We looked for the easiest wins first,” he says. Animation and calculating collisions between objects are perfect fits, says Hastings. So those are the primary jobs Resistance doles out to the SPEs.
Even such perfect fits require some compromises. Ideally, software could automatically allocate tasks to whichever of the SPEs has the most time on its hands, but in order to simplify the programming, Insomniac was forced to dedicate two SPEs exclusively to collisions. Two processors are needed in the most demanding situation, one with lots of players, monsters, and bullets all moving around at once. ”In games you’re more concerned about the worst-case scenario rather than the average,” explains Hastings. If you aim for the average, then there will be many times when the processors can’t finish the job in time and the game stalls. But by the same reasoning, most of the time those two processors aren’t being used to the fullest.
Ultimately, in future games, Insomniac will try to get almost all tasks running on the SPEs. ”The holy grail that people writing games on the Cell are ultimately trying to reach is to get…the real highest-level decision making [onto the SPEs],” says Hastings. ”I think that, based on where we are now, that’s still a few years away.”
Comments