Procedural LEVEL GENERATION in Unity with Dungeon Architect!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys justin here with the realtimeessentials.com back with another unity asset tutorial for you so in today's video we're going to check out the asset dungeon architect which allows you to really quickly create procedural levels inside of unity so i will link to dungeon architect in the notes down below note that this is also a part of the fill your toolbox sale for unity which i will also link to down below meaning you can get this and a number of other assets at a significantly discounted rate in this case this one's going to be in the third tier the 45 or up tier so if you do want to get that you can do that by picking the 45 option and you can see how it's contained right in here if you see this after the sale is over this is still an excellent asset so it's definitely worth picking up but if you do see it in the sale this could be a great time to jump on that now let's go ahead and just jump into it all right so to enable this asset you just want to make sure you go into your package manager select the option for dungeon architect and click on the button for download and then once it's downloaded you're going to want to click on the button for install that'll pop up a little window over here where you can install all the scripts for this and you just want to click on ok or yes or whatever the button says that allows you to enable this inside of unity and so what that's going to do is that's going to add a number of different folders down here so you're going to get the dungeon architect folder as well as folders for the launch pad and samples all this stuff is stuff that you're going to be able to use in order to build different levels and usually where i recommend that you start with this one is if you go to the dungeon architect website right here there's an option right here for documentation or docs if you click on this this has kind of a start to finish documentation that'll show you exactly how this whole thing works and so usually you're going to want to start with the get started function right here and so to start off what we want to do is we just want to create a quick dungeon so you can do that by coming down to the dungeon architect folder right here and you want to specifically go in the option for prefabs so you want to click on prefabs right here that's going to give you a number of different prefabs in here that you can use inside of your scene and so within prefabs we just want to find the option for dungeon grid and we just want to drag that up into our scene right here so what that's going to do is that's going to drag the script in that you can use in order to build your dungeons but right now it's missing something what we need to do is we need to start by selecting a theme and so inside of the samples folder so there's a couple different themes that you can use there's the demo theme candy the demo theme outdoor clips and the demo theme simple shapes and what we want to do is we want to go inside of the themes folder right here and we want to select one of these options and in this case we're just going to pick the first one which is just the candy dungeon theme so all you have to do is just drag this into the theme right here so now this has the theme in here that you can use in order to build your dungeon and then from there you can just click on the button for build dungeon in order to create your first dungeon and so notice what this does is this comes in here and this randomly generates a level inside of unity so you can see how this creates all these walls it's got little furniture pieces in here other things like that so it's a very simple dungeon right now but you can see how it's procedurally adding these little furniture pieces and other things like that and so let's say you didn't like the look of this particular dungeon well remember this is a procedural system designed in order to create dungeons randomly so all you have to do is just adjust the seed right here you can either type a value in or you can click on the button right here to select a random number then you can click on the button for build dungeon again and what that's going to do is that's going to rebuild your dungeon with a different random layout based on the seed that you select in here so you can do this as many times as you want just by randomizing and clicking on the build dungeon function and this will randomly create those dungeons for you notice how if you want this to be larger you can adjust the number of cells that are contained in here so if you want a bigger level you could just uh take the number of cells from 100 to 150 and then click on build dungeon well notice how this dungeon is now going to be bigger if we do this again right so if we type in a value of 200 and then click on build dungeon it's going to be even bigger so you can use this in order to quickly generate these levels with the size that you want inside of unity and so if you just want to get rid of your dungeon completely what you can do is you can come in here under build dungeon and you can click on the button for destroy dungeon instead notice how that's going to get rid of everything that's in the scene and so we probably want to do that because if you notice what this does is this generates all of that stuff just as a bunch of different items right here right so it's got a ton of different items over here and it's not very organized so what we can do is we can destroy the dungeon and then we can right click and we can create an empty and we're just going to call this dungeon we're going to come in here and we're going to reset the transform so this is at 0 0 0 but then what you can do is when you're working on your dungeon crit your dungeon grid you can scroll down to the pool dungeon scene provider script notice how there's an option here for the item parent well you can just drag the dungeon item into the item parent right here and then click on the button for build dungeon one other thing you want to do is for your dungeon that you're creating you do want to make sure that you've checked the box for static over here but then if we click on build dungeon notice how it's going to build that dungeon again but this time all of that stuff is going to be built inside of the dungeon object right here so we're much more organized all right so there's also a tool in here that allows you to create your own themes so basically the way that this works is it allows you to plug in the different prefabs that you have in here and it'll randomly place them inside your scene and so there's definitely some logic to this and we can get into this in a future video if it's something that you guys are interested in but know how this is basically just uh what it does is it uses setting everything up on a grid in order to allow you to create things like custom ground and adding things like walls and other things like that in order to quickly create these scenes so there's a little bit of math and stuff involved it's nothing too advanced but just be aware that there is the tool in here where you can create your own prefabs and the documentation in here is excellent for it so we can get into this in a future video if you're interested leave a comment down below all right so in addition to being able to do all of this manually there's also an option up here under dungeon architect for the launchpad and so what the launchpad is going to do is that's going to give you access to all of the different templates that are in here so not only can you create the one kind of grid that i've already showed you there's other kinds of grids and scenes that you can create as well there's a bunch of different options in here so everything from using the grid flow builder which is going to be something that's going to allow you to basically create like where the different bosses are and how the flow of the levels goes there's multiple different ways to build that as well as just a bunch of different options in here so you've got options for your sample files which you already kind of looked at as well as we've got options for as well as options for the different kinds of flow graphs that you can use the templates that are kind of built in all right and so these external templates down below these are things that use external asset packs so like paid asset packs from the from the unity asset store so if you click on one of these like the multi-story for example it's going to give you an option to view this online and what that's going to do is that's going to take you into the documentation file it's going to give you instructions for if you did want to purchase those exterior assets and bring them in so if you were to download this pack from the asset store all you would have to do is just follow the instructions right here in order to use that in your own theme in order to randomly create levels or dungeons using those assets and so a number of these scenes are built in so if we go down and look at like let's pick let's pick one of the builders instead of one of the themes let's say we wanted the simple city well you could click on the simple city go into the scenes and then for simple city scene you could just open it like this and you can see how this already has a city built in but you could click on the dungeon simple city and adjust the seed for example so maybe to like 150 and then click on the build dungeon function and that's going to randomly change your city just like this so you've got like all these different options in here for different things that you can do also there's a couple of example game files down here as well which also incorporate these so there's a 2d and a 3d survival shooter game game where if you go into the scenes and let's say for example that we were to pick the city shooter right here and double click on it notice how that has a first person controller in here but then if you're to click on the play button that's going to generate your level when you click on play and so this is going to be an actual game contained inside of unity so you can see exactly how they've built this out using the layout generation and notice how there's an option in the upper right hand corner that says space equals new map so if you hit the space key that's basically going to generate a new map directly inside of your game like this so this is a great sample of how they would integrate this into a game so you can see exactly how they've done that as well so that's dungeon architect in a nutshell i will link to the download the notes down below as well as the sale which is on for a few more days so if this is something you're interested in you should go check that out but i'd love to hear from you what other dungeon architect tutorials would you like to see on this channel just love having that conversation with you guys if you're new around here remember to click that subscribe button for new unity content every week as always thank you so much for taking the time to watch this i really appreciate it and i will catch you in the next video thanks guys
Info
Channel: The RealTime Essentials
Views: 824
Rating: undefined out of 5
Keywords: unity, unity software, unity 3d, unity 2020, unity 2021, unity automatic levels, unity automatic maps, unity dungeon architect, dungeon architect tutorial, unity dungeon creator, unity level creator, unity creating levels
Id: 0avuM7BgiUY
Channel Id: undefined
Length: 10min 31sec (631 seconds)
Published: Mon Oct 25 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.