This interests me greatly...And I may be able to contribute some wisdom, but give me some time to dig up and think on it a bit...
I've been giving some thought to writing a program that produces a CC3 script with Jamis Buck's Random Dungeon algorithms, but I'm divided on how to go about it. Should IWhat would be the pros and cons of each? (Click here to download the relevant source code.)
- write my own code from scratch based on the algorithms described on the above webpage,
- use his JBMaze class for steps I and II and my own code for the rest, or
- just adapt his JBDungeonpaint class to output a script file from his JBDungeon object?
--
Dalton "who's caught between laziness and the urge to tinker" Spence
This interests me greatly...And I may be able to contribute some wisdom, but give me some time to dig up and think on it a bit...
Ok...after reading a bit...it appears he's basing his algorithms off of the depth first search model of maze generation and generating a maze from that and then converting it into a dungeon with some other smartness. I never got past the maze part because I didn't really need to.
I have some source code lying around somewhere though that is visual basic code that generates mazes based on three different maze algorithms. Depth first search, kruskal, and prim. It does this in screen saver format, so if you'd like this source code (vb6 I think) let me know.
Those of you who have been following the Maze Generation Code thread are aware I've actually written macros to handle step I of the procedure. I have also written some macros for handling step II (Maze Sparcification and Deadend Removal) but haven't tested them yet, since they require an input macro I have yet to write.
The biggest challenge for me is step III: "Room Generation and Placement." While it should be possible to write macros to do this randomly, any approach that I've come up with using the stated algorithm would take a very long time to execute and require extensive use of data-holding temporary hotspots. This has led me to ask the question, "Is this trip really necessary?" This IS a mapping program after all; wouldn't it be more logical for the map maker to place the rooms manually in a way that made sense for the adventure, rather than wait a very long time for the computer to come up with a random selection that would probably have to be editted anyway? Simply placing rooms where desired would need a much simpler macro, even if random door placement is included. Any opinions on this?
One thing that I definitely won't try is room contents; none of the algorithms I've seen for that seem to factor in room size (the only reason I can see for including it in the mapping process anyway), so you can get a two square room with a ton of treasure, several elves and a dragon while a forty square room can be completely empty. However, what I could do is link a hotspot over each room to launch a text file that could contain such a list. Should I include this in the room drawing macro?
--
Dalton "who needs a little direction here" Spence
Auto room generation would be a nice feature, but not a deal breaker. For me just having a rectangle, circle, whatever tossed in and the walls of the maze trimmed away would be enough I think so after generation editing seems like the most practical way to go.
I'm going to stick with rectangular rooms to start with. Much easier to code, at least until a "Select by Polygon" mode is created.
--
Dalton "who still has a lo of work to do here" Spence
Okay, I've got the room drawing macro mostly done, but I'm sort of stuck on door placement. The main issue is the same; random chance vs. intelligent design. (No, this isn't a religious debate. ) At the moment I'm leaning toward the latter with an element of the former; door placement will be deliberate but door type can be (optionally?) randomized. I'm waiting until the DD3 Art Upgrade comes out on Monday so I can see my door options.
--
Dalton "who hopes he'll have something to post here by Christmas" Spence
I think you are going in the right direction.