Author Topic: Connecting rooms in dungeon generation  (Read 15993 times)

OrangePulp

  • Newcomer
  • Posts: 1
  • Karma: +0/-0
    • View Profile
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.

Etinarg

  • Rogueliker
  • ***
  • Posts: 424
  • Karma: +1/-1
  • Idea archivist and game tinkerer.
    • View Profile
    • Gedankenweber Blog (German)
Re: Connecting rooms in dungeon generation
« Reply #1 on: May 17, 2010, 11:36:40 AM »
In my latest project I connect each room to at one neighboring room which has no connection yet. This way all rooms are connected finally. Then I add some more random connections.

Almost like this:
http://www.funkelwerk.de/library/index.php?n=Library.VeryBasicRoomsAndCorridors
« Last Edit: May 17, 2010, 11:38:42 AM by Hajo »