August 3, 2011

Procedurally-Generated Content and You

Procedurally generated content is an old trick for video game developers. Using some algorithms, parts of games can be randomized to make things more realistic. Some examples would be a troop of soldiers with randomized faces, or a jungle with randomly placed trees. But remember, it's not really random - it's done through math, to give the appearance of random. Read on for more on this technique.






For the most part, procedural generation has been used sparingly. Most of it was used in fractals, used for meshes and texture work. Its biggest claim to fame was games like Diablo 2, which had randomly generated dungeons each time a player started a new game. Diablo 2 was a huge success with this feature, and players are still crawling its dungeons ten years later.

Procedurally created content is wonderful, but it does have limitations. Check out this article by Mike Rozak on Oblivion and it's computer generated stuff. In the article, he illustrates what parts were done by hand and which were not, then explains how that sort of technique can best be used in conjunction with human-made work.

Still, in my opinion, PGC is best used in level design. Imagine this scenario: a multiplayer first person shooter where the levels are computer generated, different every time the player starts a new match. Now, this could be disastrous, as someone who's not very good at shooters would be hopelessly lost every game. But it could also go a long way to keeping a game fresh and interesting. If a player particularly enjoys one of these incarnations, a developer could give them the ability to save the layout so they could come back to it later. The Worms series of games has always had this with their computer-made levels.

Now that I think about it, random levels like that would work well for a Metal Gear-esque game. Hmm...

The best example of PGC now, though, is Will Wright's Spore. In this game, you build creatures however you want, attaching feet, claws, and other body parts where ever you want, and how many times you want. You could make a four-assed monkey, or a creature that was little more than a body and feet, with no head or orifices. You then take these creatures through the evolutionary stages - from amoeba to galaxy-crossing superspecies. You can visit the worlds of other users, see the monsters they made, and even interact with them. You could conquer the universe with your species if you wanted to.

The best part about this, is it's all done through code! Even the way the creatures move is done by algorithms. The computer sees how the limbs are attached, and makes an educated guess as to how they move and interact. For the most part it works extremely well. I made a horse, designed the legs how they would be in real life, and the game animated them correctly. My friend did the same for a raptor, and it moved realistically. PGC is very powerful stuff when used right.

For another example of fractal geometry, you could look to Introversion's Darwinia, a smart and sophisticated strategy game that won all sorts of indie awards and was unfortunately ignored by most of the gamer population. (It's $10 on Steam, go buy it!) The levels in that game were created using fractals, which worked well for the overall design, as the game takes place inside of a virtual reality environment, so all of those lines over everything fit the look. But now Introversion's got something even better in the works.

They're working on a game called Subversion, and will be about corporate espionage. But how they're making the game is what's most interesting to me. They're using PGC to create entire cities, starting with the landscape, working down to interstates, and then all the way down to back alleys. Then even further to the interiors of buildings! All of it is done through code.

Here's a list of links to the articles they have on the game. It's fascinating stuff. If you'd like, just watch the videos they have so you can get as excited as me:

Part 01

Part 02

Part 03 - Video!

Part 04 - Video!

Part 05

Part 06 - Video! See an entire city generated!

Part 07

Part 08

Part 09

Part 10

Part 11

That's what I found when I first started digging around. Jump way ahead, and they're just about done with their vertical slice (a fully playable level with all required content in place). Check it out:

Part 19

Subversion will be an extremely interesting game, and I'm looking forward to its release. For a similar, yet awesome game in its own right, check out Frozen Synapse, which is more of a tactical third-person shooter.

No comments:

Post a Comment