My main resource is here: roguebasin guide
I was interested in hearing how you guys might implement this algorithm in DM and what your thoughts on this kind of generation are.
The Algorithm:
1. Fill the whole map with solid earth
2. Dig out a single room in the centre of the map
3. Pick a wall of any room
4. Decide upon a new feature to build
5. See if there is room to add the new feature through the chosen wall
6. If yes, continue. If no, go back to step 3
7. Add the feature through the chosen wall
8. Go back to step 3, until the dungeon is complete
9. Add the up and down staircases at random points in map
10. Finally, sprinkle some monsters and items liberally over dungeon
What I did tonight was allow the user to create structures on Level 1 of their map which they want to use in dungeon generation. The user specifies what structure they have created by using the lower left corner and upper right corner of the structure.
# define ROOM_LEVEL 1
var/list/rooms = list()
proc
Generate_Rooms()
rooms += new/Room(locate(1,1,ROOM_LEVEL),locate(25,16,ROOM_LEVEL))
Then I've got as far as Room.mesh which is 2D array of the structure with 1 for dense tile & 0 for non-dense. So now I should be able to see if 2 rooms collide because they will share a 1 in the same place.
In theory you should be able to create pretty non-trival structures with irregular shapes. (something more like Diablo 2)
~ Just what I've been up to tonight for fun. (Because friends are too mainstream)
Comparisons otherwise would of course be O(n^2) otherwise which would be awful.
For now, sleep(timeUntilMorning)