Build a Procedurally Generated Open World with Voxel Plugin and Unreal Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everybody today i thought we'd start a little tutorial i'd just like to maybe put a little video there sharing what i have learned about how to create a voxel generated procedurally generated world um everything you're looking at right now is procedurally generated from the uh from the grass to the trees to the well not the ocean to the landscape everything is procedurally generated using the voxel voxel uh pro i have the pro version of course there is a free version as well um and so yeah i thought i had i struggled a lot in figuring how to get the my voxel uh you know world going it's been about a month here and i'm starting to get there uh you know it's nowhere near finished yet but as you can see there is trees there is multi multiple layers of of of terrain for example we have this beach layer down here we have a bit of a wet sand layer down there as we travel up you can see that the land train sort of changes we've got slopes and as we continue to climb up more actually i haven't really done much materialing up here but there will be the the option to set up snow snow caps and other such things is certainly there um right now the landscape as it is is entirely consisting of islands and oceans and all those sorts of things so i thought what i would do is let you know which systems i use to create what you see here so that if this is something that you're trying to create yourself you would have a well a little bit more guidance that i than i had when i was figuring all of this out so bear with me because i'm recounting and recalling some of the things i've just recently learned over the last month so i might be a little bit uh a little bit stuttery here and there but i'll do my best yeah everything you can see though like i say uh the uh as you can see up here right now the tasks are generating uh there is some trees and grass and everything like that to be spawned in and this is due to the way that the voxel is generating uh mesh basically landscape trees and tray and all that sort of stuff so it does take a little bit of time but there are ways to do this faster i just haven't set that up on my voxel world yet but yeah as you can see it's pretty cool everything like i say procedurally generated and um and as you know it's neat as you go exploring around your voxel world your procedural world you don't even know what you're going to encounter you know it's kind of like playing the game for your first time as a game developer anyway so let's let's get into this let's uh get into how to get started to get started you will of course need to install the voxel plugin i'm going to assume that you're not a complete noob and you'll be able to figure out how to you know do something like install the voxel plugin i'm not going to talk about those sorts of things because those are the things there's information out there on how to do them and i don't want to hold your hand too much because this video could take you know five times longer if that's the case so we're just going to kind of assume that you have at least a uh decent enough ability with unreal that you know how to use the editor to a degree you know if if you know i can figure it out i'm a complete noob i'm pretty sure you're going to be able to figure it out too um with uh with the instructions we're going to go through so let's kick things off okay so what i would like to do here is start out by creating a new voxel uh nuvox level and uh pretty sure pretty sure what we need to do here then this legacy i'm gonna be a little bit rusty uh what we need to do is create a new voxel uh world here we go voxel world okay so hang on one sec just gonna pause my recording save everything up and get started maybe in a new new window okay so first things first let's create a new level uh let's call this the tutorial level you can call it whatever you want you can call it eden you can call it whatever you want so now we have a new empty level uh first thing you're probably going to want to do and like i said i'm going to talk to you about what i use to create this world and the systems i use the first thing you're going to need is a plug-in called ultra dynamic sky now this is going to be your easiest way to create beautiful sky just like fantastic weather and sky um uh so let's you can grab that in the market place if you don't have it yet i think it's like 29 bucks it's super reasonable it no it's it's cheap for what it is it is an absolute steal for what it is so once you have ultra dynamic sky you you know you can just kind of start to type in ultra and you'll see the blueprints for ultra dynamic sky and ultra dynamic weather pop-up we'll start by dropping an alternate dynamic sky and wow we have sky we have lighting we have everything set up automatically just like that how great is that let's drop in some weather okay now we have some weather that's sweet but you know what let's actually change this to partly cloudy yeah it's not a rainy day today this is happy day we're learning how to create a create a whole world uh next up what you'll want to do is uh find your voxel voxel world from your from your uh from your whatever this browser is called i don't know find your volunteer world foxworld and also drop that in i'm gonna go ahead and set my voxel location just to zero zero zero just to get it to flat you know get it to uh ground level um and now you'll see something like this okay so the first thing that you're going to want to do excuse me when i pause this video and figure out what the first thing you're going to want to do is because i kind of forget hang on okay right uh the first thing you're going to do right click somewhere in your content browser look for voxel and a voxel graph is what we are going to need is it a voxel graph i think it's a voxel graph um new voxel graph generator okay so under your voxel world uh you will see as you scroll down a section to input your voxel graph maybe i scroll past it i think i might have voxel voxel general will save voxel preview where the heck is it um [Music] materials no spawners no physics no hang on i'm gonna find it so you guys don't have to watch me scroll around okay here it is right under voxel general you need to switch class to object and when you switch class to object then you will see a little section here that we can pop our voxel graph into gonna go ahead and do that it won't look like much yet that's okay because what we will do next is uh open up our voxel graph it will look something like this not too exciting do you guys see that i don't know i don't think hang on was obs capturing that no it's not okay there we go that should be good um so now we've got our voxel uh graph open uh here's what it's going to look like all right so i'm just going to go ahead and pause the video here uh you can ignore this part you don't need that part i'm just trying to figure out about biomes right now so ignore that part um let me just zoom in a little bit for you there we go this is what you need okay so number one we can take an x and a y very easy just hold down x hold down y pop in your x and your y uh the 2d iq noise right 2d iq noise let's grab one of those let's just grab all of these let's grab a get slope from derivatives you don't really need to know what the hell all this stuff means yet uh frequency let's do that we'll get a frequency frequency frequency actually no that's not a that's not a thing that's a that's uh what the hell is that again that is a float parameter okay float parameter grab a float parameter we can just call this frequency um you can go ahead set an initial value of that to i've got it to zero zero zero point zero zero zero seven five uh you can you'll see what this does in a minute so go ahead and just punch that in um let's see we've got uh we can go ahead and plug the x into the x we can plug the y into the y why why not because that's where it goes frequency can plug into frequency as such and of course seed can actually just stay the same it is the seed will generate a different variation of your landscape you probably already know about seeds from playing other games like valheim and other stuff like that um so now we're just going to subtract as it as it is as it shows here slip subtract from one thing and another what was it again value from get slope derivatives and then d and x and y um i think we need to split that yes we do split that as such the dx gets the dx and the d y gets the d y is that right i think so and then the dz gets zero apparently i can't remember i followed a tutorial for how to do this so yeah uh uh anyway we're going to now multiply here multiply float by float plug that in as such and we've got a multiplier here which is another what was it called again um float parameter right float parameter so we'll take that type in multiplier uh default i run out default i've got mine set to 300 here and set that to 300 and right so just plug that in as such and uh you know this is a what the hell is this uh uh this is a local variable create local variable i'm going to call this land uh i'm going to plug that into here and let's see what else do we do right we also need to do a couple other things so we have the start node up here which is always just there um and we have the z and land and then we have a subtract so we'll take that we'll do z and we'll do we'll actually have to get our land this time get land no sorry not like that land local variables i'm pretty sure yeah so now we're going to use the land so here we're setting it and here we're here we're using it um so we're just going to subtract vote by float and now that goes to hijab that goes to yaw and where are we start and then set value okay set value uh last but not least value goes into the value and okay so that's going to generate a a landscape basically don't ask me how these things all work exactly because i don't know clearly but i know they do and you can tweak it and i'll show you a little bit about what i know you can figure out how to tweak it later so basically come back to your voxel world hit ctrl f5 to refresh your landscape i'm actually under the ground a little bit but as you can see we have a landscape now if this is your first time generating a voxel landscape terrain this is probably got to feel pretty cool because now you have a landscape it's all generated it's super sweet i know i was pretty stoked from that when i first did that um okay so a few things that i know and a lot of things that i don't number one if you want to adjust some of the characteristics of your landscape there are lots of ways to do this like i say that i don't know in some ways that i do for example the setting the frequency to something else will dramatically change what your landscape looks like let's go to 175 hit ctrl f5 and as you can see we have much sharper peaks now all right so if we go uh to let's say a dot one five or i think i need one more zero 1.15 go ahead and click controller five now we have very very smooth ground okay so interesting right so you can kind of play around with those settings like i said there are other settings that i do not fully understand and uh you'll have to play around with some other stuff and research how to specifically get some of the other things the way you want them because i don't entirely know i just kind of know the the basics on how to get this kind of going so um could you guys even see what i was doing no that's because my obs is uh is uh okay what i was doing is i was changing the frequency right here right to like .25 or 0.75 or whatever and that was changing the landscape as you could see uh sorry about that that's because yeah obs is just recording the unreal window and not the open tab so i'm going to remember not to do that again um okay so we have our landscape great that was pretty easy uh i tried unreal 4.26 water it does work but it's a little bit quirky um let's let's put drop it in here and then i'll actually show you wait what was it water water body ocean if we drag that in um yeah i just found it quirky i don't know it it can work but i found it quirky um i don't know if it works that well i'm gonna set this to all zeros i don't know maybe yeah unreal water not too oh you know why it's because i don't have a land anyway it's quirky it's quirky with with uh it does work i got it working but it's a little bit quirky i'm going to show you what i use instead i use the oceanology plug-in um it is a more expensive plug-in but it is pretty sweet um it's about 150 for this plug-in it works very well with your voxel world so i'm just gonna put this at sea level zero i'm going to i think make it bigger now that's probably going to be big enough but as you can see we now have um we now have uh what do we have we have an ocean that's what we have perfect beautiful that's looking pretty cool already like i say oceanology plug-in there are probably other water plane plug-ins that you could use if you don't want to spring for the for the oceanology plug-in but i dare say man this is a gorgeous plug-in with uh you know volumetric water [Music] what is it post-processing etc etc now this is kind of a little bit quirky because we do actually have a water level of zero which is where we see a little bit of a wave so you may need want to you know play around with your with your height map a bit and try to find something that works for you let's regenerate that i don't know still a little bit quirky but yeah like i say that's going to be a matter of tweaking which you're not going to be doing here in this tutorial because that could just take hours and days and who knows how long um okay so probably one of the things you'll want to be doing next is actually creating a landscape material an auto landscape material hang on a sec be right back okay so as memory serves what you're going to want to do is right click and look for voxel and look for voxel landscape material collection man oh man i tell you this took me days if not weeks to figure out what is gonna what i'm gonna show you in like the next 60 seconds voxel landscape material collection okay so scroll down until you find uh i believe we'll want a multi-index so we're looking at the voxel world and we'll one day multi-index and then we can uh select our voxproxy landscape material and punch that right in as such won't look like much yet that's okay because now we'll just open up our voxel landscape and here we're going to put in our auto landscape material now i use one which is not quite yet released on the market or maybe it is i don't know i'll put it in the description of the video below if it is but i dare say this will work with a variety of landscape materials actually you know there is one that is already released on the market um [Music] and it is let's see auto landscape material i believe landscape material auto landscape material yeah okay so this one well you know there's a lot of auto scan landscape materials on the unreal marketplace so you can kind of find the one that works for you um that's fine so here's my auto landscape material nice thing about this is it will generate things like cliffs on sharper angles and you can do like a beach layer and stuff like that [Music] auto landscape material i forget what this was called i think it might have just been called auto landscape material and i do use another one now that i really really like um a friend of mine developed it and happily let me beta test it and if it is ready yet i'm going to link that i'll show you how that is as well but for now let's just select our auto landscape material boom and we'll plug that in like that ta-da and i'm just going to go ahead and save and i'm going to click refresh over here ctrl f5 and my computer's going to freeze a little bit there we go and now we have something something which resembles something now what you may notice is that you have one of your materials from your auto landscape material this took me forever to fix basically it it's this what you need to do set your autoland auto material so we're back in the in the landscape material collection here and you can see if i open this up my auto material is currently zero so i'm actually going to go and i'm going to look at the current 0 and i'm going to change that to 14 and i'm going to change this to 0 and this this is the thing that fixes it so now if i refresh my landscape actually the shaders are compiling so i think it's refreshing on its own it should now now we have a beautiful landscape with uh with height level and stuff like that and all that really really good stuff so yeah this particular auto landscape material has lots of features and different ones have different features of course and if you're new to actually creating an auto landscape material look look into them because there are some great assets on the marketplace actually this is the this is not the instance i wanted the instance um let's do that one oops nope that was wrong grab the instance yeah okay well as you can see with my current instance i've already done a little bit like set the beach height level and some some stuff like that and the auto material like i say always needs to be zero and then the other things i don't think it matters where they go but yeah with with this auto landscape material for example i can do different things neato things and if like i say you're just getting into auto landscape materials they have all sorts of different features depending on which one you're using but this one for example can that lets me specify for example the the beach layer height and the smoothing between like the beach layer and other things such as as that and the snowy mountain layer and all these different things so you can basically use this auto landscape material to specify the heights of of your landscape and the different the different trains that you want to want to use so i'm actually going to go ahead and punch in my my other landscape material here because i kind of want to showcase it because there's a friend of mine who developed it and he did a hell of a job creating it i'm not sure what he's calling it yet but if it's in the marketplace i will link it so i'm just going to punch that in here really quick be right back okay we're back and yeah like i say if this is available in the marketplace check it out it's it's super sweet it's just got like a ton of great features you can actually set multiple height layer clips so for example the beach height layer would have sort of different different cliff cliff textures and as you go up i have not done this justice one bit because i'm just screwing around but as you can see as we get up a little bit higher the cliff and this is not looking great but you know i haven't chosen the right stuff here but you can you can kind of choose what you want for the cliffs and for the slopes at each different biome level so there's a five biome levels i believe four biome levels custom and one let water level biome so you can kind of build all the way up to snowy cat mountains which i have not done yet but uh yeah this auto landscape material is super sweet and if it's available yet oops i guess i did this again if it's available yet i definitely recommend checking it out but uh yeah we're not going to talk too much about landscaping other than auto materials are the way to go let's get into putting some uh trees and plants and rocks and other cool things into our voxel world okay so what we're going to want to do is a right click and go to voxel and we're going to look for a voxel mesh spawner or boxima spawner group now i prefer the group because you can put multiple things into the group so for example you might put a grass group so actually that's what i'm going to do i'm going to do grass a good place to start and you can put multiple types of grass into your grass group and then you might have your trees group or your rocks group or your flowers group which is kind of what i've done it's a nice way to organize it so open up your your group and what you're going to want to do is now browse to where you have your uh your your mesh your your grass your what your whatever it is you're you're putting in in this case we're putting in some grass let me just find where the heck i put my grass i'll be right back okay this is where i put my grass i've got a few different variants here um and what you can start out by doing i'm going to quickly drop down and save sometimes this crashes uh though if you drag a bunch of elements into your array at once sometimes it crashes so you might be safe for just doing one at a time so this is where we add the different meshes for in this case our grass group right so i'm going to grab what am i going to grab let's grab doesn't really matter this is a demonstration i'll grab this one and i'll grab a few other ones grab that one just put that in saw but they grab that one oops nope that's not what we're doing right here and then we'll grab this one right yeah okay uh now we're going to get to some of this other stuff in a moment but let's start with um actually hang on a sec we need one more thing we need a voxel spawner config i forgot about that so let's just go ahead and save our voxel mesh spawner and we need also to right click and create a new voxel spawner config okay and that can also be put into our voxel world spawners section right down here so we'll just put in our spawner config right there okay so let's open up our spawner config also so we have our grass and we have our spawner config in our spawner config now we have our grass mesh group right so in our spawner config um here's our grass voxel mesh spawner group so we can go ahead and just click that and put that right into our right into our uh what am i oh wait what's going on here what am i doing uh okay right actually goes right in here my bad oops uh so hang on hang on i think i forgot something i'll bring it back no no wait a minute no i think i got this okay so uh we've added an element under spawners we go ahead and click on our spawner group and we just put our spawner group right in here we're going to choose the ray type of casting now this is what i was talking about before the height type of casting is much much faster from what i understand but i haven't figured out how to use it i've figured out how to make ray casting work really well but height i haven't figured that out yet so we're not going to do we're not going to do height we're going to do ray casting what ray casting basically dies look at that they're already there isn't that cool uh what ray casting basically does is it shoots a beam of light no it shoots a ray down to your ground and when it collides with your surface it drops a mesh so we've got a grass here isn't that great yeah that's pretty cool all right um so okay now we want to do a few things so right now as you can see we've got like a little square chunk like this it doesn't go any further than that but let's say we want it to go further uh we can do that we can do that by changing uh the size of the group here you can go 32 64 128 256 kind of locks you into those numbers so go ahead and change that to 128 and then refresh and as you can see now i've got like a 128 chunk size whatever that is measurement i don't really know but it's more and there you go there's all the grass you know you can use this for tweaking basically performance as you can see right now however our grass is doing a few things we don't want it to do number one it's going under the water grass doesn't usually grow under the water unless it's sea grass and this is not sea grass this is land grass so let's fix that okay so head back into our grass uh voxel mesh spawner group um and then we're gonna do a few things let's start by setting the let's setting settings setting uh video where are we looking here the height basically oh yeah here we go height restriction and height restriction fall off those are both good things so number one we know that our our our uh our water level is height zero right so that's where our ocean is so let's set this that uh grass will only spawn between height five and let's say height let's say height thirty okay so i'm going to save you and show you what that did now you can see and you'll just have to kind of randomly guess at what your values are you'll kind of learn what the numbers how far they actually are as you kind of guess around a bit but as you can see now the grass starts at height 5 which is roughly right around here and it goes up to height 30 which stops right there so this is how you kind of control your layers of vegetation now another thing i can see here is this grass is kind of spawned in punchy punchy no spawned in clumpy punches punchy clumpets clumpets it spawned in clumpy i'm not sure what i'm trying to say but let's get the grass spinning a little bit closer together right now so that is controlled by the distance between distance between instance and voxels so i'm going to change that to five and when i do that as you can see the grass is now spawning much closer together that's really cool let's you know you'll just have to tweak this a little bit figure out what works for you i'm going to try maybe three all right so now we have some fairly closely spawning together glass i don't want might go a little bit closer maybe two all right very cool whoa that's pretty close um i can i can feel a hit in my performance already but you know that's okay now a hidden performance on grass is probably one that you might want to pull back a little bit from that spawning distance i don't know maybe 64. work a little bit better i do not know the difference between these two things i just match them up and it seems to kind of work anybody knows let me know in the comments because i don't know like i say i've been doing this for a month i've learned some things but not a lot of things i know i know less than i do i there's more i don't know than that i do know or something like that um yeah actually that's still a little bit hard on my video card so i'm just going to back that down to 32 yeah like i said you can control performance by spacing by a few other things okay so now let's say that for example we don't want the grass to spawn at every different slope like for example let's say we don't want the grass growing on that particular slope let me actually just punch that back down to two we can specify what the slope angle can restrictions are so let's say if it's between zero and five degrees you can see the grass only grows on slope angles that are zero to five degrees right so you can kind of control the way your vegetation grows a bit more of a natural way let's go between 0 and 25 and oops did i not save that what did i not do oh i didn't do a thing i didn't do a thing at all that's um where was i 0 to 25 okay okay so now you can see the grass kind of grows on the ground but it doesn't necessarily grow on the cliffs which is kind of good okay all right where are we let's look at a few more configurations height restriction falloff is nice because right right now as you can see our grass grows super straight along a very unnatural looking edge but let's say we want to sort of taper that a bit that's what our height restriction falloff is for so i'm going to change that to maybe three and as you can see now the grass kind of well it tapers off a bit it starts starts slowing down and kind of creates a little bit more of a natural look again you're going to need to tweak this and play with it and do other things like that sometimes you may encounter issues where your grass is not touching the ground for example i think we have yeah we have a bit of an issue like that here almost undetectable but in some cases it might be more severe that's okay what you can do is actually head back into your uh group and you can actually set the global position offset set to something like maybe minus five you do that stuff comes down a bit you saw it jump down just a bit i'm going to do try maybe minus -15 all right so now that's down a bit kind of goes through the terrain and as you can see most of our grass is now correctly connected to the ground another thing that i do for performance sometimes is uh potentially scale the grass up and you can change the scale of your grass say for example to size three this is how big my grass is going to be you can also do other things like non-uniform scaling so like scale the x and the y separately in you know different ways free or lock xy i'm just going to do uniform scaling here so this basically says the graph should be anywhere between two to three times its normal size this you know would be two to four times its normal size so as i look back you can see the grass is now randomly generated between two and four times its normal size and so a kind of a trick that i've been doing a little bit is to generate bigger grass spread out further apart and you kind of get a similar looking grass effect but now you're using half as many messes uh hang on be right back so yeah now you're using half as many meshes but getting a very similar looking effect so you can tweak that around to your heart's content whatever you figure looks good a line to world up align to surface up now this determines the rotation of your grass right now it goes up straight up depending no regardless of what surface it's on i tend to kind of like align to a surface now depending on the surface the grass is on it'll kind of grow up straight from its own surface which can often look more natural sometimes not but it'll depend on the particular mesh that you're that you're doing um what else have we got um some sort of height settings you can probably kind of figure that out this has to do with how far the grass is generated don't understand this too well yet but setting these values up more i'm pretty sure increases how far the grass is generated but you also have to configure uh this bit somehow i'm not sure i don't fully understand the settings on that so i'm not gonna talk about what i don't really understand too much just a little bit um collision presets uh what you want the collisions for your objects to be if they do not yet have a collision uh setting in them and some of the for example um what were they called the uh bridge the what was it called bridge mega scans bridge stuff doesn't always have a collision set in it by default so you'll just need to go inside a collision in some of your meshes if you want there to be a collision and then once there is a collision then your block all should you know block all or whatever collision settings you want lifespan i haven't played around with that too much so i'm not going to talk about that but that's basically the gist of oh excuse me last but not least random yaw basically just adds some variation excuse me to the rotation so this could be anywhere from 0 to 6 degrees variance in in pitch angles so if you don't want any variance in your randomness of rotation you can just put that to zero okay um you want to drop in some trees you probably get the gist of this now but let's drop in some trees just for fun easiest way to do this i that i tend to like to do is just duplicate an existing mesh group i'll call this one trees actually this kind of brings me to a good point if you haven't got trees in your world yet i highly recommend checking out a program called speed tree it's great you can just they you know it costs a bit of money to buy the trees although they do have some free presets that you can just use i guess but speed tree is great it does really nice and fairly well optimized trees so i'm gonna grab a couple of trees and just drop those into my new tree tree group wherever that is wherever i put that where the hell i put that oh yeah right content browsers all right so i got my trees i'm gonna put in a few trees um [Music] one tree and find another tree let's grab another tree uh let's grab one of these beech trees sure why not i have one of those beech trees actually probably good to go through another thing and i'll show you some some other stuff as we do that you may come up against and have questions about maybe not maybe this is all pretty obvious and starting to come together now but uh let's put in some bushes too sure all right so now i have my my trees and what you'll of course need to do is open your voxel spawner group and add a new element in there this is going to be your trees voxel mesh spawner group and like i said there's probably a few things like that in particular how to add another group in well this is how go ahead and put my trees in there click save and now whoa dude i'm in the trees oh you know what these trees are so close together right now because they're much bigger right so the bigger the object the further apart typically they need to be i'm going to set that to 50 so we can just kind of see where we're at and we are still extremely heavy on trees i think yep extremely heavy on trees um i don't know let's change that to 150 see where that gets us oh we're super light on trees where'd all the trees go uh i don't know let's put that back to 100. i'm not sure maybe it didn't load load oh now we got lots of trees again um so we got some trees populating right here well theoretically i'm getting some weird weirdness going on with these trees uh i'm not sure what's going on you know what i'm gonna do maybe here's here's what's going on i think i think i have the distance of these way too close because they're big so i'm going to set those to be much further further further generated back so now we should start getting whoa tons of trees there we go i'm gonna spread those about i wanna spread those out a bit maybe 200 and there we go so that's reasonable i have a reasonable amount of trees um i might want them to start up a little bit higher maybe something like i don't know let's put them at eight eight to eight to fifty eight to fifty there you go so yeah you can do this with rock so you can do this with flowers you can do this with all the different things you need and then you have your your trees you have your um your your ocean you have your your sky you have your weather um and you have uh your you know flowers and stones and i think that's pretty good i think we've probably learned enough for this video uh if you guys want to know any other things let me know what i can maybe uh make a video about and if i know how to do it and chances are i probably won't because like i say i'm kind of a new but if i do i'll be happy to make a video on how to do hope you guys have enjoyed today's video
Info
Channel: Werewolven
Views: 11,210
Rating: undefined out of 5
Keywords: game development, game dev diary, indie game, developer diary, indie game development, game dev log, unreal engine, Procedural, GENERATED, VOXEL, VOXEL PLUGIN, VOXEL PRO
Id: ylttfnPgmdg
Channel Id: undefined
Length: 37min 25sec (2245 seconds)
Published: Sun Aug 22 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.