This addon looks dope! It'd be cool if there could be multiple corridor rooms, and it could try to use longer ones when possible. Just to try to avoid a lot of repetition using the same little room many times in a row. Also maybe you could auto-detect a stairs room by just looking at corridor rooms with y > 1 with doors on multiple floors? Cheers, just brainstorming, great addon!
The corridor idea is an interesting one, definitely could do that. Maybe for a future update if people end up liking this a lot. I think even in this update, it's technically possible, like you could do that with code on some post generate hooks and change the corridor appearance after the voxel grid is set and it's done generating. The stairs one, the reason I chose explicitly setting stairs is because I think it's more clear, and gives more control. I actually had it like that at the start, auto detect stair rooms. But by having an is_stairs check, I think it's just good to have it more clear and lets you control what rooms are used in the stairs stage, which are placed a bit differently than in the place rooms stage. Thanks for your comment glad you enjoyed :)
Would love to see door "types" for transitional rooms between themes or areas of the dungeon. So you could have 2 different styles of corridors that only connect to a specific type of door. You could then have a room that has both door types that could allow for controlled branching in the dungeon.
Great tutorial! Looking forward to check it out..I would be very interested in a basic tutorial of how to implement a BSP algorithm. Like what structures to represent the tree, the leaves, why..How to implement the recursivity and so on..In GD script.I am struggling with it, being unable to implement a relatively simple to understand algorithm..Even in 2D would be enough, to understand and build upon it. Thank you for your videos!
Would there be a way to generate corridors using rooms larger than 1x1? My game uses fixed cameras, and the 1x1 rooms dont work well with that, as you can imagine. Being able to instead mark 3-4 different 'corridor' rooms of different sizes would be helpful. I'm not sure how to achieve it without overhauling source code. Either way, thanks for this vid.
Closest we have at the moment is just to swap in a different model for the 1x1x1 corridor after generation. Also to play with astar settings to try to make the corridors more wide and straight, heuristic scale 3 and corridor cost 1 would maybe be some ones to try. Main problem/ difficulty with this idea of different corridor sizes, is it's not super clear how that would even work. I mean it's not well defined, currently we have astar which pathfinds/tunnels to/from rooms. You can mess with the shape of the hallways a bit, but because it is procedural, I don't see how we even define some alternating corridor shapes like that. I'm sure it's possible but I really don't see a clear idea of how one would do that or even define what it means. Hope this helps.
so like 4 main things could be added to really turn this into a fully fledged system (not that it isnt one already, but rather one that can be used in a more controlled manner beyond random placement of connections. this is based off something i had done in unity years ago for a test project). Now u may have these already in there as i am only testing it out briefly so dont mind me if its already included. I just think these are by far the most important things to have in this type of setup and if u have it that is even more awesome to be thinking on the same page. >> Door Groups This is basically giving a door a key (like a unique number) and only other doors that have that "key" can connect to this (including corridors if need be, though ideally u would want keyed doors to always connect to another keyed door before pathing starts). This provides a huge addition by allowing doors of different sizes as well as controlled pathing. So u could have large hallways and entrances into other rooms as well as a more controlled this room can only connect to these other rooms. Obviously if a user makes a key they must provide wall/corridor/stair with that key as well so the pathing can work properly (that way custom subsections dont need to use default setups) >>Mandatory Connections This is in extension to having a "keyed" door but u can say i need this door to always have something spawned to connect to it before u do pathing. This allows a very very very useful thing to happen. the first being u can generate a sub layout before u even start pathing. So if u have your own setup of nodes for a specific "section" u can better utilize them or if u just require mandatory connected random rooms like a random treasure room connected after a fight. now u can extend this to have an allowed number of "tries" before failing as well. >>Corridor/Stair types having multiple corridor and stair options (or any other new nodes that are created due to pathing stage). this just allows for more variety and u can have a weight to each option if it will choose one version over another (this can also extend into custom sized ones as well . . . so what if u have a 2 by 3 corridor or maybe a corridor with a tall cieling). >>Wall Variants introduces more options as well. after all is done and u need to "patch" a door that was optional u fill it with a wall. buuuuut . . . if u can have different options for walls that means u can have things like maybe a barricaded door spawn or a portal that jumps u to a different section or something else. This would have to work with keyed doors so if a user makes a keyed door it is mandatory they provide at the minimum 1 wall for that key so it can be properly filled All in all this is one impressive plugin and i played around with it a bit and it is very well done. If u add the above I think u would have like the ultimate generation system. The things above are very important and can allow heavy customization beyond general generation and allow u to do some impressive stuff. This has kinda made me wanna remake my original unity based generator into godot. It didnt use pathing like u had but was based purely on chance based instancing in a connection sequence vs place room and path to room. Then weights would be set to determine if i want a longer or shorter path to next "main" node and corridors would be spawned in relation to that.
How would you go about defining custom generation rules? Right now hallways are created by stacking multiple corridors but say I was looking to generate a sewage system that would alternate between placing single small corridors of size 1x1 and attaching longer hallways that are 1x4 in length, would the custom room placement function allow for such logic?
Not really a built in way to make this easy at the moment, it gets complex if you want to alternate 4 length paths in astar, would have to do some hacks to force the algorithm to do that. But you could try just placing some 1x4s in the normal rooms phase and it will connect them. You could for instance place them manually and always have it somehow that it will have 1x4s inbetween rooms where you want them, then it's likely that it will be connected as you want. You could also do something like, just spawn totally empty corridors with no models at all, and then do a final pass at the end where you iterate through all corridors place and replace them with some certain model if there is 4 connected in a line.
Hello, is it possible to randomize dungeon mostly from the pull of my handmade rooms and corridors? I don't really like generated things, but some randomization instead would be cool. Also since such rooms have to be with optional door class, is it possible to settle doors to specific room with a key? Sorry, if it's a dumb question.
Hey! thanks for this! I have an issue while recreating what you did during the basic setup tutorial. For some reason after enabling collision I don't have any collision on the stair of the "stair" room. every other collision are working properly. I tried enabling the collision on the CSGPolygon3D of the stair itself but it's messing up the generation and everything turns flat or one floor is missing.
i forgot to enable mine in the tutorial, but i just tried enabling "Use Collision" on the CSGPolygon3D and it seems to work fine for me. I can't think of why that would have any effect on generation. The addon does not know anything about the collision objects within. It just places the room nodes. Only thing that comes to mind, you might have to enable "Local to scene" for resources like collision objects since the rooms just instantiated many times - but that does not apply to CSGs so I'm not sure what's going on. Any errors it's giving you?
@@MajikayoGames Nvm I couldn't reproduce it for some reason after progressing the tutorial and making some changes. I'm pretty sure it was just the generation not working because of how I aligned some doors before. Thanks
How do you go about adding enemies and npcs throughout the rooms in the dungeon? I have been having trouble with making them move towards the player, attack, etc I believe because my player is spawning in a seperate scene (the entrance room)
I think you should be able to put a navmesh in each room scene and as long as they get connected properly, enemies should be able to pathfind through the dungeon. docs.godotengine.org/en/stable/tutorials/navigation/navigation_connecting_navmesh.html
hello again ! "get room leads to" return a null or not value. But for exemple if i want to change the type of door depending on the room it connect too, how would i call a specific room type to see if it's connected or not ? (for exemple, specifically looking if the connection is to a corridor or to a room ?)
Also, trying to add a script to corridor (like you did to the living room at 34:39) seems to breack the whole "door detection" . because removing assets by using ".get_room_leads_to() == corridor" doesn't work in the node you used at 32:18
Can I ask you how to properly install this to my own project? When following the GitHub instructions and adding to addons folder it will have lots of compiling errors and when trying to open the scene it will be missing dependencies
Just tested it, I'm not getting any errors importing it. Did you make sure to enable it in the project settings plugins and maybe try restarting Godot after? What scene is giving you compiling errors?
@@MajikayoGames So I’m not home right now but what happens is I will drag the simple dungeons folder within the addons folder to a new addons folder I made for my project, when I do that it imports but will pop up with like 5 compiling errors, I can enable the plugin but it won’t do anything. Opening the demo project you made works perfectly, but only when adding to my project it fails. Can you give me a run down on exactly how you did it ?
@@NubsHai The github repo has addons/SimpleDungeons folder. You need to drag the addons/SimpleDungeons folder, to your own addons/ folder. So your project looks like mine with addons/SimpleDungeons. Not the whole repo if you were doing that. If you tell me what the errors are I can try to help.
@@MajikayoGames I just succesfully imported it to my project, I cant seem to recreate the error I was having im not sure I was super tired and probably did something wrong last night lol
i actually just added a heuristic_scale option to DungeonGenerator3D because of this comment. previously i thought euclidean helped with that but upon looking it up it doesn't seem to. you can try increasing heuristic scale to 3 with manhattan or euclidean modes, and also try messing with the corridor cost option, raising this (probably just to 1) can make the corridors more bulky, possibly helping with the problem of zigzagging corridors. it's hard to completely prevent this when using astar.
i could be stupid but for me, calling the function get_room_leads_to() on a door after generation gives me the error: Trying to return a previously freed instance.from the function "func get_room_at_pos(grid_pos : Vector3i) -> DungeonRoom3D:" the specific line being "return quick_check if quick_check else _quick_corridors_check_dict.get(grid_pos)"
yes!! an extra-long godot tutorial from you right as dinner's ready.
When rocket scientist makes game. 💙
Finally found one solid dungeon generation plugin, I can finally make my own roguelike ! Thank you very much
9:47 the acronym you were looking for was constructive solid geometry ;)
🤣🤣
So hype! Been waiting for V2 so I can truly go crazy with it. Thanks so much!
This addon looks dope! It'd be cool if there could be multiple corridor rooms, and it could try to use longer ones when possible. Just to try to avoid a lot of repetition using the same little room many times in a row. Also maybe you could auto-detect a stairs room by just looking at corridor rooms with y > 1 with doors on multiple floors? Cheers, just brainstorming, great addon!
The corridor idea is an interesting one, definitely could do that. Maybe for a future update if people end up liking this a lot. I think even in this update, it's technically possible, like you could do that with code on some post generate hooks and change the corridor appearance after the voxel grid is set and it's done generating. The stairs one, the reason I chose explicitly setting stairs is because I think it's more clear, and gives more control. I actually had it like that at the start, auto detect stair rooms. But by having an is_stairs check, I think it's just good to have it more clear and lets you control what rooms are used in the stairs stage, which are placed a bit differently than in the place rooms stage. Thanks for your comment glad you enjoyed :)
Amazing tutorial and tool. Great work!
Great work, I really enjoyed playing around with simple dungeons!
Another banger from Majikayo
Would love to see door "types" for transitional rooms between themes or areas of the dungeon. So you could have 2 different styles of corridors that only connect to a specific type of door. You could then have a room that has both door types that could allow for controlled branching in the dungeon.
i'm actually trying to do that rn lol.
i manage to make the code, but i broke the "align with grid" in the process for some reasons :/
v dope my guy 👾
absolute saint
how would you go about placing interactable doors between rooms? again great work
Great tutorial! Looking forward to check it out..I would be very interested in a basic tutorial of how to implement a BSP algorithm. Like what structures to represent the tree, the leaves, why..How to implement the recursivity and so on..In GD script.I am struggling with it, being unable to implement a relatively simple to understand algorithm..Even in 2D would be enough, to understand and build upon it. Thank you for your videos!
Please show us how to make a hook / Grappling gun
Does this work without the use of corridors? Like could I just define a few rooms and have the dungeon be stitched together room-to-room?
Hello ! how do you flight at 18:40 ? is it special control you implemented for the tutorial ?
The tutorial fps controller has no clip bound to V
@@MajikayoGames ye i found it when using your dungeon exemple, thanks !
Would there be a way to generate corridors using rooms larger than 1x1? My game uses fixed cameras, and the 1x1 rooms dont work well with that, as you can imagine. Being able to instead mark 3-4 different 'corridor' rooms of different sizes would be helpful. I'm not sure how to achieve it without overhauling source code. Either way, thanks for this vid.
Closest we have at the moment is just to swap in a different model for the 1x1x1 corridor after generation. Also to play with astar settings to try to make the corridors more wide and straight, heuristic scale 3 and corridor cost 1 would maybe be some ones to try. Main problem/
difficulty with this idea of different corridor sizes, is it's not super clear how that would even work. I mean it's not well defined, currently we have astar which pathfinds/tunnels to/from rooms. You can mess with the shape of the hallways a bit, but because it is procedural, I don't see how we even define some alternating corridor shapes like that. I'm sure it's possible but I really don't see a clear idea of how one would do that or even define what it means. Hope this helps.
I can’t get the script for removing unused doors to work, not sure what I am doing wrong
I replaced the `$".."` in the script with `owner` and it worked. Add @tool for it to remove them in editor
so like 4 main things could be added to really turn this into a fully fledged system (not that it isnt one already, but rather one that can be used in a more controlled manner beyond random placement of connections. this is based off something i had done in unity years ago for a test project).
Now u may have these already in there as i am only testing it out briefly so dont mind me if its already included. I just think these are by far the most important things to have in this type of setup and if u have it that is even more awesome to be thinking on the same page.
>> Door Groups
This is basically giving a door a key (like a unique number) and only other doors that have that "key" can connect to this (including corridors if need be, though ideally u would want keyed doors to always connect to another keyed door before pathing starts). This provides a huge addition by allowing doors of different sizes as well as controlled pathing. So u could have large hallways and entrances into other rooms as well as a more controlled this room can only connect to these other rooms. Obviously if a user makes a key they must provide wall/corridor/stair with that key as well so the pathing can work properly (that way custom subsections dont need to use default setups)
>>Mandatory Connections
This is in extension to having a "keyed" door but u can say i need this door to always have something spawned to connect to it before u do pathing. This allows a very very very useful thing to happen. the first being u can generate a sub layout before u even start pathing. So if u have your own setup of nodes for a specific "section" u can better utilize them or if u just require mandatory connected random rooms like a random treasure room connected after a fight. now u can extend this to have an allowed number of "tries" before failing as well.
>>Corridor/Stair types
having multiple corridor and stair options (or any other new nodes that are created due to pathing stage). this just allows for more variety and u can have a weight to each option if it will choose one version over another (this can also extend into custom sized ones as well . . . so what if u have a 2 by 3 corridor or maybe a corridor with a tall cieling).
>>Wall Variants
introduces more options as well. after all is done and u need to "patch" a door that was optional u fill it with a wall. buuuuut . . . if u can have different options for walls that means u can have things like maybe a barricaded door spawn or a portal that jumps u to a different section or something else. This would have to work with keyed doors so if a user makes a keyed door it is mandatory they provide at the minimum 1 wall for that key so it can be properly filled
All in all this is one impressive plugin and i played around with it a bit and it is very well done. If u add the above I think u would have like the ultimate generation system. The things above are very important and can allow heavy customization beyond general generation and allow u to do some impressive stuff. This has kinda made me wanna remake my original unity based generator into godot. It didnt use pathing like u had but was based purely on chance based instancing in a connection sequence vs place room and path to room. Then weights would be set to determine if i want a longer or shorter path to next "main" node and corridors would be spawned in relation to that.
How would you go about defining custom generation rules? Right now hallways are created by stacking multiple corridors but say I was looking to generate a sewage system that would alternate between placing single small corridors of size 1x1 and attaching longer hallways that are 1x4 in length, would the custom room placement function allow for such logic?
Not really a built in way to make this easy at the moment, it gets complex if you want to alternate 4 length paths in astar, would have to do some hacks to force the algorithm to do that. But you could try just placing some 1x4s in the normal rooms phase and it will connect them. You could for instance place them manually and always have it somehow that it will have 1x4s inbetween rooms where you want them, then it's likely that it will be connected as you want. You could also do something like, just spawn totally empty corridors with no models at all, and then do a final pass at the end where you iterate through all corridors place and replace them with some certain model if there is 4 connected in a line.
@@MajikayoGames Bummer to see a small limitation like this but understandable, worth a shot for trying it out though, thanks for the detailed reply!
Hello, is it possible to randomize dungeon mostly from the pull of my handmade rooms and corridors? I don't really like generated things, but some randomization instead would be cool. Also since such rooms have to be with optional door class, is it possible to settle doors to specific room with a key? Sorry, if it's a dumb question.
Hey! thanks for this! I have an issue while recreating what you did during the basic setup tutorial. For some reason after enabling collision I don't have any collision on the stair of the "stair" room. every other collision are working properly.
I tried enabling the collision on the CSGPolygon3D of the stair itself but it's messing up the generation and everything turns flat or one floor is missing.
i forgot to enable mine in the tutorial, but i just tried enabling "Use Collision" on the CSGPolygon3D and it seems to work fine for me. I can't think of why that would have any effect on generation. The addon does not know anything about the collision objects within. It just places the room nodes. Only thing that comes to mind, you might have to enable "Local to scene" for resources like collision objects since the rooms just instantiated many times - but that does not apply to CSGs so I'm not sure what's going on. Any errors it's giving you?
@@MajikayoGames Nvm I couldn't reproduce it for some reason after progressing the tutorial and making some changes.
I'm pretty sure it was just the generation not working because of how I aligned some doors before. Thanks
How do you go about adding enemies and npcs throughout the rooms in the dungeon? I have been having trouble with making them move towards the player, attack, etc I believe because my player is spawning in a seperate scene (the entrance room)
I think you should be able to put a navmesh in each room scene and as long as they get connected properly, enemies should be able to pathfind through the dungeon.
docs.godotengine.org/en/stable/tutorials/navigation/navigation_connecting_navmesh.html
hello again ! "get room leads to" return a null or not value.
But for exemple if i want to change the type of door depending on the room it connect too, how would i call a specific room type to see if it's connected or not ? (for exemple, specifically looking if the connection is to a corridor or to a room ?)
Also, trying to add a script to corridor (like you did to the living room at 34:39) seems to breack the whole "door detection" . because removing assets by using ".get_room_leads_to() == corridor" doesn't work in the node you used at 32:18
Can I ask you how to properly install this to my own project? When following the GitHub instructions and adding to addons folder it will have lots of compiling errors and when trying to open the scene it will be missing dependencies
Just tested it, I'm not getting any errors importing it. Did you make sure to enable it in the project settings plugins and maybe try restarting Godot after? What scene is giving you compiling errors?
@@MajikayoGames So I’m not home right now but what happens is I will drag the simple dungeons folder within the addons folder to a new addons folder I made for my project, when I do that it imports but will pop up with like 5 compiling errors, I can enable the plugin but it won’t do anything. Opening the demo project you made works perfectly, but only when adding to my project it fails. Can you give me a run down on exactly how you did it ?
@@MajikayoGames When I get home I will tell you the exact errors I’m seeing
@@NubsHai The github repo has addons/SimpleDungeons folder. You need to drag the addons/SimpleDungeons folder, to your own addons/ folder. So your project looks like mine with addons/SimpleDungeons. Not the whole repo if you were doing that. If you tell me what the errors are I can try to help.
@@MajikayoGames I just succesfully imported it to my project, I cant seem to recreate the error I was having im not sure I was super tired and probably did something wrong last night lol
Is there an easy way to have the dungeon generate less densely?
is there anyway to use it for 2d roguelike dungeons games?
currently no it just works for 3d. ive thought about adding 2d but moving on to other things than this addon after doing a bunch of work on it.
u can make tutorial procedural infinite terrain 3d generation in godot ? please
Is there a way to not generate diagonal corridors?
i actually just added a heuristic_scale option to DungeonGenerator3D because of this comment. previously i thought euclidean helped with that but upon looking it up it doesn't seem to. you can try increasing heuristic scale to 3 with manhattan or euclidean modes, and also try messing with the corridor cost option, raising this (probably just to 1) can make the corridors more bulky, possibly helping with the problem of zigzagging corridors. it's hard to completely prevent this when using astar.
@@MajikayoGames You are the best, thx!
i could be stupid but for me, calling the function get_room_leads_to() on a door after generation gives me the error: Trying to return a previously freed instance.from the function "func get_room_at_pos(grid_pos : Vector3i) -> DungeonRoom3D:" the specific line being "return quick_check if quick_check else _quick_corridors_check_dict.get(grid_pos)"
You know what they say, early worm gets the bird🦜🐛