What is procedural generation?

As the majority on content on my blog is related to procedural generation, I thought I’d give a short, non-technical, introduction on what procedural generation actually is. Enjoy!

If you’ve been following this blog for a while, you’ve probably noticed that I mention procedural generation a lot. In a nutshell, procedural generation is the act of generating things (3d structures, images, sounds) automatically with the computer. Procedural generation is used in architectural design, to create content for games and films (infinite dungeons, cities, worlds, …), and offers a new way to think about creativity.

The procedure in procedural generation ultimately refers to a computer procedure, however, it can be pretty much anything that a computer (or obedient person!) can understand — it doesn’t necessarily have to be low-level code. A simple example of a procedural system is:

Draw a square
Do this 10 times:
  Split a square into four smaller squares

Given this procedure, the computer might output something like this:

In software, however, it is typically the input to the procedure that a user will supply. For example, I could build the latest awesome iPhone app, Square, that simply asks the user for a number, N. It could then execute the code:

Draw a square
Do this N times:
  Split a square into four smaller squares

Running this program for N=50 and N=100 might output something like:

Given the same N the system wouldn’t necessarily produce the same picture. This is because there is an element of randomness hidden in the ambiguous phrase: “split a square”. Split what square? Any square! Choose one at random, if you like!

When a larger N is given the complexity of the image would increase, making more and more, and smaller and smaller squares. (A little analysis tells us that there will be 1 + 3*N squares.) Of course, this is a ridiculous system, a user would surely be bored after 2 or 3 pictures, the output is not that interesting, and the customer would want their money back.

However, there are many systems which use this basic idea — a user supplies some numbers (parameters) to the system, which the system converts into an object. Speedtree is one such program, used to generate 3d tree models for games and movies. In the screenshot below you can see some of the user specified parameters on the left, and the tree model generated on the right.

An advanced procedural generation system:

The input to a system can range from numbers, to patterns, to modules connected by lines, to a simple click-on-the-one-i-like interface. Procedural generation is a huge topic, and there are many researchers, game developers, visual effects studios, and designers exploring new ways to automatically create … things! Most of my research has been looking at new ways to generate organic structures using procedural methods. You can find the details of some of the systems I built in the papers section of this site. Also, in the game I’m currently working on, Moonman, I intend to use procedural generation to partially generate the world — with mountains, waterfalls, underground rivers, flora and fauna. So yes, I can’t get enough of procedural generation. ;)