Hayden Scott-Baron
Level 7
 
Posts: 771
also known as 'Dock'
|
 |
« on: December 11, 2008, 04:55:23 PM » |
|
I've been playing around with this online dungeon generator: http://direpress.bin.sh/tools/dungeon.cgiIs there some existing rulesets in order to generate this sort of thing? The maps that are generated often seem quite well laid out, and I was interested in whether these sorts of layour are widely known, or whether people tend to develop their own techniques for building maps procedually. Also, is it something where you start off simple, and work your way up to a more complex generation system?
|
|
|
|
|
Logged
|
|
|
|
|
Decipher
|
 |
« Reply #1 on: December 11, 2008, 05:44:33 PM » |
|
That seems like a quite cute maze generator to me. And maze generators are widely known. In fact it's not even hard to code one. I have coded one for Krysp (my submission for the CodeBlocks Challenge). Although the one Krysp implements is not as mature as the one you posted, the two share a lot in common. As for the existing rulesets, it all depends on you, and how you want your content to be generated. This is what is good about procedural generation you're simply unbounded. Finally, it simply is up to you how will you code it. If the generator I'm coding is something really complex I'd start off simple and build on, otherwise I'd code straightforward.
|
|
|
|
|
Logged
|
Бескрайност kærlighed til eksperimenterende spil. Kamelåså horer.
|
|
|
|
|
Hayden Scott-Baron
Level 7
 
Posts: 771
also known as 'Dock'
|
 |
« Reply #3 on: December 12, 2008, 01:33:58 AM » |
|
I wonder whether the map making algorithm in the example I linked to is available. I love the wiggly labyrinth corridors between the rooms. This helps a lot, it's good to get an idea as to how these maps are figured out. I guess the best way to learn is to make a 2D array and start poking through it. Does anyone know of any guides or tutorials for random map programming?
|
|
|
|
|
Logged
|
|
|
|
|
george
|
 |
« Reply #4 on: December 12, 2008, 07:43:27 AM » |
|
|
|
|
|
|
Logged
|
|
|
|
|
nihilocrat
|
 |
« Reply #5 on: December 13, 2008, 11:37:07 AM » |
|
The generator you link to looks like a pimped-out version of a roguelike dungeon generator. If you set some of the options to more conservative values (rectangle rooms, straight/bent corridors, no deadends) you'll notice that you've got what looks like a roguelike dungeon.
The algorithm for those dungeons is pretty simple. Basically you choose a number of rooms, a min room size and max room size, and maybe some other variables, and generate a bunch of non-overlapping rooms. Then, you randomly create doorways to each room based on some other variables. Proceed to generate corridors between these doorways, making sure that all the rooms are connected (there are no disconnected rooms, or sets of rooms disconnected from all the others). If you can't connect rooms with a straight corridor, just make one or more bends in it. From here, you can make more complicated algorithms to generate rooms and corridors to get labyrinth corridors or non-rectangular rooms.
If you need more help with the algorithm, there are plenty of open source roguelikes out there. Hopefully the dungeon generation code is well-written and well-commented.
edit: whoa, thanks for the PCG wiki link! I never knew such a thing existed!
|
|
|
|
|
Logged
|
|
|
|
Ivan
Owl Country
Level 10

Posts: 1832
alright, let's see what we can see
|
 |
« Reply #6 on: December 13, 2008, 11:48:24 AM » |
|
I made a little roguelike awhile back and I just bruteforced my dungeon generation. Just generated a few random rectangle rooms in the overall space and then connected them with corridors. Unless you're doing mazes and stuff, it's not a bad way of doing things imho.
|
|
|
|
|
Logged
|
|
|
|
Hayden Scott-Baron
Level 7
 
Posts: 771
also known as 'Dock'
|
 |
« Reply #7 on: December 14, 2008, 06:03:01 AM » |
|
http://dirkkok.wordpress.com/2007/11/21/generating-random-dungeons-part-1/I found a tutorial that, from first impressions, seems to know what it is talking about. I'm starting to think that the best approach will be to try to do it myself. Solving the problems is probably the most important part of understanding the process in the first place. Also, I'd like to do something with diagonals and other shapes, which complicates things much more than the average roguelike map. Toastie, by brute force are you referring to your method of checking whether or not there was a route from one room to the next? This is one part that confuses me, how you choose paths between each room without overlapping or tangling... but I suppose it's a matter of rules, and waiting for those rules to cease to be invalid.
|
|
|
|
|
Logged
|
|
|
|
|
Sparky
|
 |
« Reply #8 on: December 14, 2008, 06:20:41 PM » |
|
Wow, that's a great generator, Dock.
I've always been fascinated by dungeon generation. I was working on a hex grid roguelike a while ago, but I never got my dungeon generation to work very well. I started with one room, specified door points, and then crawled outward randomly from there, creating rooms (or dead ends) at the end of each corridor. The wall cells bordering the passages and rooms weren't even marked, so the corridor diggers would inadvertently connect to non-door spaces all the time.
The main points I was missing were room packing and nice path finding for the corridors.
Despite how poor my results were, it was a lot of fun to code. I wish you better luck than I in your endeavors, and I look forward to seeing your results.
|
|
|
|
|
Logged
|
|
|
|
|
Natso
|
 |
« Reply #9 on: December 15, 2008, 05:25:55 AM » |
|
The dungeon generator linked in the first post seems to draw all of its room content from D&D (I confirm this). Also, in dungeon generation, you're going to feel like you're cutting some corners to get things to work right. It always ends up feeling like that.
Cheers - Natso
|
|
|
|
|
Logged
|
Home is where my power chord is.
|
|
|
Hayden Scott-Baron
Level 7
 
Posts: 771
also known as 'Dock'
|
 |
« Reply #10 on: December 15, 2008, 06:34:37 AM » |
|
The dungeon generator linked in the first post seems to draw all of its room content from D&D (I confirm this). Is there a documented set of rules for constructing dungeons in this manner in D&D?
|
|
|
|
|
Logged
|
|
|
|
|
Natso
|
 |
« Reply #11 on: December 15, 2008, 09:57:53 AM » |
|
Naw, the map layout is whatever the DM wants it to be (D&D in itself can be played without a physical grid/map at all, but it helps a lot to use them) As for the monsters & room contents themselves, they look to be from D&D 3.0 or 3.5 edition. If you're interested in the D&D-related generation, you should check out http://www.d20srd.org/ for more info. As for the map-generator, that is entirely unrelated to D&D, other then that the map can be used for it. The DM's Guide has a few pointers for dungeon decor & layout, etc, but their layout is really at the DM's own discretion. (Sorry if my original reply was misleading) Cheers - Natso
|
|
|
|
|
Logged
|
Home is where my power chord is.
|
|
|
Titch
Level 2
 
Posts: 271
Cautiously Pragmatic
|
 |
« Reply #12 on: December 15, 2008, 11:39:13 AM » |
|
I have been wondering about psuedo-random generation, but for a performer rather than a dungeon crawling game. I always get hammered by having to ensure that the metrics of the content function properly without having to pre-fabricate blocks of content and stick them together.
|
|
|
|
|
Logged
|
|
|
|
|
increpare
Guest
|
 |
« Reply #13 on: December 15, 2008, 11:55:35 AM » |
|
I have been wondering about psuedo-random generation, but for a performer rather than a dungeon crawling game. I always get hammered by having to ensure that the metrics of the content function properly without having to pre-fabricate blocks of content and stick them together.
Well one way is usually to generate a sure-fire path first (this isn't necessarily the same as having pre-fabricated content), then to elaborate it as much as possible.
|
|
|
|
|
Logged
|
|
|
|
|
Natso
|
 |
« Reply #14 on: December 15, 2008, 12:51:04 PM » |
|
I have been wondering about psuedo-random generation, but for a performer rather than a dungeon crawling game. I always get hammered by having to ensure that the metrics of the content function properly without having to pre-fabricate blocks of content and stick them together.
I hate to make a suggestion with little explanation, but you should look into dynamic programming, if you structure your generation similarly it may become quite a bit easier. Also, consider the generation function recursively, if you haven't done that yet... (just throwing out some ideas) Cheers - Natso
|
|
|
|
|
Logged
|
Home is where my power chord is.
|
|
|
|