Master Thesis

Download Proposal: Download
Download Thesis: Download

Project Repository on Bitbucket Git
Code Playable Prototype on Bitbucket Git Repository

Related seminar paper Serious Games from a Ubicomp perspective Download


The goal of the thesis was to explore common techniques for procedural content generation and build a library to be used in future student projects.

As platform, the Unity3d Engine was chosen. Even though Version 5 was released shortly before finishing the thesis, the code is written for Version 4. The library is written in C# to ensure compatibility with the free version of Unity.

A small demo project was developed to showcase the techniques. It consists of three environments: landscape, cave and dungeon.

Playable Prototype

Download Playable Prototype

Video demonstrating the playable prototype and all three environments

Generator Algorithms

All algorithms generate a 2.5d heightmap. From the heightmap, a polygon mesh is generated and used as geometry in Unity. To ensure important parts are accessible, a technique called Terrain Sketching is used.

Generation of Landscape

The Landscape acts as an overworld, connecting the two other environments. It uses Perlin Noise and Terrain Sketching to ensure that the entries to the cave and dungeon are acessible.

  1. Generate a 2d heightmap using 2d perlin noise
  2. Place nodes and connect them in a graph -> the sketch
  3. Generate a weight map from the sketch
  4. Combine heightmap and weights for final result


Generation of Cave

The Cave is an environment with tasks. Its goal was to generate an environment that looks naturally formed, therefore a noise algorithm was used as a basis.

Heightmap for cave Heightmap for cave after threshold Cave Terrain Sketch Heightmap with Sketch
  1. Generate a 2d heightmap using 2D Perlin Noise
  2. Using a threshold value, move everything above it to maximum height, everything below to minimum height
  3. Place nodes for task completion and connect them with a graph used as terrain sketch
  4. Draw the graph over the heightmap

Cave Example

Generation of a Dungeon

The Dungeon is an environment with tasks. Its goal was to generate an environment that has structure built by humans.
The core idea is to place rooms and connect them in a way humans would.

Dungeon Example

Dungeon Nodes Dungeon Rooms Dungeon Room Edges Dungeon with Corridors
  1. Place rooms randomly on a plane: place center and check width and length to not overlap
  2. Draw rooms
  3. Connect rooms with relative neighbourhood graph algorithm
  4. Draw corridors

There is no additional processing necessary, as the layout already ensures that all tasks can be reached.