From: Tutorial: Generative & Possibility Space

# Definition

`Generative Space`

: the set of all the things it can generate.

`Possibility Space`

: the set of all possible Minecraft worlds we can imageine, represent or describe.

# 2D Platform Generator

The Levels are 40 tiles wide and 10 tiles high, and each tile can be one of 3 things: empty, ground or powerup block.

## Algorithm 1: Randomness

Every other tile in the map has 33% chance to be empty, a 33% chance to be solid, and a 33% chance to be a powerup block.

The generative space of this generator is the *same* as the possibility space. Any tile in the map can take on any value, and so every possible level we can imagine is in the generative space. Unfortunately, the generative space is so large, that finding a good legvgel like that is very unlikely.

## Algorithm 2: Random Shape Drawing

Starting with an empty level, it picks a random point somewhere, and then draws a line or a square of either powerup or solid blocks. It does this 20 times in total, resulting in a bunch of shapes being drawn randomly across the level.

The 20 Shapes generator has a bigger generative space, in fact it contains the entire generative space of the 10 Shapes generator within it. To show this, imagine any level from the 10 Shape generator. Our 20 Shape generator could produce this by randomly drawing the same ten shapes, and then randomly drawing them a second time on top of each other. However, any level with twenty distinct shapes in could never be drawn by the 10 Shape generator.

## Algorithm 3: Level Chunks

The level generator randomly picks a level chunk designed by a human sand pastes into the level. Then it picks another level chunk at random and pastes it next to it, and so on until the level is complete.

Here's the generator, with the background shaded so you can see the chunkk boundaries easily. The game Spelunky also used this algorithm.

Generators like this are a good tradeoff of surprise or control. When a generator picks from a catalogue of things and puts them together, we call it a *grammar-based generator*. Grammars let us decide what building blocks a procedural generator has to use, but relaxes the rules on how they get put together. This control and safety comes at a price, though.

The simplicity and easy-to-understand nature of a chunk grammar is great for developers, but it can also be a drawback in terms of player enjoyment.

## Algorithm 4: Human Design

This isn't a generator, of course, but in a sense these levels can be thought of generators that produce just one, very high-quality level. The ultimate tradeoff of control versus quality.

We want to think about our generators like normal game content, to imagine a player playing a specific level and enjoying it. But as generative designers we have to think about the whole generative space, not just a single example from it.

# Summing Up

- Generative Space
- The generative space of a procedural content generator (like Minecraft's world generator) is the set of all the things it can generate. If we change the algorithm or tweak a variable, the generative space changes.

- Possibility Space
- The possibility space of a particular type of content (like a Minecraft world) is the set of all examples of that content we can imagine or describe. It's usually, but not always, much bigger than a procedural generator's generative space.

- Bigger Isn't Always Better
- A generator with a big generative space usually has more good content, more surprising content and more varied content in it. But it also usually has more junk content, more boring content, and more unusable content.
- A generator with a smaller generative space is easier to control, easier to test, and easier to understand. But this can make it more predictable and less surprising.
- Finding ways to balance the strengths and weaknesses of these two extremes is the art of generative software design!