Click here to see this project in action!

About

For this project, I had 5 weeks to create something with one topics that were introduced at the start of the semester. One of the topics that interested me were shaders and procedural generated content (PCG). I ended up choosing for PCG and it seems to be a good pick in the end.

This blog post will be focusing on my experience during the project. I have written a blog post on the university site if you are interested on the product itself.

Experience

I have learned a lot during the project I was working on. My initial idea was to create a 2D procedural generated dungeon that generates rooms with different feels/vibe to it. An example of a different feel/vibe would be a room that feels like a cave and then you have a different room with a labyrinth. Since every PCG algorithm creates some kind of different feel, I thought to myself: “Why not combine them to create even more interesting rooms?”.

I started to research what kind of PCG algorithms there were and what kind of output they were giving. Then choose the top 3 algorithms based on the output. The kind algorithms I was looking for needed one of the following kind of output: chaotic, cave and pattern. The algorithm should be flexible as well in case I want to create something else with the same algorithm.

After I have chosen the algorithms I want to implement, I was searching for a good foundation to work with. I did not want to start from scratch because it might take too much time to refactor it all. So I started to search for a tutorial which also focused on refactoring the code. There were a lot of tutorials which only implements a single algorithm but I eventually found one that fits my criteria. Despite the tutorial series being very long, I manage to go through it all and tried to understand the code. From this point it went straight forward; I implemented the algorithms to the framework and connected all the rooms with a walker.

I had a problem where the corridors of the rooms were too long or went through a room. So I tried to fix that by myself by implementing the Delaunay triangulation algorithm and a minimum spanning tree but in the end I didn’t had enough time for it.

The whole experience was quite positive for me. At the start I didn’t really know a lot about PCG, only cellular automata on a high context level. I might even consider to create a game with PCG in it.