I'm working on a similar project to this, in hope of better understanding procedural generation. Would it be at all possible for you to share roughly how this algorithm works, or just some general techniques? My apologies if not.
There are many algorithms for dungeon generation. This one is my own invention and as such it's not exactly elegant. Its advantage is that it can produce maps that look kind of human-made, because they are they are "partly symmetrical". Here is how it works:
First we create a "root" room. Every room incl. this one has an origin/entrance.
Until some end condition is reached (e.g. we've spawned enough rooms), we pick one of the rooms and add symmetrical children to it: two on both sides from the entrance, one on the opposite end from the entrance or both (three children).
This way we get a symmetrical tree of connected rooms. Perfect symmetry doesn't look good, so occasionally we spawn children rooms unsymmetrically - of different sizes or just one to the side from entrance etc.
This gives us a "partly symmetrical" map, but it's still a tree and a decent map needs loops, so we add some loops by connecting adjacent room, adding tunnels etc.
That's it. There are some nuances to make it work and more nuances to make it work adequately, but that's the idea.
I am working on a rule lite RPG system for itch.io could I add a QR code to your GitHub for Procgen Arcana? (with credit of course) I would like to 1. use the fantasy city/village generator for the worldbuilding in the book and 2. suggest the dungeon/cave generator for GM's using the system
I just found your work and Its awesome, I think I can learn a lot from your code if its available anywhere, I seek for your Github public repos and didnt found this or other of your proyects, are they available anywhere to study?
Sorry to read that, anyway if in any time or moment do you pusblish it or want to send me a way to download the code for studing I will appreciate it very much, but if you dont its ok, it is your prerrogative off course
Thank you so much for your reply and for sharing the link I'll definitely go through it and study the concepts. I truly appreciate the effort you've put into your work, and I can only imagine how valuable it is to the community.
I completely understand if it's not the right time to release the code as open source, but if there's any chance I could have access to a part of it for personal study, it would mean a lot to me. I’m eager to learn from it, and I believe it could greatly enhance my understanding. Of course, I would respect any limitations you’d like to set.
Either way, thank you again for the insights and your time. I'm really grateful for your work!
In the current version it is not possible to request a specific number of rooms, but you request a small (3-6 rooms), medium (6-12 rooms) or large dungeon (12-25 rooms).
The randomly generated dungeons look really impressive and wonderful! Im wondering if there's any way for me to find out / learn what algorithms and code stands behind generating such nice looking dungeons?
Not an algorithm, but the idea: the main difference with this generator is that its output contains elements of "local symmetry". This is supposed to make a dungeon look human-made, like there was a purpose or a plan for it.
I was wondering if it would be possible to have an option for a different kind of legend, one that provides a prosaic description of each room (ie. only the features visible on the map, without any imagined details added).
For example:
1. This 20' x 30' rectangular room has a doorless archway on the north wall and a set of double doors on the east wall. A crate and some rubble is lying on the floor.
2. [Description of Room #2]
...
This would help LLMs or other AI models better understand the dungeon layout so they can generate themes and embellished room descriptions that more closely match the map.
Example Prompt:
"The attached image shows the layout of a dungeon. Please provide a theme or history for this dungeon, then write a detailed description of it including specifics for each of the numbered rooms."
Note that this would work best with unrotated maps, unless a "North" indicator is provided (and AI gets smarter).
It's an interesting idea, but it seems a bit too niche to implement it as a standard option. However, someone could create a standalone tool for translating an exported JSON into this kind of description.
Yes the top and bottom of the menu screen are cut off which also means it isn't possible to close the window. Not sure if this is something fixable but fingers crossed
Can you possibly add a button or some GUI to allow us to manually rotate the map?
I use this alot for grabbing some rooms from one generation and other rooms from another generation and sometimes the shadows don't match up, if i was able to rotate it the shadows would be uniform.
I'll think about it, although your use case is probably too uncommon. For now you can try disabling the shadows (Layers > Shadow or via the Style dialog).
Complete noob to this, but can someone explain how to save generated dungeons with all the notes to my files? When I export, all I get is the dungeon, no area descriptions.
I haven't tried it myself, but in theory it should work like this: choose Export as > PNG... in the context menu, enter some reasonably high value in the dialog (or leave the default 70) and then print the resulting png file with DPI equal to that value you entered.
Hello watabou. Is it possible to add tags, for example to force every room to be connected, even to force multiple entrances to every room, to generate a couple of levels connected to each other by one or many stairs ? Regards.
Unlike Cave Generator (with its connected and tree tags), here I have much less control over the way rooms are connected. I'll think about it, but right now I don't how this could be implemented in this generator.
hey, I could be wrong but I remember you had a world generator somewhere too and I can’t find it at all! is it available anywhere? love your generators :)
Is there any way to pass a modified json file back into this generator? I'm looking for a way to make small adjustments, or even have this tool re-skin something I've generated separately. New to this whole platform so I'm not sure if there's source code available.
This tool is great and the generation is really nice. But the design of the graphical interface needs a lot of work. Using only a context menu in an editor program is frustrating. But over all, it is really nice and a good time saver. Thanx a lot.
Well, it's not exactly an editor, it's mostly a generator. UI is a boring part of the project and if I made it for myself, there would be only Enter for building a new dungeon :)
I've been using your maps for a long time now, both as a dungeon master and as a developer for testing our team's tabletop map projection software Infinite Realms.
I recently implemented support for the Universal VTT file format in our app and was wondering if you would be interested in this as well for this generator. UVTT supports light, grid and wall placement information and more. The information is in JSON format and the map image is a base64 encoded string in the same file.
The format is supported by a growing number of map generators and VTTs, so it may be worth a look... ;)
I love this generator (and all your others). I was playing with it, and decided to play around with the water level settings a bit. I wondered what it would be like with various water depths indicated (so like, this area is water level 1, that area is deeper, like 5, etc) - I decided to layer levels 1 to 5, so that the smallest area (where depth 1 covers) is 5, the next is 4, etc. Here are my results:
it would be cool if you could include something like this, but even without, this is a really great tool. Thanks for all the cool stuff you make, and especially for sharing it freely!
some of them, yes, there is some tags that doesn't quite fit well and others tag that are "missing". also the style is a bit different, I know is only aesthetic but still.. 2 of the main difference would that the general shape should be far more compacted and the final map must resemble some kind of "shape" (squared, elongated, triangular...).
Is there any chance for a standalone download? The Itch.Io UI overlaps the top right quadrant of the entire generator unless I set my browser zoom to 75%.
Or a paid tool to let us manually make dungeons using the elements in the generator?
Occasionally I build native versions of my most popular generators (including 1PDG) for my patrons. The last time I did this was some time ago, so the next time is gonna be soonish. But if that UI thing is the only thing that bothers you, you can try the Arcana version of this generator.
I have no plans for making an editor (vs. generator) at this moment.
Hey, I really want to use these models in MagicaVoxel, but when I drag the file in, nothing happens. I see on twitter that other people have gotten it to work. I can import it as an image fine, but that's just a flat image. I was able to import other .vox files made with different software just fine though. I think perhaps MagicaVoxel has changed the details of their file requirements since you made that export function.
It also could not import your .md or .svg files, on further investigation.
I am using 0.99.6.2 for macOS and it imports dungeons normally for me. I guess it's a pretty old version, but unfortunately I can't test a newer one right now. I'll try to do it a bit later.
I didn't get what is the issue with md and svg files. Where are you importing them?
I am on an M1 Max - Ventura. I can't get the older or newer version to accept the Vox or SVG file. It loads Magica OK but just has a blank screen. Please can you share if there is anything extra you did to get it running on the mac. Thanks
I am on M1 Pro, Ventura and I'm pretty sure I didn't do anything special to make Magica load these vox files (although there was something about moving the folder??? to make Magica start normally). Apparently, there is no newer version to test.
My English is not very good, so I borrowed translation software for this evaluation.
May I ask if you are considering adding support for other languages? I can help you complete the Chinese section (in fact, I have made some modifications, but I don't know how to preserve both languages at the same time).
In addition, I hope to add API functionality to directly generate image versions of maps based on website addresses, so that robots can directly obtain maps and send them to the chat software we use.
Hi! Thanks for your message and offer of help, but I'm not planning to add other languages at the moment. I mean, yeah, it would be nice to have support for translations, that would make the generator more accessible I guess. But to do it right, it would require a lot of work and it's not exactly the kind of work I like. Also some parts of the generator (specifically, text generation) are much harder to localize.
← Return to generator
Comments
Log in with itch.io to leave a comment.
Cheers!
Could we have larger dungeon maps with more rooms? Maybe a Huge, Enormous, Labyrinth settings ?
Is there any chance of having a multi-level version? So stairs down on one level align with stairs up on the next.
What does alignment mean when two levels have different shapes? For example, how can you know that these two levels are not aligned:
?
I'm working on a similar project to this, in hope of better understanding procedural generation. Would it be at all possible for you to share roughly how this algorithm works, or just some general techniques? My apologies if not.
There are many algorithms for dungeon generation. This one is my own invention and as such it's not exactly elegant. Its advantage is that it can produce maps that look kind of human-made, because they are they are "partly symmetrical". Here is how it works:
That's it. There are some nuances to make it work and more nuances to make it work adequately, but that's the idea.
I am working on a rule lite RPG system for itch.io could I add a QR code to your GitHub for Procgen Arcana? (with credit of course) I would like to 1. use the fantasy city/village generator for the worldbuilding in the book and 2. suggest the dungeon/cave generator for GM's using the system
Sure!
Thank you, you are making some great tools for GMs and game devs
Have you considered some form of api for this and other projects?
I don't it's possible since all my generators are purely client-side applications.
I just found your work and Its awesome, I think I can learn a lot from your code if its available anywhere, I seek for your Github public repos and didnt found this or other of your proyects, are they available anywhere to study?
i like potato
This project is not open source at this moment, sorry.
Sorry to read that, anyway if in any time or moment do you pusblish it or want to send me a way to download the code for studing I will appreciate it very much, but if you dont its ok, it is your prerrogative off course
You can try to examine the published js code as @BorisTheBrave did with the cave generator: https://www.boristhebrave.com/2023/11/19/how-does-cave-glade-generator-work/
Thank you so much for your reply and for sharing the link I'll definitely go through it and study the concepts. I truly appreciate the effort you've put into your work, and I can only imagine how valuable it is to the community.
I completely understand if it's not the right time to release the code as open source, but if there's any chance I could have access to a part of it for personal study, it would mean a lot to me. I’m eager to learn from it, and I believe it could greatly enhance my understanding. Of course, I would respect any limitations you’d like to set.
Either way, thank you again for the insights and your time. I'm really grateful for your work!
Hello, I recently found your tool and I'm definitely gonna use it for my games. I also feel pretty inspired to create some tool of my own.
I would have feature request for you if not already possible. I wish to generate dungeons with traps.
Thank you for that wonderful tool. would it be possible to define the number of rooms?
In the current version it is not possible to request a specific number of rooms, but you request a small (3-6 rooms), medium (6-12 rooms) or large dungeon (12-25 rooms).
The randomly generated dungeons look really impressive and wonderful! Im wondering if there's any way for me to find out / learn what algorithms and code stands behind generating such nice looking dungeons?
Not an algorithm, but the idea: the main difference with this generator is that its output contains elements of "local symmetry". This is supposed to make a dungeon look human-made, like there was a purpose or a plan for it.
I was wondering if it would be possible to have an option for a different kind of legend, one that provides a prosaic description of each room (ie. only the features visible on the map, without any imagined details added).
For example:
1. This 20' x 30' rectangular room has a doorless archway on the north wall and a set of double doors on the east wall. A crate and some rubble is lying on the floor.
2. [Description of Room #2]
...
This would help LLMs or other AI models better understand the dungeon layout so they can generate themes and embellished room descriptions that more closely match the map.
Example Prompt:
"The attached image shows the layout of a dungeon. Please provide a theme or history for this dungeon, then write a detailed description of it including specifics for each of the numbered rooms."
Note that this would work best with unrotated maps, unless a "North" indicator is provided (and AI gets smarter).
It's an interesting idea, but it seems a bit too niche to implement it as a standard option. However, someone could create a standalone tool for translating an exported JSON into this kind of description.
Works quite well on mobile until I try to open the tags menu. Not sure if it's something you can fix but would be super Handy 😊
You mean the Tags window is too large for a mobile screen?
Yes the top and bottom of the menu screen are cut off which also means it isn't possible to close the window. Not sure if this is something fixable but fingers crossed
Now thats a perfect tool.
Is it possible to add fixed cell size for SVG exports?
Could come very handy for VTT imports and as someone mentioned for mix and match several dungeons in one big dungeon in SVG editor.
Maybe. Using SVG with VTT doesn't seem very common to me, though.
Sure, it can be just mine specific use case and i definitely can go with PNG.
And i'd like to appreciate all your works on procgen - those are just simple perfect!
Can you possibly add a button or some GUI to allow us to manually rotate the map?
I use this alot for grabbing some rooms from one generation and other rooms from another generation and sometimes the shadows don't match up, if i was able to rotate it the shadows would be uniform.
Great tool either way!
I'll think about it, although your use case is probably too uncommon. For now you can try disabling the shadows (Layers > Shadow or via the Style dialog).
Complete noob to this, but can someone explain how to save generated dungeons with all the notes to my files? When I export, all I get is the dungeon, no area descriptions.
You need to choose Save as PNG (not Export as > PNG...) to get the image with all the notes.
This is gonna sound ultra newbie - but... how do I print this so that each square is 1 inch long? Can someone help me out?
I haven't tried it myself, but in theory it should work like this: choose Export as > PNG... in the context menu, enter some reasonably high value in the dialog (or leave the default 70) and then print the resulting png file with DPI equal to that value you entered.
Amazing work !
Is there a way to integrate this app direclty in another webapp ? Or a way to set tags without configure with app menu ?
Thanks :)
You can request a dungeon with a set of specific tags via the url parameter "tags" :
It is also possible to make the browser download a map (as png/svg/json) right after it's generated:
Since it's a purely client-side application, there is no real api to work with it.
Nice, it's a very good starting point :)
I'll have a look how can I integrate this.
Thanks a lot ! :)
Watabou, this is amazing. The ONLY thing I need it to do is be able to lock the proportions of the output image and grid scale.
Doesn't "Export as > PNG..." do that?
Hello watabou. Is it possible to add tags, for example to force every room to be connected, even to force multiple entrances to every room, to generate a couple of levels connected to each other by one or many stairs ? Regards.
Unlike Cave Generator (with its connected and tree tags), here I have much less control over the way rooms are connected. I'll think about it, but right now I don't how this could be implemented in this generator.
hey, I could be wrong but I remember you had a world generator somewhere too and I can’t find it at all! is it available anywhere? love your generators :)
You are probably talking about Azgaar's Fantasy Map Generator (made by Azgaar), there is some limited integration between this world generator and my city generator. The closest thing I've ever done is Perilous Shores.
This is amazing!
This tool is amazing. Thank you so much for this!
My one wish is to have the option to label each room with a number.
Try selecting Notes > Numbers in the context menu, probably that's what you need?
*Facepalm*
Thanks! I don't know how I missed that.
Is there any way to pass a modified json file back into this generator? I'm looking for a way to make small adjustments, or even have this tool re-skin something I've generated separately. New to this whole platform so I'm not sure if there's source code available.
No way to do it, sorry, but you can try loading a modified json in one of the editor which support this format.
This tool is great and the generation is really nice. But the design of the graphical interface needs a lot of work. Using only a context menu in an editor program is frustrating. But over all, it is really nice and a good time saver. Thanx a lot.
Well, it's not exactly an editor, it's mostly a generator. UI is a boring part of the project and if I made it for myself, there would be only Enter for building a new dungeon :)
I've been using your maps for a long time now, both as a dungeon master and as a developer for testing our team's tabletop map projection software Infinite Realms.
I recently implemented support for the Universal VTT file format in our app and was wondering if you would be interested in this as well for this generator. UVTT supports light, grid and wall placement information and more. The information is in JSON format and the map image is a base64 encoded string in the same file.
The format is supported by a growing number of map generators and VTTs, so it may be worth a look... ;)
Arkenforge has posted a blog post on the specs, along with a demo file here: https://arkenforge.com/universal-vtt-files/
Yeah, I'm considering adding this, although I haven't looked closely at the specification yet.
I love this generator (and all your others). I was playing with it, and decided to play around with the water level settings a bit. I wondered what it would be like with various water depths indicated (so like, this area is water level 1, that area is deeper, like 5, etc) - I decided to layer levels 1 to 5, so that the smallest area (where depth 1 covers) is 5, the next is 4, etc. Here are my results:
it would be cool if you could include something like this, but even without, this is a really great tool. Thanks for all the cool stuff you make, and especially for sharing it freely!
The colours look very nice!
do you have a preffered commerical credit copy? Link to Patreon? link to your itch.io account? Either way, thanks for all you do.
Yeah, a link to my patreon, itch or twitter (whatever looks better for you) is fine. Cheers!
in the props layer, what does the star in the circle means?
Statue: https://dysonlogos.blog/2013/12/23/the-key-to-all-this-madness/
do you plan to make a "starship" branch/fork?
I do not, I'm just not familiar enough with the genre. But I guess some of the maps could work as spaceship plans as they are?
some of them, yes, there is some tags that doesn't quite fit well and others tag that are "missing". also the style is a bit different, I know is only aesthetic but still..
2 of the main difference would that the general shape should be far more compacted and the final map must resemble some kind of "shape" (squared, elongated, triangular...).
Is there any chance for a standalone download? The Itch.Io UI overlaps the top right quadrant of the entire generator unless I set my browser zoom to 75%.
Or a paid tool to let us manually make dungeons using the elements in the generator?
Occasionally I build native versions of my most popular generators (including 1PDG) for my patrons. The last time I did this was some time ago, so the next time is gonna be soonish. But if that UI thing is the only thing that bothers you, you can try the Arcana version of this generator.
I have no plans for making an editor (vs. generator) at this moment.
Awesome project! Thanks for sharing it with us.
Hey, I really want to use these models in MagicaVoxel, but when I drag the file in, nothing happens. I see on twitter that other people have gotten it to work. I can import it as an image fine, but that's just a flat image. I was able to import other .vox files made with different software just fine though. I think perhaps MagicaVoxel has changed the details of their file requirements since you made that export function.
It also could not import your .md or .svg files, on further investigation.
I am using 0.99.6.2 for macOS and it imports dungeons normally for me. I guess it's a pretty old version, but unfortunately I can't test a newer one right now. I'll try to do it a bit later.
I didn't get what is the issue with md and svg files. Where are you importing them?
OK, yup, switched to 0.99.6.4 for Windows, and it works just fine. Not sure what they changed in the more recent release that breaks it.
I am on an M1 Max - Ventura. I can't get the older or newer version to accept the Vox or SVG file. It loads Magica OK but just has a blank screen. Please can you share if there is anything extra you did to get it running on the mac. Thanks
I am on M1 Pro, Ventura and I'm pretty sure I didn't do anything special to make Magica load these vox files (although there was something about moving the folder??? to make Magica start normally). Apparently, there is no newer version to test.
I don't get why you guys keep mentioning svg...
Thank you very much for your work!
My English is not very good, so I borrowed translation software for this evaluation.
May I ask if you are considering adding support for other languages? I can help you complete the Chinese section (in fact, I have made some modifications, but I don't know how to preserve both languages at the same time).
In addition, I hope to add API functionality to directly generate image versions of maps based on website addresses, so that robots can directly obtain maps and send them to the chat software we use.
非常感谢您的作品!
我的英语不太好,因此这段评价借用了翻译软件。
请问您是否考虑对其他语言添加支持?我可以帮助您完成中文部分(实事上我已经修改了一部分,但是我不知道要如何同时保留两种语言)。
另外我希望能够增加直接根据网址生成图片版地图的API功能,以便机器人直接获取地图并发送到我们使用的聊天软件中。
Hi! Thanks for your message and offer of help, but I'm not planning to add other languages at the moment. I mean, yeah, it would be nice to have support for translations, that would make the generator more accessible I guess. But to do it right, it would require a lot of work and it's not exactly the kind of work I like. Also some parts of the generator (specifically, text generation) are much harder to localize.
could you give us the downloadable file?
That's one of the very few rewards exclusive to my patrons. Didn't build native versions for a while though, since nobody reminded me...
oh ok
This is great! Hope for adding language support?