Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - OrangePulp

Pages: [1]
1
Programming / Connecting rooms in dungeon generation
« on: May 15, 2010, 10:39:39 AM »
I used a BSP approach to generate a dungeon, as detailed here: http://doryen.eptalys.net/articles/bsp-dungeon-generation/

However, rather than actually use a tree, I simply have recursive calls, and when it reaches a certain depth (or a minimum size on width/height) it creates a random sized room in the cell. I plan on creating a Room class to hold all relevant data, and then throwing all created Rooms in an array or list or something, depending on what I need. Which brings me to my actual question: what's the best way to connect the rooms?

One of the reasons I didn't use a tree was because I didn't like the way the rooms connected in that method, and so if I'm going to use another method to create corridors, I didn't really need the tree structure. However, I'm at something of a loss as to an optimum way to make effective connections. There are a few obvious choices (pick a random room, pick the closest room, etc.), but rather than implement all of them and find out what works, I'd rather ask some people who have experience with such things. And if the best way really is to have the tree, and maybe add extra connections between leaves and such, I'm open to that too.

Pages: [1]