So over the past few days I have been hacking away at Dungeon generation. It is something I have always had a small urge to code up but never seemed to quite find the time. As I was messing with Dart an looking for a medium complex project to try it out with I decided this would be a fun little project.
There is quite a bit written about dungeon generation on the web and I decided to read none of it. This was/is a conversation between me and my programming language. I did use Wikipedia to look up some basic maze generation algorithms but after that I was off.
Once I had a basic maze I started to play with some some erosion algorithms to remove some of the walls to give the maze the appearance of caverns rather then tunnels. That is turn the output into a dungeon rather than a maze.
Doors where then needs. No problem I used an almost random algorithm to add doors, almost as I did not want duplicate doors on the same wall section.
Once I had doors in place I was able to work out where the rooms were and do some erosion on just the internals of each room. After this was done it all started to look like a dungeon for an adventure to try to travel through.
I am pondering squaring off some of the rooms to make them feel a little bit more like rooms rather than random shapes.
Well that is what I have been up to. I will attempt to get some images of the screens so it you can see what I am talking about. This post was written in a coffee break meaning and scheduled for later in the evening, I did not have time to upload some images.
No comments:
Post a Comment