Connecting the rooms
The most popular way I’ve found to link the rooms to each other is using a Delaunay Triangulation.
After reading on what it does I got in a little trouble since maths isn’t an area I’m a lot comfortable with, luckily I found a neat site that doesn’t only explain it simply it has many examples in several languages, including c#.
So I got ready to work on that and after some time I did it!
The red lines represent the connections between the rooms, but as you can see that could be a problem since I didn’t want every room connecting to it’s neighbors, making the dungeon easy and taking away that “dungeony” feeling. The solution? Making a Minimum Spawning Tree! To put it simply, basically it finds the links to connect every room in an optimal way, making a simple path that still can create some interesting dungeons, but to guarantee that it gets a little more complex we add a random part of the remaining links so there isn’t always only the optimal path to get to every room.
I found a site with the code that worked nicely to do what I wanted and implemented it in my game-to-be.
The green lines represent the path that’s going to be placed in the dungeon creating halls from them, and that’s what I was focusing now, making halls that looked nice and were efficient to find their path between rooms.











