Procedurally generated dungeons for Dungeon Madness
So I’ve been messing around with procedurally generated dungeons. I was planning to use some existing, implemented java algorithm, but found out there aren’t any suitable for me. So instead, I’ve written my own generator. The idea is pretty simple. In row you create a given number of rooms with <min; max> size and arrange them into 2d field. You put the rooms from the top left corner of the field, so as they are in order, they are also grouped together in order. This means that last room I create is further away from the first room. Then I create corridor between first and second room, second and third etc. I create corridors by picking random point in start room, random point in end room and then do in L shape a corridor. (First I move along X axis, then along Y axis.) Corridors are then inflated by one character, so they will be easier to navigate. Around each floor and corridor I create walls, where they ofc can be placed. After that I look for interfaces between corridor and wall and put doors there.
I’m pretty satisfied with the looks now. I have control over room sizes, count and how far away rooms are from each other. On the image ‘X’ represent doors, and ‘,’ represents corridor. You can see that sometimes corridors merge multiple rooms (room floor is ‘.’). It creates pretty neat results. Here are few small ones for example.
Now I have to start working on populating the dungeon with debris and entities. I’ll see how that goes.