Procedurally Generated Dungeons

I’ve been playing some roguelikes recently, so I wanted to try writing my own procedural dungeon generator. There are a lot of different ways to approach this problem, but I eventually decided to base mine off of TinyKeep’s algorithm, described here. I extended the algorithm to work in 3D, to create dungeons with multiple floors.

The code for this example available in this Github repo. I’m using Unity3D for this demonstration, but these concepts are, of course, usable in any game engine.

Continue reading “Procedurally Generated Dungeons”

Optimizing a Vulkan Program Part 3: Further Optimizations

This is the third in a series of blog posts about how I wrote and optimized VkColors, a small compute program written using Vulkan.

The previous post added a simple GPU implementation. This post will add several optimizations that improve performance massively.

Continue reading “Optimizing a Vulkan Program Part 3: Further Optimizations”

Optimizing a Vulkan Program Part 2: GPU Implementation

This is the second in a series of blog posts about how I wrote and optimized VkColors, a small compute program written using Vulkan.

This post will examine the GPU implementations of VkColors. The algorithms are written as Vulkan compute shaders.

Continue reading “Optimizing a Vulkan Program Part 2: GPU Implementation”

Optimizing a Vulkan Program Part 1: Introduction

This is the first in a series of blog posts about how I wrote and optimized VkColors, a small compute program written using Vulkan.

During the summer between university semesters, I found a post on the Code Golf Stack Exchange. The challenge was to generate an image with all possible RGB colors, arranged however the contestant felt was best. The winner was Jozsef Fejes.

Jozsef’s program outputs the final image by saving a PNG file to disk. However, he provided a few GIFs that showed the image while the algorithm was running. That inspired me to write VkColors, a program that could generate those images as fast as possible and display them at 60 frames per second. I chose to use Vulkan because this was a good opportunity to use both the graphical and compute capabilities of the API.

Read more