How to Get Started with PCG Biomes in Unreal Engine 5.4

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Unreal Engine 5.4 is out now and with it comes PCG biomes and I'm going to show you how you can take a brand new project and actually set it up for yourself and try to explain to you the best I can of the basics of using the system now of course this is a very very complex system I'll go over how to set it up for yourself how to bring into a new project and get everything working and explain some of the important things that you should be aware of when you're creating for yourself so you know where to look and what to change for your specific set so here I am in a brand new project now we need to go into edit plugins and we can enable PCG proced cont gener framework and it's going to tell you it is in beta just click yes and then search for biome now this will give you the actual biome core which is the thing you need to run everything and it'll also give you the sample you don't need to turn on the sample to use it but I will be turning it on and using some of the things from the sample to kind of get a good base start because the way I see it if they've created some of the things for you already we might will start using it as our base and then work off there so go ahead and turn both of these on like yes through both of them and then restart your engine once your engine has been restarted go under settings and make sure you have show engine content and show plug-in content both checked on and then you can go under engine plugins here and actually get the access to the new stuff so if we scroll all the way down we can go to PCG biome sample content and then we can go to maps and here is the biome sample level now we're going to need to go here a few times so to make it easier for myself I'm going to right click on this Maps folder and I'm going to click add to favorites and all that does is add it right here under Maps so if I need to ever access it again I just click this location and gain access let's go ahead and open it up so we can just see what we're working with here is our PCG biome setup now a few notes that this is actually creating all the vegetation on this what it is not doing is creating the landscape for you originally I thought the PCG biome system both did the landscape and then everything on top of it but actually it does not paint anything for you and it hases not deform the landscape for you now you can use other things in conjunction with this to do it for you but by default it does not do it all if you're going to do for example a large terrain and you're using some kind of actual map to create the biomes you probably want to use the same kind of map to create the terrain with and then they all will line up exactly where you want it so now that we know that it's loaded in everything is working correctly I'll go ahead and create a new level and you can create an open world a basic whatever kind you want or start from one you already have this works with both World partition and it works with regular single levels so you can do it whatever one you want whatever is better it depends on your project in my case let's go create a new basic level and then I'll go ahead and just remove this ground plane we don't need it and we'll create a landscape now this is an important note this system only works with Landscapes at the moment from what I can find because it samples it so that means you cannot just take these things and place them on something like a floating island where you created through a mesh now it's possible of course to modify it it and adjust it to do whatever you want it is BCG after all and you do have access to all the nodes if you wish but by default it is currently working only with Landscapes so from here I'm going to go ahead and import a file and I'm going to use that as my base so here's the file here that I have it's only a 1K image I can go and change the height of this let's say something like eight eight seems good that seems a little more accurate to the actual landscape and with everything then set up and go ahead and import and here is my landscape now it is just a simple little here that we're going to be using and for our purposes this should do just fine I'll go ahead and save this map and then I'll also right click on my PCG folder and add it to favorites now we can have access to both of these locations really quickly so we can jump between the two so go open up the biome sample level and what I want to do is I want to grab this water plane copy it and I also want to get the material for this landscape just to have one as a base as I don't have one by default so I'll go ahead and navigate to it and then I'll reopen my project and then click back to go back to the previous one and now I can go ahead and assign this actual material to it and paste in our water plane and of course we want to position it exactly where we want something like that should be good now we have the material assigned but of course it's not doing anything so under landscape we can go under paint and just select the layer info that is already built in of course if you're doing this for yourself make sure to create your own layer info create your own material Etc in this case I'm just reusing the same information that I have from the sample as this is a good way of showing you guys how it all works and now that's all set up I can go ahead and just start painting it and this paint everything I'm painting here is not at all indicative of where things will go it is entirely separate so keep that in mind that even as I paint this it is just how I want it to look and this can of course be all driven through an auto material you don't need to do it all manually and auto material will do just fine and then you can combine that auto material with the rest so let's say this is my landscape this is what I want to use and now I want to populate it with everything that the PCG biomes has to offer so get started let's go open up our PCG sample map and there's a lot of things here that we're going to want gu start I'm going to copy these biome setups here I'm also going to grab the BP PCG biome core now to make it easy for myself I'm going to actually take select this biome core scroll down to biome core and then do cleanup so we'll just clean everything up and then I'll go ahead and just select all of this and I'm going to copy it into our new level and I'll of course explain to you how it all works and how to use it for yourself this is just a good Baseline to get everything working and test it for yourself so once in here I'll go ahead and paste it all in and then you'll see you have this volume now we need to make sure that the volume actually encompasses our level so I'll go ahead and drop it down a little bit and then there's one thing that despite you copying it from where it was does not actually get copied and that is in this biome core in the biome core actual node which is the PCG graph node is the new icon for PCG graphs it's right here if I open up parameter overwrites this cache cell size is at zero by default it is 800 in their level but when you copy it for some reason this value gets reset to zero so all I'm going to do is set this back to 800 for X Y and Z and then if I click generate you can see we have a few trees here and there but really not a lot you'd expect to have a lot more here let me go over now how everything works with the system and what everything means and how to get everything configured to what you want it to be and we'll start with this PCG biome core as this is the main thing so the first thing is the blending range which is simple when you have a lot of biomes you might want to blend between them and the range of course means how much each biome can Blends into itself keep in mind that this is all biomes so you can't have a single biome that has a very narrow blend and another biome that has a very wide blend you might want to do then something more custom and create a new biome to kind of put it in between if you want a sharper or more rough setup because you can overwrite things but by default with the map this is how it is next thing you have here is the biome texture projection so if we open this up and then open the parameter overrides this is the actual map that is being used so if we open this up you can see this is just a simple map and it has different colors here it has red green blue yellow orange with this system you have as many biomes as there are RGB values effectively now of course the bigger and more you go the more you have to set up for this but in terms of having more biomes you just create new colors and they can be any color combination and after we finish it with this section I'll show you how they're read and how they're configured to be what they are but this is the map that they're using and a note here is it is a 1K map and they have disabled M maps on this and of course it is not an srgb map but a few settings here you can tile it you can tile it how much you can change the of course the actual image of it you can use if you're using a partition you could specify where the partition starts or use the landscape as the world origin which works for everything I've tried so far but if your partition is somewhere else entirely then you might want to configure it manually and you can do so here the texture size here is 1024 * 100 this is the size you want and you can actually preview this on the map I move this down a little and come here just bypass a few of these and we'll go to this debug display biome cache if I check that on and then click generate you can see this is the actual image that we have here this is the same image as you can see right here there's the yellow there's the blue the green the red Etc now if you have something black like this that means it doesn't understand this color and I'll show you where to configure this color down the line so what do we do if we want to change this actual setup what you could do is navigate to this location and then duplicate it for yourself I'll just call this PCG biome texture projection and I'll move it to my actual PCG folder because theirs is already configured and you don't probably want to modify all of their stuff you want to make it your own so you can use theirs as a base but then just make alterations to the instances so now if I open this version up I have all the same things configured but now we can swap out this actual map and I've gone ahead and created my own map here everything around here is blue green yellow orange and red the same color scheme as the original map for convenience in this case but again you can pick any colors you'd like if you're enjoying the tutorial so far I would love to hit the like button and subscribe for more awesome tutorials like this and possibly a lot more BCG biome tutorials building off of this so I'll go ahead and just Swap this map out right here and now I can go ahead and replace this with the one in our level it takes a moment to recompute and now you can see it is now actually our map so if I turn off this biome cache you can see it is now configured kind of for where we want our map to be as you can see this color here isn't matching the orange didn't originally match and still not matching now so before I continue on with this let's fix this and I'll explain how that is configured and that's to do with the biome setups that we actually copied over from the previous one so if I select one of these it has a few files here it has the definition the assets and the runtime assets I haven't gone in depth yet on the runtime aspect of it so we'll be going over the just the regular setup but if I open up the definition file and then open the biome definition you can see it has a name and it has a color and this color is the color from your map so Broadley Forest will appear here now you are able to have multiple biomes all use the same color but you cannot specify multiple colors for a biome and so because of this I feel like it's probably better to just create a new biome that is a blend of certain biomes and then use that as that color as this biome color is a single entity and is not an array I cannot specify I want this to be in green orange and red for example it is only going to be in green but if I open up Landslide here you can see it is orange but it is just an incorrect shade of orange because if I turn off srgb you can see it is very dark which is very different than the actual orange that we have here now my photo editing program I can go ahead and check the actual color and just grab this actual hex code and copy it over into unreal I guess like hex linear and paste this in press enter and you see as soon as I did it is now detecting it as its own color click okay and now it is correct now this biome priority I have not figured out yet even when I have multiple biomes overlapping the same color biome priority doesn't seem to do anything and I have not seen it regenerate a single time when tweaking with it so at the current moment I'm not sure about what this does and the name is completely up to you what it what it is it doesn't actually affect anything it is for you to understand what it is when you open the file but now you can see all the colors that you've said up are now here and you might notice these black spots occasionally now in my case with my image this is not actually perfectly solid color so you can see if I zoom in into these pixels well this is not all exactly the same shade which means the RGB value is slightly off and that is why it is detecting black because it's saying okay well I don't know what that pixel is so clearly it's a biome that we don't have so it's going to be red but don't worry that's fine cuz as your you recall in our PCG biome core the first value is the biome blending range even though there's no information there you'll still blend from the nearby biomes on top of each other and kind of cover that now of course you're doing it for yourself you might want to actually make it so it's exactly full solid pixels in my case they're a little bit off to show you what happens when it is not quite correct I'll turn off the display biome cache right for now and let's move on to the next thing which is the root Point filters I'll go and open this up and again you have the base setup here and then the filters themselves down below if I open it up for some reason the first one is empty but the other ones all have different filters and you can of course navigate to them and these are the actual graphs that they're using these are all instances so if you want to make modifications to one of these just go ahead and duplicate it and then tweak the values for your own setup instead of modifying the ones in the plugins directory there are a few different ones noises flows sun exposure water distance effectively they just slightly randomize the actual points that you're using so if I go ahead and just move this down there's a convenient checkbox here debug bypass Global filters which are these right here if I check that on this is actually everything that is being generated and you can see well it's being generated all the way out here where we don't want it we probably don't want to have it all in the water we probably want to have some angles and things controlled the first thing we want to do is modify the water level because effectively that is the one big thing that is actually cutting off all the way up here so if our water level if we select it is at -1 1840 so I'm going to take this and here's the water distance level instance I'm going navigate to it I'm go ahead and duplicate it for myself I'm going to move it to my PCG folder and now I can take this water level and just swap it out with this water distance one plug this in now all of this is already set up for you the filter attribute the minimum and the Max and this is why I say go ahead and start with the actual content sample because it fills out a lot of the stuff for you so as you're kind of getting started and learning everything you have a good Baseline but that that I've Swap this out and go ahead and open it and here you can see the water level so we can control where the water is now in our case the water is at- 1840 because of the position of our landscape so I'll going to put in 1840 and already you can see that all the trees have now appeared everywhere we want so now you're seeing all the different actual types of biomes that we have set up here so over here we have the actual Cactus this is the desert biome we have a few different biomes for the trees and here's the rocky landscape biome but now that we actually see everything it's a lot easier to control some aspects so again we can go with the biome PCG core go to biome core and now if I was to change this blending range you can actually see the difference so I'll go in game mode to remove the highlights and now if I change this from 2500 to let's say 10,000 you could see that the biomes blend together a lot more these forests kind of spill into each other considerably more the rocky Mass actually goes much further down and the trees go further in this way so this is entirely going to be dependent on what kind of look you want and how big of an area you want it to blend between of course I can go ahead and just change it to something like 100 to make it super small and then you're effectively getting a border as you can see it is now much more distinct in where the actual lines are pretty much nothing is overlapping I'll make it something like 5,000 for this one so we have a little bit of overlap between the biomes the next one down is our child Point filters if I come over here to the forest these are the child points and we can actually see that if I scroll down we have a maximum child aspect depth if I set this to zero you can see all of the little extra things go away effectively these are the little objects that just scatter around your main pieces and just like the Maino filter this is works the same way it also has different filters so in this case it has a noise and the water level and you can control how many there are if I set it to be two it'll be a little bit more of them but this effectively controls how many of these points are being generated now this child input points rate multiplier doesn't seem to change the actual amount of these points which I thought it would so it's something I'm still investigating as to what specifically it is modifying and when I learn it I'll of course share it with you guys and of course the last option is to actually output the data for runtime generation specifically but in our case we're not doing runtime things so I'll go ahead and uncheck it for myself as it is not needed now as always the project files for this are going to be available on my patreon where you can join these one or few people in supporting what I do it means a lot to me so that way if you need to you can also take a look at how this is set up from the base graph if needed thank you so much again to the patrons and if you'd like join the Discord down below and we can help you out there for any questions you might have with that let's get back to it well that is everything kind of in here that you need so keep in mind all of these settings are in the actual PCG graph a lot of times you might want to expose the stuff into the root but in this case you have to scroll down to the actual biome core and then you'll get access to it and most of the stuff here is access that way very little stuff is actually exposed to the root blueprint you always have to dig down into the PCG graph but now that we have this all generating let's fix up some issues that we have for example if we come here to the desert well one it is not very flat terrain these cactuses because of it are generating at kind of crazy angles and we'd like them to be a little more straight up in fact we have this problem a little bit with the trees and some other things now the Shrubbery can of course be aligned to the normal and in the majority this isn't directly along the normal it is actually still slightly towards up and we can control that so now let me show you how to configure the actual biomes and what is in them and how they look and we do that in our biome setups so as I mentioned before in our definition you can control the color and col it whatever you'd like but in the actual assets location we can just open this this is the actual biome file so if I go ahead and open this up here are the different pieces of this biome so if I open up index zero here is the spruce tree that it is and you could you can make it enabled disabled you can change the weight of it you can change the generator that it's using so if I navigate to the generator you can see shared rocks shared trees and I can open this up and then in the generator there's more generator graphs you can configure all this stuff for your own project I can open up the sampler trees and I can actually go in and completely configure then the generator for the trees if I want something either more complex or more simple or just make slight modifications I can do that here but assuming the generator is fine we can have all sorts of inputs here including the mesh assemblies actors child assets and a lot of really interesting things like for example the debug options we can isolate these trees if I click isolate you can see we're now only seeing this tree and only in this biome so it is much easier to actually troubleshoot and modify what we need here and if we need to we can even show the bounds of this thing which gives us the bounds of the object so knowing that we have this isolate I'm going to open up the desert and let's modify the cactuses so go ahead select desert open up the desert asset I'll go ahead and take this third Cactus here and I'll isolate that one and now we can see it is only showing this Cactus because this is the cactus that we have kind of angled incorrectly so there's a lot of controls now under asset options we can allow overlap if we're fine with it merging with things we can force the AET scales we can move it around rotate it Etc now of course this is on top of the already Randomness that the original base has there's an interesting one called Orient upwards so this is at point 4 if I set this completely to 1.0 you could see that no matter the angle of the terrain it is now facing exactly upwards and of course if I set this then to zero well it now matches exactly with the normals of the terrain so if we did something like8 for example you could see it is now facing mostly upwards but it does have a little bit of a lean with the terrain which in this case is probably more towards what we want again there's a lot of options here there's runtime options there's filter options so for example here's the flow controls the flow filter that we had the sun exposure one the water level so if you wanted something to actually appear underwater you can make it per asset per biome now I'm going to uncheck isolate and then in this H configuration what we can do is now search for any one of these and modify it for all so if I search for Orient upwards we have access to all of them at once so I can go ahead and just plug in for example 08 for these and modify them now some of them we don't want it to actually modify because some of them are the Rocks but I'll show you if I set them to be 08 you see even the rocks are now facing towards the sky and we don't want the rocks to be facing towards the sky rocks can go ahead and just angle with the actual normal by using the same method we can go ahead and configure these guys to also face more upwards if that is what we wish now there's still a lot lot more in this biome plug-in effectively this is a just a very Advanced PCG graph with a lot of modularity to allow you to have a lot of controls but this should now give you a pretty good starting spot to take your project for wherever it is bring in your own landscape and make it work with this biome setup because you can again make it as big as you want if I wanted more biomes I could just go ahead and take these biome setups and I can just go ahead and just duplicate one of them name it whatever I'd like change the Mountain Forest color to be something else name it something for convenience and then swap out the assets and of course make sure that my actual mask is appropriate for that color and I'm good to go now if you're now looking for things to populate your world with check out this video right here where I show you how to take modular assets and put them all together to create full buildings with PCG
Info
Channel: Procedural Minds
Views: 5,868
Rating: undefined out of 5
Keywords:
Id: 66oPPY8FBw8
Channel Id: undefined
Length: 21min 49sec (1309 seconds)
Published: Sun Apr 28 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.