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.
← 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.