Red Faction: Guerrilla's Big Bang Theory
How Volition took destruction to the next level.
Impressive gaming tech is one thing, but the application of it in providing an innovative gameplay experience is quite another. This generation we've seen quite an extraordinary technological "arms race" take place, particularly in the first person shooter genre, where the boundaries have been pushed in different directions, from the precision 60FPS gameplay of Call of Duty 4: Modern Warfare to the sheer visual allure of Killzone 2. But despite the truly impressive technical leap witnessed in both games, in gameplay terms they are still clearly cut from the same cloth in terms of what we – as players – have come to expect from the genre.
The release of Volition's Red Faction: Guerrilla is perhaps an exception to the rule, and that's the reason why Digital Foundry was determined to get the developers on the record in an in-depth tech interview. The core of what this game achieves is designed to do more than just one-up its competitors in terms of its sheer destructive power – the engine itself opens up a whole new host of gaming opportunities and surprise moments that in many ways revolutionises the genre.
"Honestly my favourite moments are when things go wrong and I die in spectacular ways," senior programmer Eric Arnold says. "The enemy could shoot a carefully laid remote charge setting off my own trap while I'm in it, or I could see a shadow sweep across my screen and turn around just in time to see the nearby smoke stack crush my face. What really makes it special is that we don't script big set pieces that the player watches, we allow the player to create their own wow moments and take ownership of the destruction."
But how does it work? What makes it different? Eric Arnold gave me detailed primer I'll be publishing unabridged on the Digital Foundry blog next week, but the key difference is that the new GeoMod 2.0 engine works on the basis of stress points. It evaluates the structural stability of every object in the scene on a continual basis as they take damage. Every kind of object from a knee-high section of retaining wall to a bridge the size of a football field undergoes the same analysis.
Number crunching then kicks in – objects being supported by the structure under stress are factored in, the stress code scans from top to bottom adding up the force generated by the mass above and compares this to the strength of the material. If that force is too much, the material breaks, which can bring the whole house down if it is the final connection. As the stresses increase and the material weakens, suitably ominous groaning and creaking sound effects kick in.
As Eric sums up: "The end result is a world that physically reacts to the player in the same way that real objects would – snap off two support legs of a tower and it will tip over sideways, if there happens to be building next to it the tower will crush the roof and tear a hole in the wall, if there happens to be enemy troops inside that building they will wake up with a splitting headache if they get up at all. And the best part of it all is that the engine is entirely player driven, they are given a set of tools, a list of goals to accomplish, and the freedom to solve them in any way they see fit."
It's fair to say that gaming's biggest bangs in the PS360 era have mostly been contained to cut-scenes, engine-driven if we're lucky. In fact, it can be argued that we've not seen apocalyptic levels of in-game destruction that aspires to this level since Criterion's Black on previous generation platforms.
"I would bet that many developers have tried, only to shy away in horror," says another of RFG's senior programmers, Dave Baranec. "The problem with a system like this is that it touches absolutely everything else in the game. It makes rendering tremendously more difficult. It makes level design extremely hard. It causes memory usage for what appear to be simple structures to be staggeringly high. So if you want a whole-hog destruction system like we have, you had better be prepared to pay for it with a ton of effort and sacrifice."
"It is freaking hard!" Eric Arnold adds. "Not only do you have to spend a whole lot of time to create the technology... but it also creates problems for every discipline on the game. Rendering guys have to deal with way more stuff to put on the screen and make it look pretty, AI guys and designers have to deal with the level constantly changing, sound people have to create assets for exponentially more interactions, then if you want online play you have to come up with a way to synchronise all of it. That's not to mention the memory and processing time that large scale destruction chews up. It is not a feature that can be dropped in to an existing game, it has to be planned for up front."
And that planning first begun back in 2004, before Xbox 360 devkits were in the hands of the developers and when PlayStation 3 hardware was still in its formative stages. Coupled with this is the fact that Red Faction: Guerrilla's core tech was actually based on foundations provided by the third party Havok physics library – a piece of code that must surely have been tortured to breaking point in its implementation in this new game.
"It really started out as an educated guess," remembers Arnold. "Even after we got the kits we weren't sure that our idea would work (we were told by the guys at Havok early on that it, in fact, would NOT work because it would put too much of a strain on their system). It wasn't until about two years in to development that we were able to prove that we could pull it off and make it look good, up to that point there was a lot of finger crossing that we would pull some magic out of our hats."
However, much of the pre-production work actually seemed to be based on feasibility studies on just how Volition would actually achieve its ambitions for the stunning destruction model.
"We knew that the focus was going to be an entirely new and very challenging engine," adds Baranec. "Before we could figure out the horsepower necessary, we had to develop the techniques for the destruction system in the first place. I'd say we spent the first ten months with just one programmer working at that level, along with one artist and one designer."
And as for Havok, let's just say that the team became very intimately involved with the creators of the physics technology that has become the de facto standard on PC and current generation consoles.
"The best way to think about it is: Havok is to Geo Mod 2.0, as DirectX is to the Unreal Engine or Crysis," explains Baranec. "It provides some core functionality, but the engine itself where all the fun stuff happens."
"We used Havok mainly for rigid body collisions, vehicle simulation, and ray casts," adds Arnold. "The entire destruction engine was custom built to sit on top of Havok, and we did have to customise a good bit of their internals (especially for the PS3 to get it all running fast on the SPUs). The guys at Havok were great to work with and joked that they all groaned when I sent them an email because we were stressing their code in ways no one else was coming close to, so the bugs I uncovered were particularly nasty."