The light flows, the smell of electricity; implicit order, outward manifestation ..
=> Boy Maas (2005) <=

Working as a small development studio, often in small teams with limited resources, you start looking at alternative ways to do things. Large development studios can spend millions of dollars on top-notch designers to get state of the art graphics. But as we all know, on a small salary working as a freelance programmer I can't just go the bank and state: I have this brilliant concept, please front me a few million because the graphics have to be brilliant.

Working a day job even time is a limited resource, designing all graphics yourself or even when you find artists willing to put in the time, is almost not feasible. But when you have the stamina and determinism you would probably have to rewrite your code and graphics for the next quantum computer. Since that will be the standard when you finish your product.

There are more roads to Rome

I often find myself conflicted while brainstorming on projects, on the one hand you have the conceptual world in which everything is possible. On the other side you have the real world, and with this real world comes various challenges.

Once you find a way to overcome, or work around the various challenges, you have a shot at realising your concept. One tool to overcome the practical challenges of content is procedural generation.

Let's dive in with .kkrieger

Before studying the process of procedural generation in some more detail let's look at what is done at this moment. A brilliant example of procedural generation arose from the demo-scene. .kkrieger A proof that almost all content is generated is the size of the game. All content is packed in 96Kb! The way the developers achieved this is is by basing all the elements on basic solids, such as boxes and cylinders with a function to deform them. Textures are stored using creation history thus only having to store the pixmap and the functions to manipulate them to get the end result. This way they could pack 300Mb worth of textures and data in a sheer 97,280 bytes of disk space.

Was this done before?

A few of the first games ever developed on BBC Mirco (16Kb ram) where confronted with severe space constraints. This poses some serious real world challenges on what is possible. One has to be very inventive to be able to produce an interesting game. The earliest computers where severely limited by memory constraints. This made it impossible to store everything, level information, artwork, there was only room for a few elements.

Elite, the open ended space trader game

An interesting example of a game I really loved is Elite, the creators designed a formula to store 248 (282 trillion) galaxies with 256 solar systems each. The solar systems had their own political systems, the trading prices, even the names of the planets where generated. They limited the final game to only 8 universes. The are many more examples of "old-school" games which used this technique. Often based upon a seeded Pseudo Random number generator used to feed the generation functions.

Exile, the cavern explorer game

Another Magnum Opus of programming which conquered serious technical challenge is Exile), I found an interesting read giving some interesting quotes from the developers:

Technical issues aside, and against all modern business rules, the Exile game itself was allowed to evolve from little more than having a spaceman exploring a cavern system. We didn't know where it was going in the early stages and really just thought about new experiences for the hero and new technical features (like line of sight vision for inhabitants) as we went. Personally I believe that the best creations occur if allowed to develop at least partly in this evolutionary way rather than completely designed from scratch at the outset. It takes much longer of course to produce something this way and you are in danger of never finishing if you lose sight of the goal, but is worth it in the end.

Notice the evolutionary process. Planning in detail ahead is a killer for any form of creativity.

The amount of innovating techniques and content creation used in programming the gameplay of Exile is stunning. Think only about the map in Exile, another quote from the article:

The huge map of Exile was generated by an algorithm which from an input of the xy map coordinates created tunnels, solid rock, or one of the few special blocks that could have manually defined objects in them, like creatures, doors, guns, etc. It took a long time to fiddle with this algorithm to produce a tunnel system that was all linked up and interesting, but the storage required for it was actually tiny.

To see the world which they generated procedurally: Exile's complete map

The ideal world

Imagine a completely generated game world, where even the creatures you interact with are generated. Their intelligence adapts to the way you play the game. Keeping the difficulty at your level. The AI is finding your weak spots and is trying to exploit them. You have to adapt to a world that is adapting to you and challenging you. All you see is generated on the fly. No element of the game is designed by an artist. Any ideas?

Fork me on GitHub