Devlog 1 and 2


Dev Log 1

I finished map generation on this run. You can set the size of the map, the min size of the rooms on that map, and a special variable called percentage of the area. I take a percentage of the area of a room and the random walk algorithm takes that many steps. This plus the min room size allows us to decide how open rooms may be. If you set a smaller min room size and a larger percentage of the area then the room will have less walls and be more open. If you do the opposite then the room will has more walls and perhaps even more corners and turns and hallways.

How it works behind the scenes is i have a 2d array that represents the map. I then create bounds for each room using Binary Space Partitioning and feed that into a random walk algorithm. The random walk algorithm goes around in those bounds creating each room. Then the center points of each room are connected. We can guarantee that the center points are always valid because we start random walk at the center of each room.


The idea for this came from this video series. Even some of the code. I abridged much of the code to make it fit for my use case but this video series was definitely the idea and much of the code to get this to work.

Dev Log 2
I got spawn points working!

So when the dungeon is created I create a 2d array for the dungeon and then feed it into the

InstantiateDungeon(Map[,] cells)

function which actually spawns the cells. While thats running i put those cells in a list. Then I sort those cells by room they are in and select a random room and random cell in that random room to spawn the player character on. You can see the player spawn here!

Heres a GIF of all this working!


Leave a comment

Log in with itch.io to leave a comment.