http://www.spectrum.ieee.org/dec06/4745
They dedicate two SPE for collisions:
They dedicate two SPE for collisions:
At the third page, they explain a bit how they divide worload between PPE and SPEs.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.