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
Overview
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
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.
- Generate a 2d heightmap using 2d perlin noise
- Place nodes and connect them in a graph -> the sketch
- Generate a weight map from the sketch
- 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.
- Generate a 2d heightmap using 2D Perlin Noise
- Using a threshold value, move everything above it to maximum height, everything below to minimum height
- Place nodes for task completion and connect them with a graph used as terrain sketch
- Draw the graph over the heightmap
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.
- Place rooms randomly on a plane: place center and check width and length to not overlap
- Draw rooms
- Connect rooms with relative neighbourhood graph algorithm
- Draw corridors
There is no additional processing necessary, as the layout already ensures that all tasks can be reached.