Jump to content

  • Log In with Google      Sign In   
  • Create Account


Dungeon Generation Problems


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Lith   Members   -  Reputation: 372

Like
0Likes
Like

Posted 30 March 2012 - 08:07 AM

Hello.

I am working on a simple method of generating dungeons for my game. So far, I have a system that will generate rooms in random places of random sizes but I need a way to connect them to eachother with corridors.

I read that the way in which I connect the rooms and make corridors will give the feeling of the dungeon, so I don't think that using a pathfinding algorithm that connects the midpoints of all the rooms would be very interesting. There is also the problem of making sure every place is reachable.

Can someone suggest how I could connect the rooms?

Sponsor:

#2 Álvaro   Crossbones+   -  Reputation: 12362

Like
1Likes
Like

Posted 30 March 2012 - 08:27 AM

I remember reading a few ideas about this here. Give it a try.

#3 crancran   Members   -  Reputation: 372

Like
0Likes
Like

Posted 30 March 2012 - 08:28 AM

Your dungeon generator needs to consider a number of factors.

I'd first by saying I'd consider having a tiled type map/grid where I give the generator 1000x1000 blocks to work with. Each room can consume a specific minimum/maximum number of blocks in my grid. Each room generated has both an entry point and an exit point that the generator uses to connect them after rendering the location and size of the room. The generator uses the grid to place the rooms somewhat adjacent to one another and after you know it's placement, the generator would use smaller blocks to create corridors between the rooms.

Another idea would be that your dungeons aren't randomly generated but part of the designer developed map. What actually becomes random would be the creatures that you want to have spawn in your dungeon as your players move through them. Another variety is you use a variety of static maps you design and with the use of "teleporters", the dungeon spawner determines which of the static maps are chained together and in what order and your players traverse the dungeon this fashion.

A few good examples of the later exist in the latest World of Warcraft model which adds some variety to the same dungeon while keeping it somewhat familiar and consist to the player when they return back to that dungeon.

Both all models would work well depending upon your intent.
Good luck!

#4 laztrezort   Members   -  Reputation: 955

Like
2Likes
Like

Posted 30 March 2012 - 09:21 AM

Probably the simplest I can think of that produces good results (depending on your needs, that is) is using a binary space partition tree, like what is described here: http://roguebasin.roguelikedevelopment.org/index.php/Basic_BSP_Dungeon_generation. It guarantees connectivity, and also allows a simple way to designate separate areas of the map for containing, for example, entrances and exits. You can also look through the other articles on that site for other ideas.

However, I must say that having experimented with all of this before, getting truly random dungeons while maintaining good results (variety, consideration of other gameplay elements, etc.) can get very complicated very quickly.

#5 menyo   Members   -  Reputation: 403

Like
0Likes
Like

Posted 31 March 2012 - 09:49 AM

I would really use a path finding system to connect the rooms. You could "force" it to travel a certain direction before it changes so you won't get very "wiggly" corridors. Just give your rooms numbers and once you connect a room scrap the number from the list. You could also start with 1 room then a corridor add another room and corridor and loop. With this way you will get a linear dungeon or if you make multiple corridors from a single room you end up with a lot of dead ends, this could be fixed with some extra logic though. While defining your rooms you could add a doorway to use for the pathfinder. Also keep in mind to leave tiles in between rooms for corridors and walls.

for natural caverns you could use somekind of brush that travels the map and paints the dungeon. I used a rectangle that represented tiles, make a random length for it to travel then check if there is room for it and travel that length while you adjust the width of the rectangle and "paint" each step. Make it so it sometimes overlaps already painted sections and when it gets close to the edge of the map it should prefer a opposite direction a couple of steps. This could end up in really long narrow caves with larger open area's.

Current Project: TechnoFlux read all about it on my

DEV BLOG





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS