Dungeon Generator: feedback please

Thoughts, Help, Feature Requests, Bug Reports, Developing code for...

Moderators: dorpond, trevor, Azhrei

Forum rules
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior. :)
Post Reply
User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Dungeon Generator: feedback please

Post by wolph42 »

Ok I've started on a new dungeon generator. First step: random rooms, and then some finetuning in the interface.
Attached is a lib you can drop in an empty campaign file, run oncampaignload and then "dungeonGen" function. You can set width, height and fill.
The result is currently represented in an simple html form and its rooms only.
the principle behind the generator (if youre interested)
I got this (partially) from the donjon generator:
1. max room size is 1/4 of the dungeon size
2. room can only start on odd coordinates and have an odd length and width
3. resulting dungeon starts a an empty array [] and is filled with grid coordinates: {x:3;y:5}. Every coord represents an open space on that spot in the dungeon.
the filling:
4. first a room (random size) is build by creating a set of coords which allow for an offset {x:[r:0+x];y:[r:0+y]}, {x:[r:1+x];y:[r:0+y]}, {x:[r:2+x];y:[r:0+y]}, etc.
5. then the offset is randomly decided and applied to the array (Wiki: json.evaluate())
6. next its checked whether the room overlaps with an existing room (using Wiki: json.intersection()(dungeon, room), if so then a new random offset is determined. Rinse and repeat.
7. a while loop is used to keep iterating until the fill target is met. (so yes if you enter a fill target >100% then you have a chance for an inf loop
Next step is corridors and then I need to dig a path.

Comment, suggestions are most welcome

EDIT: Let me also phrase some concrete questions:
- What kind of algorithm can I use for creating corridors
(I have already some idead, but curious to others)
One method I can think of:
1 pick a random spot in the dungeon (again odd coords only!!)
2 check whether the spot is 'solid' (so no room or other corridor) (if not back to 1)
3 50% chance for initial horizontal or vertical direction (e.g. horizontal)
4 check all 4 SECOND (the first connections are all even coords and thus empty!!) connecting points for 'solid' if none then discard this coord and pick a new one.
5 Randomly choose a direction from the available 1,2,3 or 4 available directions and pick that direction (always in steps of 2 so you end up in an odd coord!!).
6 in 70% of the cases keep going in that direction, the other 30% take another direction
7 keep doing this until you hit a wall
8 rinse and repeat 1 to 7 until a certain 'fill' is reached.
- How do I eventually decide where the 'connectors' are placed AND how do I make certain that everything is accessible?
Note: I don't need code, I just need a procedural description of how to go with that.
Attachments
DB3TestLib.rptok
(82.08 KiB) Downloaded 52 times

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: Dungeon Generator: feedback please

Post by Full Bleed »

You might want to take a look at what this guy did. After you mess around with the generator to get a feel for it, you can click the bottom of the page where it says, "About the Generator..." and you can look at his source code.

No reason to reinvent the wheel... adapting it for MT and improving it will be hard enough. ;)
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Dungeon Generator: feedback please

Post by wolph42 »

Full Bleed wrote:You might want to take a look at what this guy did. After you mess around with the generator to get a feel for it, you can click the bottom of the page where it says, "About the Generator..." and you can look at his source code.

No reason to reinvent the wheel... adapting it for MT and improving it will be hard enough. ;)
erm:
Wolph42 wrote:I got this (partially) from the donjon generator:
but thanks for the effort :mrgreen:

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: Dungeon Generator: feedback please

Post by Full Bleed »

wolph42 wrote: I got this (partially) from the donjon generator:
Heh, I didn't pop open your processes... figuring that someone else had probably already done what you were trying to do... :oops:
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

User avatar
Darcphaze
Cave Troll
Posts: 91
Joined: Sun Aug 10, 2008 9:29 pm
Contact:

Re: Dungeon Generator: feedback please

Post by Darcphaze »

Don't know if this would help you any. Mythweavers hosts a 3.5 version of Jamis Buck's Dungeon Generator, and I have the 3.0 version on my website, if you think it would help called darcphaze, which is also html based.
No matter what a GM plans for, the players are certain to find another way to do it

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Dungeon Generator: feedback please

Post by wolph42 »

Darcphaze wrote:Don't know if this would help you any. Mythweavers hosts a 3.5 version of Jamis Buck's Dungeon Generator, and I have the 3.0 version on my website, if you think it would help called darcphaze, which is also html based.
Hi, thanks for sharing, looks good. However its an exe file so not really helpfull. I need either code or even better the descriptive algorithm. The point is that this has to be part of MT so I can generate dungeons from within mt.

User avatar
Darcphaze
Cave Troll
Posts: 91
Joined: Sun Aug 10, 2008 9:29 pm
Contact:

Re: Dungeon Generator: feedback please

Post by Darcphaze »

Yeah the search can be a pain. There's several sites I use periodically, some better than others. I breezed through them and didn't find a mention of the code, but there are free script libraries on this page here:

http://www.outworldz.com/Secondlife/Tools/tools.htm

Course I'm looking blind, being code challenged. At least this site has a link to the code though.

http://journal.stuffwithstuff.com/2014/ ... and-mazes/

I won't drop more sites. I know you got enough to do :D
No matter what a GM plans for, the players are certain to find another way to do it

Post Reply

Return to “MapTool”