Mastering Procedural Open World Creation with PCG and Unreal Engine 5.2

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
foreign 5.2 PCG I'm going to walk you through all of the basics so that you can start creating your own procedurally generated worlds in no time but that's not all in the end of this video we are going to put the new skills to the test so make sure to stick around until the end of this video so we can create something amazing together hey guys it's been a while since I've uploaded a video and I want to explain why unfortunately I had some issues with YouTube and they demonetize my channel and bent my bank account for no reason at all despite that I've reached them 14 times I even talk with their support I had no luck in resolving the issue it is frustrating but it made me realize that I should always have a backup plan before I started this channel I wonder why the big YouTubers had also patreon where they can have YouTube membership now I know why a simple AI can shut down your monetization at any time but let's not dwell on this because today I want to talk about why I've created this channel my goal with this channel is to create a community where people can learn create share their work together and just help each other I want to inspire you to create great things by using Unreal Engine 5 and use my videos like a foundation that you can build upon my role is to provide you with that knowledge and tools to achieve your goals and secondly I want to create the best Unreal Engine community that you can have so don't hesitate to hop in in our Discord server the community is growing bigger is growing stronger there are a lot of knowledgeable people there that can help you out with your project or your problems that being said I've decided to switch to patreon to continue supporting this channel in the community by joining my patreon for as little as 4.99 you have access to all my files from my videos you'll have access to the auto material from this this video over here if you didn't watch it go and watch it as well as everything that I've created in the past and I will be creating in the future additionally you'll get access to a private Discord server which is dedicated to my patreon members only but that's not all as a patreon member you'll get exclusive access to in-depth videos that will explain a little more about the auto material and each thing that I'm creating in my videos so a lot more videos you can find on my patreon page that won't be shared anywhere else if you want to support this channel gain access to all my assets join my patreon now thank you so much for your continued support and now let's get started on our journey through unreal NG 5.2 and PCG alright everybody so this is the final result that I've created using the PCG I've created custom PCG nodes that will mimic a forest and there are a lot of notes I'm going to show you right now but this is the final result that I've get so far of course it is still work in progress and there's a lot of things that can be improved and tweaked but I'm pretty sure it looks pretty good I'm pretty pleased with it so we have different biomes over here we have different vegetation we have different uh trees different Forest the grass itself looks pretty cool I've added a few flowers on the ground just to break it out and here we have a little path over here with uh Stones Pebbles over here all right some other biomes and here we have this River bed where it transitions and we have some vegetation for the river that grows in moisture area around the rivers here we have again the forest and we have some rocks over here spawning dynamically procedurally with the riverbed everything has Collision meshes you can climb you can get hit by a tree you can move over here through those rocks and here are some other rocks spawned from our PCG node and pretty much this is what I've accomplished so far and everything is dynamically spawned this is a water body that I'm using just to mimic a river as you can see our character is getting in this little Deep River over here we have some pretty nice transitioning here over there with the rocks and let me first show you what we are going to cover in this video right now we're going to cover how we can create Blueprints and connect them with our PCG graph let me show you the end result of the force that I've created this is only for my patreon members I'm gonna include my PCG 4S Pro only for the patreon members and you're gonna have access to everything here that I've created so what I've created for my PCG 4S Pro I've created two tools for my forest and my road I've created 11 sub graphs one for the bushes I have one sub graph for the forest data for the grass the pads the plants the Rocks the scatter the shoreline the shrubs the trees and the water this is all the sub graphs that I've created so far of course I'm gonna expand this in the future and share it with you on patreon and I've created two nodes for applying density to height and height to density let me show you what this forest does so in order this to work you need to drag and drop from the tools folder the BP forest and here I've created a curve circle with an icon over here this is the definition of where the force will spawn the next one is our BP Road I'm gonna place it over here and we have a rot icon what I'm going to do is I'm going to select this one and put my road across this and by holding out I'm gonna shape it a little bit more to create the little curve let me just hold out one more and out so I'm just crossing across my Forest over here creating this interesting Road shape and the next thing that you need to do is you need to drag and drop the PCG first over here and everything will spawn dynamically all right looking pretty good it spawns pretty fast and what you can see over here let me just zoom in you have 4GS around the edges we have some nice flowers over here let me just turn down speed you have the path over here I just put those rocks but of course you can go crazy and put anything you want over here and the great thing is that if I select my route over here and start tweaking the splice let me just tweak it like that everything will change dynamically and the forest will start cutting the road through here the next thing is that you can expand this Forest wherever you want so I'm going to select this Green Dot and I'm gonna start moving it to the left so I want my force to be like that and it will start spawning first over here all right looking pretty good it is a little bit intensive process but once it's done you have all your four stove here and of course I can expand it over there and the road right now will start from here from this point and if I want to tweak my route again we're going to select the roads I'm going to select this plane and I'm gonna move it all the way over here and it will start cutting through my forest all right just a few seconds to compile all right and we have now let me just turn on the gizmos we have now our path through that forest and it looks pretty amazing I've played a lot with the trees to get this homogenic nice look and have this nestio here and the grass it's looking pretty good the next thing that I want to show you is in my PCG sub graph I've added a PCG water layer this one let me just show it to you and in this PCG water layer I've talked here that you can select actor selection class and the water body River and the water body Lake will exclude and will start deleting trees when you spawn them so how to add reverse to this uh pretty nice Forest you go over here and search for for River I've already added the water plugin in my Unreal Engine so you go to plugins you search for water water extras and water and the next thing is go here search for River drag and drop the river boy over here it will take some time so now when you have your water body River again you need to select a point of the spline and you need to make that point to go through your Forest so I'm gonna make it go through everything over here and wait few seconds and once the PCG finish you can see how this water river is going through your Forest over here and it creates some water plants it creates some rocks a side of the river of course right now I'm a little bit High over here I can put it a little bit down and that's how the water layer is also working with our PCG Forest so this was the little demo that I want to show you and enough talks and let's Deep dive and show you how you can create this all right everybody so we're going to start with the basics of the procedure generated content and then we're gonna unfast and create some more complex stuff so let's start this is a Terrain that I've created in Gaia if you don't know how to do it just watch my previous videos so right now what you need to do first is you need to enable the procedure generated plugin so you need to go to edit plugins and search for procedures once you find it it is under procedural content generated framework it is still in better so there could be bugs that there could be upgrades to it but right now it is a version 1.1 and I'm using Unreal Engine 5.2 so this is the version that I'm using and if you're using a lighter Unreal Engine version or a higher version of the PCG there could be some changes all right so enable it from here then reset your unreal ng5 I've already did this and now let's create our first graph so I'm going to right click here and you have a new tab PCG and click on the PCG graph I'm gonna name it PCG basic graph and when I double click it will open a new menu it looks like the blueprints uh system but it's a little bit different on the left side you have a lot of different content that you can drag and drop so those are the functions so let me just drag and drop some of the functions so this is density noise you have a lot of different things that we're gonna talk about another method to add blocks is right click and search for it so let's say surface sampler I'm just going to search for this click on it and you'll add the Block it's very similar to The Blueprint system the other thing is when you click on the Node over here on the right side you have all the parameters that you can change per note and each node has a lot of options added to it all right so this is the first thing that I need to explain here for the PSG it looks just like the blueprint system so let's start by creating a surface sampler I'm going to right click I'm going to create a surface sampler here in the input you need to start from this node I'm going to expand it and I'm going to input my landscape to my Surface over here I'm going to connect my landscape also you have a landscape height so you can connect the landscape height to any nodes and create some logic behind it but first i'm going to connect my landscape to my Surface I'm going to hit Q to align them and now I'm Gonna Save it always save and how to add your PCG to your scene drag and drop it over here and you're gonna see a bounding box this bounding box represents the place that your procedure generated content will be spawn on the map if I make it bigger let's say like this so it will cover this place and right now you don't see anything on it so how we can see something that is happening over here I'm going to select this surface node I'm going to right click and choose the bug and right now we see some boxes over here some cubes with different colors so we started to create procedurally generated stuff and if I start moving them they're connected to the landscape and this is because we've connected the landscape over here to the surface sampler so the surface sampler is taking information from the landscape and it's procedurally generated our cubes based on the volume that we've presented and it's following the landscape surface all right this is pretty cool pretty good so so good so far right now we have different colors for the cubes which represent different values it is just in the gray scale of 0 to 1 and based on that we can spawn different things so let's say we want to spawn different pumps on the black and different trees on the white and we can do that so this is the surface sampler you can turn on and off the debug option by pressing D on your keyboard and now let's talk about the different options over here so if I start scaling up my Cube and you can see that it is covering more and more of this surface but if you want to cover the whole surface and not to have this bounding box you just need to click Unbound it be careful with this because it's going to cover everything in your scene and this could be quite expensive and it could crush your Unreal Engine but let me click it you just need to wait a little bit so it can calculate so right now when I turn on the Unbound you can see that everywhere we have this boxes over here spawn so this is what I'm bound to do it will spawn the procedurally generated content on whole area of your landscape I'll turn it off because it's heavy on the performance and let's focus on this one so there are also other parameters you can extend the points for example if you want on X to be a little bit big over here you can do that for example if you want a wider tree or you're creating some walls Etc you can extend with the points over here let's try with 20 you can see how I'm shrinking them and on 100 it will be the cubes the next thing is looseness so looseness will tell our points how to act to each other you can create bigger spaces between them as you can see over here even bigger spaces let's try with five you have a few points over here so let's bring it to one so from here you can create different variations and spacing between those points so this is the basics about our surface sampler and let's move on if I expanded it you have a lot of options over here where you can find different nodes and connect them over here and create different logic and the final thing is you can use the seat to regenerate the cubes over here and create different shapes all right I'm gonna hit the on my keyboard to turn off the debug next what I want to show you is the transform points so I'm going to right click plus form points so this one transform points and let's start at the back over here turn it on and let's connect my output to the input of the transform points here you have a lot of options you can offset them by Min and Max you can rotate them you can scale them you can use absolute scale you can recompute the seat Etc so the things that you're going to use are here the offsets the rotation and the scale I'm going to show this a little bit late when we connect trees but from here you can apply this different transformation to your objects now let's move on I'm going to create a density filter density filter so this density filter will filter Black and Whites over here so I'm gonna connect over here and click d or debugging my density filter and turn off the surface sampler by clicking D on it and right now we have lower bounds 0.5 and 1. so we are filtering the black colors and as you can see we have the silver which represents 0.5 and 1. so for example let's say here at these points we want to spawn rocks we're gonna filter only those colors we're gonna spawn rocks and on the other desk and I'm gonna add another density filter and we're gonna spawn let me just duplicate this one and connect it over here and let's say on the lower bound zero to 0.49 we want to spawn trees I'm going to hit D here and I'm gonna hit D to turn it off right now this will be for my trees this will be for my rocks and see how we can filter the colors and create different meshes over different colors and this will be very useful when we create different biomes and it will be procedurally generated with a lot of details all right the next thing that I want to show you we're going to come back to all of this when we spawn some geometry is the density noise Dusty noise I'm gonna turn this off so right now we've isolated uh this by 0.5 and 1 but when we add another density node we're gonna re calculate and create black and white from zero to one again so we can filter again so I'm gonna turn this debug on on this one and turn this off and right now as you can see we created from those points that we filter we've created new points with different colors from zero to one and we can create another density filter and we can add more geometry and filter it like that this is this will be very practical this is very important and later on you're gonna see how we're gonna spawn those uh nice measures and we're going to create amazing biomes and the next step that I want to show you is how you can spawn mesh so you're going to search for static mesh spawner this will spawn our mesh connect it over here and here from mesh entries I'm going to hit Plus and we have a lot of options for our mesh and we're going to choose a static mesh there is a PCG default static meshes so I'm going to choose let's say three number one this is just for the test testing purposes I'm going to choose it and right now as you can see I'm gonna turn off the debug on this one we've spawned some trees over here and if I select this bounding box and start moving it foreign trees will spawn on the mountains but right now we have a big problem as you can see they're spawning sideways how to fix this you're going to go back to the your transform point and you're gonna click absolute rotation and now the rotation will be absolute and it will face the up Vector over here and let's start working with this transform Point what we can do over here is let's say the scale Min and Max to be different so we can have different shapes let's try with three and let's try with 0.3 0.2 right now we have different sizes of our biomes we have three for our trees and we have small trees and this is how you can create uh different biomes and some nice shapes over here of course we can use the rotation Max let's try with 90. so you can see how we are rotating on 90 but let's try sideways 90. see so let's for example this is on a cliff and it is hanging you can filter some of the trees and just rotate them by 90 degrees or you can rotate them by 30. let's try -30 so now we are creating different shapes from -30 to 30 and we're just rotating them pretty cool also you can use the offset by placing some offset over here the offset is working uh they're offsetting from the from the boxes so right now they're offsetting with how much I put with 500 points from the origin of the boxes all right if I put zero we're just moving them to the original position all right the next cool thing that I want to show you is how you can debug your graph and you can enable and disable blocks if you right click on it there is an option to enable and if I turn it off this block will stop working and we're gonna have only the density noise and our static mesh power over here all right so we are not filtering over here the colors and we're spawning everywhere those trees all right so by using e on our keyboard which is enable and disable you can test different things you can turn them off or turn them on in order for you to see if there's some problems and for easy debugging all right and right now let's add another tree to our density filter so I'm gonna duplicate this static mesh and I'm going to choose let's try with three number three connected over here and we've spawned some other trees but we have a little problem over here because the density is too high let's try with this one so we can create some other variations of the trees and let's start and try to debug them I'm gonna hit D over here so from the black boxes we're spawning those threes all right and right now they're pretty dense so I'm gonna select my density filter on the top and I'm gonna shrink it down so we can filter some more and right now we've created some nice biomes over here with different shapes and if I want to scale this up I'm going to scale this up like that and it will start spawning my trees like that all right and we've created this pretty dense forest let me just turn down my camera speed so we can see it so this is just the start how you can use the PCG graph over here in order to create different stuff and mix them together those are just the basics we're gonna Deep dive as we progress through the video and one final last thing that I want to show you is how you can debug those points so let me just turn the points on from the transform points and I'm gonna disable this one I'm just disabling the meshes over here so right now we have those points over here but if we want to know the exact coordinates of them we can do that so I'm going to right click and click on inspect the hotkey is a on your keyboard when you turn it on you go over here to note debug object selected and select the PCG basic graph that we've spawn on our scene and right now let me maximize it you can see each of the point where where it is on our landscape over here right so this is for the bug purposes you can see the scale Y and Z Etc everything here like information is shown and if you want to debug something you can access it from here all right guys so this is the basics let's continue on with some more advanced stuff so now let's continue on and let me show you how you can work with splines and PCG and how powerful this is so the first thing is I'm gonna create a new PCG graph so I'm going to right click PCG graph and I'm going to name it PCG Basics Point basic spline all right I'm gonna open it and here in the PCG graph the first thing that I want to get is I want to get a spline data so I'm going to right click get spline data and from the get spline data we're going to get the data from a blueprint with the spline and apply it to our PCG so what we need to do here is we need to actor filter and we need to filter all World actors so we need to filter everything that is in our scene all right and I'm going to fill filter it by actor selection tag I'm going to name this basic spline and this will work for filtering the specific uh spline that we are creating so the spline that we create we're going to give it a tag name with a basic spline so I'm going to save right now and the next thing is I've created a folder PCG blueprints so here I'm going to create different blueprints I'm going to right click go to my blueprint over here blueprint class I'm going to choose actor over here in this actor will be BP basic spline basic spline all right I'm gonna double click on it and here is our blueprint of our spline I'm gonna turn off the tick enable over here and from the add menu I'm going to search for spline spline I'm gonna add it over here and I'm going to name it basic Supply after that I need to select my basic spline over here and search for the tag option and we've added attack which is basic spline basic spline and this is how we filter it so if I go to the basic spline graph I'm going to close this one here we've created this selection tag basic spline and the same tag is applied over here so we can filter this out all right so I'm going to save and compile and right now our BP Basics plan is ready and our basic spline gets plain data will work the next thing is I need to delete my basic graph over here I'm going to drag and drop my blueprints here the BP basic spline and I'm gonna drag and drop my PCG basic spline over here and right now what we have here is a spline let me just move it all the way up and let's continue on with the graph the first thing is we need a spline sampler this is just like the surface sampler but it will sample a spline so I'm gonna right click search for spline sampler I'm gonna connect it over here and I need to make few changes the first thing is the dimension over here you can choose different dimensions of the spline you can go along the spline over here let me just show you how this work I'm gonna hit D on my keyboard to debug it and I'm gonna focus on my spline so with using the dimension on spline if I turn the debug on you can see that it is moving along this plane how to create another spline is Select this point hold out on your keyboard and drag so here like that you're creating different supplies and right now what we've created here is all the PCG components are at the spline curve they're going along the spline curve and what you can do over here is you can increase the subdivision per spline and this will smooth out everything and it will spawn a lot more splice over here this could be useful for pads Etc but right now I'm trying to create an isolate forest and how to create this is I'm going to put this one and for the dimension I'm going to choose interior and right now we have an error and the error says interior sampling only generates for closed shape enable the closed loop settings on the spline and what we need to do is Select our blueprint over here and select our basic spline here the object and search for closed loop I'm going to select this and right now as you can see we are spawning here at a closed loop what I can do over here is I can add and transform points transform point in order to scale this down a little bit let me just connect it and for the scale Min and Max let's try with 0.2 and here again point two and let's start the book this one and right now as you can see here we are spawning points at the transform Point let's try with 0.5 and we are just spawning points inside the circle let me just expand this a little let's make it bigger let's say this is our forest let me just move all the way here expand this I've created a lot of points so I can create pretty interesting shape just like that so here is our forest and our transform points are like that but right now everything is so even for example if we try to spawn uh big trees and small trees or some bushes everything will be spawned like that because we are using just the white color and we need to balance this out we need to create Variety in our grayscale from zero to one and this can be done by interior density falloff so we need to add 2.0 here right click add key and time and value I'm going to put 0 0 so this is the start and I'm gonna add one more key at one one and right now I click those two in order to zoom in and right now we are creating variety for example this white uh will be our bushes and this will be our trees all right but here we have a problem if we start scaling this up like that see how not even it is here we have a lot of white and here we have some dark and we want this to be even when we start shaping out our things right it is not even at the edges and how we can do that the first thing you can reverse it of course with a density ramp so for example if you want black to be out you can just switch this out so let's say this is 0 1 and let's say this is one zero and right now we just flip them all right and to even everything from the border to the center we need to create one more Supply sample so I'm going to duplicate this one and I'm going to connect it from the get spline data and as I've showed you we need to create geometry around our spline over here so I'm choosing our spline and for the mode of subdivision I'm going to change it to distance now when I when I zoom in over here let's try the bucket turn under the book turn off here to the book we see that we have some splice over here turn it off and on we have this little bit boxes let's try to increment the distance a little bit to 300 so they can be filled up and we create this good shape over here and this will determine the distance from the side of our spline to the middle Center and we can simply do that by adding a distance note so I'm going to right click distance node and we're going to filter this distance and then we're gonna connect it to our transform point connect to our Transformer Point connect this to Source connect this to Target and our distance let's try to debug our transform points over here and for the distance max distance I'm going to use 1000 and I'm gonna set my density over here set the density and right now you can see uh the difference we have even spaces between the Black and Whites oh here when we debug this and let's test this out I'm going to move this a little bit inside a little bit outside and see how everything is pretty even this is the effect that we want so we've created our four stove here and it looks pretty good everything works like a charm and the next step is I want to show you how you can create paths in order to cut through the forest in order to create the path we need to create the get spline data get spline data all right and this time I'm going to choose again all World actors and I'm going to create a new tag which we which will be a path spline all right now as before we need to create one more blueprint so I'm gonna create a new blueprint I'm going to choose actor and we're going to name it BP uh patsplay pet supply all right I'm gonna double click on it and I'm gonna add again spline and I'm going to name this fat spline okay we're gonna search the main object we're going to turn off the tick enable we're going to search for the attack we can add attack and our tag was I'm gonna just copy it pet spline I'm gonna paste all here so it will know uh which is the tag and the next thing that we want to do on our pad spline is we need to search for scale and here in the scale I wanna enable scale visualization or width so this will look like a path over here all right this is UI just for looking like a path so right now we have everything ready we have our guest plane data let me save it and now what we need to do is again we need to drag and drop our blueprint in order to work I'm Gonna Save it I'm gonna enable disable it in order to refresh it and the next thing is we need to create another spline sampler line sampler all right and connect it to our path I'm gonna align them with q and this time our spline sample will use the distance and will be on spline so now let's select the BP spline focus on it and here it is I'm gonna move it like that let me just minimize this and I'm gonna rotate it a little bit like that 90 degrees and I'm gonna start dragging those points I'm going to select this point and I'm going to start dragging across my Forest over here so I want to try to cut it again if you want to create more points out on your keyboard drag and drop and I'm creating some points over here all right this will be my path keep in mind that you can scale it up so if I start scaling it up like that I'm creating more wider spaces across my path and more narrow but right now nothing is happening because we didn't create the complete logic but I'm just creating the path itself first now what we need to do is open our basic spline and debug this one and here we have this Cube that is coming across in our spline and we need to create the shape to be uh starting from each of the edge of the spline so we need to create another note which will be bounding our modifier so I'm going to right click bound modifier I'm going to connect it over here and by using this bound modifier we want our road to cover all the edges of our spline of our roll spline so I'm going to debug this one turn this off and I'm gonna start playing with my bounce Min and Max in order to cover everything so here is 100 100 let's try this one 100 100 this is too much so 50 50. 50 15. this is again too much 20 20. 2020 a little bit more 25 25 it will be 30. 28. 28 is perfect this is how I find my perfect size right now it is uh intercepting but only on width I want to intercept better on height so I'm gonna tune this up to 100. all right right now we are intercepting and it doesn't do anything this is because we still not filter this out and how we need to filter it we're going to create a difference the people who work in 3D softwares know what difference does for the other people this will isolate uh those uh Forest things that we're creating this forest with the path and it will exclude the pad itself and it will start removing the boxes from the forest so we need to feed the source over here at the source and we need to feed the bounding modifier I'm gonna disable here that the book disable this one and I'm gonna enable the difference and right now the difference is at minimum what we need to do is we need to select binary over here and it needs to be interfere all right and right now everything is working we are interfering with our bounding boxes you can see how this is working but another mistake that I've done is I didn't connect the transform so I'm just going to connect transform over here delete this connection and connect it like that and this is because I didn't transform the boxes over here the cubes so right now everything is working we are creating path and this can be updated in real time see if I select this create a size like that we are creating more path over here a bigger one let's say here you have a little village or something like that if we start moving this we're cutting through all the boxes and keep in mind that those will be procedurally generated and we're gonna create everything looks perfect and finally another thing that you should keep in mind is if you duplicate this pad for example we have this pad but I want to create one more parallel to it like that and let me just delete this point and let's create a little different shape I'm just minimize this one so right now it is not working the second path only the first one if we start tweaking this up this is working and my second pad is not working too bad all right and this is very simple fix there is very simple fix for this just select your get spline data and select multiple and this will work the same is for our basic spline if we duplicate this one and we created another four somewhere else you need to select guest plane data select multiple save it and it will work all right pretty much this is about splice and those are very powerful and you can create a lot of different stuff by using those splines all right so let's continue on and move on more advanced stuff all right guys so we're gonna move to the next thing right now I'm gonna show you how you can create this rock and Scatter things around it all right this will be very useful to create different objects and Scatter some additional details around them so for example this rock see how it is and how you have a little grass and a little Pebbles over here we're gonna create this and of course you can use this for anything that can pop out in your mind to modify this PCG all right so I'm going to minimize here I'm going to right click and create a PCG graph and I'm gonna name this PCG graph PCG speller graph all right I'm gonna drag and drop it onto my level okay and I'm gonna double click and start modifying few things in our PCG scatter graph so we're gonna start with a simple surface sampler I'm going to right click surface sample I'm going to connect my landscape over here this will start spawning my cubes I'm going to click D on my keyboard to debug it so right now we have the basic surface sampler now the next step is I want to filter with a density because I want only the white ones so we can create this big rocks so I'm going to add a density filter density filter I'm going to connect it over here and for the or bound I'm going to put 0.9 and once I've put 0.9 right now I'm debugging the surface sample so I'm gonna right click you know the bug with the hotkeyd and I want to start debugging this one I'm going to hotkey D over here all right so we have some rocks over here but I want those three not to intercept so I'm gonna use the seat over here to create a little bit randomness over it yeah that is the perfect one okay so right now I'm just filtering the high density if stuff from the lower bound of 0.921 you can do let's say 95 all right this will be better so we you can have fewer of those rocks let me just tweak a little bit more of this all right this is this is the perfect one because we have enough space around them moving further I want a little bit randomization over here so I'm gonna right click and use a transform points transform points all right this is the one that I want to use I'm going to connect though here and for transform points I want to have a little rotation over here 90 and I want to have a little scale so 0.1 all the way up to two Okay and you don't see any result over here because we are debugging the density filter I'm gonna turn this off and turn this on and right now we have some working rocks but those are pretty small so I'm gonna raise up a little bit the scale Min to let's say 0.6 so I can have a little bit bigger rocks over here and right now we added a little bit of randomization over here by using the transform points now we want to create those scalar points and we're going to use a grid for it we want to create this uh grass a little Pebbles a little rock over here maybe so I'm gonna go all the way up here and I'm gonna use create points grid create points grid all right and this will create a grid with points around my big rocks all right and what you need to do over here is you need to use the OKO and vocal inverse transform you're going to turn this on and you're gonna go all the way down and for the scale method you're gonna choose absolute and you're going to put for point scale 0.5 so we've set up our grid and now we need to create a bounce modifier right now we cannot debug this so if I put the bug mode here nothing is happening because we still need to create a few more things so the next step is to create a bounce modifier so I'm going to right click bounce modifier I'm going to connect the output over here and for my bounce modifier I'm going to create a grid 10 by 10. so here I'm going to use 10 by 10 everywhere so my bounce will be from 10 to 10 and we're going to use the scale over here and now is the time for the big truth and is is this going to work what we need to do is we need to combine those two so I'm gonna combine them by using copy points this will copy the points from here to here so our source will be our grid and our transform points will be our Target all right and now I'm gonna select this one and hit D on my keyboard and now we have some other objects scattering across our rock over here all right this is our Rock and we scatter some objects but right now it looks pretty pretty rigid with these grids and it's not looking good so we need to modify a few things in order to get this nice result over here the first thing is of course we're gonna do another transform Point transform points and we're going to connect the output from our copy points to our transform points and I'm going to start shaping a little bit the offset to -20 minus 20. I'm gonna put to Max to 100 I'm going to rotate them by Third 360. and now I'm gonna start debugging this one so I'm gonna turn this off turn this on and now we have a little bit of randomization in our points over here see it looks pretty good compared to our previous grid that we've created and the next step is to create a distance so I'm going to create a distance and I'm going to connect my transform points to my source over here and I'm gonna connect my transform points which are the big rocks over here the big rocks to my targets and I'm gonna start filtering a little bit the distance over here so I'm gonna put for my maximum distance 400 and I'm going to use the set density I'm gonna turn this on by using D on my keyboard and now we start filtering Colors by distance all right so we are creating this fading effect and for example let's say here at the black you want to spawn a little grass here at the silver you want to spawn some of those rocks let's say uh some Pebbles and here you want to spawn something else and you can use this variety of colors to create different different meshes over here and create this variety around the rock the things that are around the rock this green grass this a little bit smaller grass this Moss over here you can create all this by using the cover from black all the way up to White all right but right now this is a little bit too much so I want to use another density filter basically filter I'm gonna connect it over here and I'm gonna filter out some of the values so I'm going to put 0.128 and I'm gonna put 0.172 let's try to debug it let's turn this off and we start debugging some of them and right now we delete a lot of points so what I need to do over here is I'm gonna invert the filter so I started filtering by those bounds and I'm going to invert it so I deleted this spectrum of the cover from 0.1 to 8 to 0.172 so this spectrum is filter out right now this is how you can filter out stuff so let me show you how you can filter out more of these all right so right now we are filtering 0.16 to 0.89 and and as you can see those are built below the wall bound and those are above the upper belt if I go all the way up here we are filtering everything and here you can start spawning some things over here and here you can start filtering let's go all the way to the world belt over here so this is how you can start filtering and of course you can add another density filter on top of this density filter to filter something else but here I'm gonna put the values that I want right and it's still not looking pretty good because those are pretty small and I want a variety in the scale so what I'm going to use is a scale by density and this is an execute blueprint so I'm gonna drag and drop this over here and I'm going to search for scale by density this one and now we're going to start creating Scale based on the color variation all right so the Min will be five the max will be let's say 0.5 and then density exposure 0.7 now let's debug this D on my keyboard or right click the book over here I'm going to turn this off and right now we've created some interesting things so here we have big grasses here we have small Pebbles and it looks pretty good so we started scaling by this here you can change the values but those are good for me right now and the next step is we need to create a little bit difference between those because uh the blacks are intercepting uh the big rock so I want to spread them a little bit out so I'm gonna do this by creating another belt modifier so I'm gonna drag and drop over here about modifier this is from my rock I always try to keep a clean graph over here so it is pre-readable and I'm gonna put some values of 0.7 0.09 here will be one and those will be my points all right and now we're gonna create the difference we're gonna start cutting those intercepting so I'm going to create the difference connect my scale density over here and connect my bounce modifier to my difference and here in the difference what you need to do is you need to select binary and the rest leave it to default I'm gonna debug this one I'm gonna turn this off and right now we start filtering the ones that are intercepting and of course you can tweak this by using the bounce modifier let's try with this one see how they start intercepting you can tweak this one too you can tweak this you can tweak this one and this is how you filter out the interception you can play with the bounce modifier settings over here in order to get your desired results alright but I'm Gonna Keep the settings that I've put over here and this is something that I pretty much like over here and right now it looks pretty good all right one last thing that I want to show you is how you can self pruning so for example those two are intercepting and those are intercepting if you want to get rid of this you can use a note which is called self-prunning I'm going to connect it over here and you can print by radius from watch to small from small to large Etc so I'm gonna debug this one D and you can see that we start from all the things that are intercepting the others and you can create varieties from here over here all right if you want this result of course so this is pretty much how you can create that thing and of course play with each of the settings to see how it will affect your graph and how it will affect your scattering process but this is pretty much how you can get this effect this big raw can spawn things around it we're going to use this in order to create our final scene so let's keep going and create the next PCG alright everybody so in this next part I'm going to show you how you can create subgraphs and combine different graphs together so let's just start the first thing is to create a subgraph I've created this folder under my PCG folder which is called PCG subgraphs and here I'm gonna create my different subgraphs I'm going to right click go to PCG PSG graph and I'm going to name it PCG sub graphs all right so this is my PCG subgraphs I'm gonna drag and drop it onto my scene and I'm gonna open it right now it's usually we have our input and output over here and what we can do is we can go to our PCG graphs and here we can drag and drop previous graphs that we've created into this subgraph so I'm just going to select my basic spline and drag and drop it over here all right and right now we have in this sub graph added a basic spline graph which is pretty cool and the next thing is to create a spline so I'm going to go to my BP basic spline I'm gonna drag and drop it over here and create few points maybe like this and I'm gonna close the loop select my basic spline close the loop all right and right now nothing is happening and what you need to do in my PCG subgraph is connect my input to my PCG basic spline and after that I'm just gonna create a density noise over here let's see the noise in order for us to visualize everything connect the density noise over here and click D on my keyboard and right now our subgraph has something going on all right we have some points and it is working pretty cool and I want to filter out a few of those because I'm gonna scatter things we're gonna use this uh PCG scatter graph later on so I'm gonna search for density filter over here and I'm gonna filter out for the lower bound 0.9 and for the upper bounds one I'm Gonna Save stop the debugging call here and start the debugging here all right so we start filtering out few things the next thing is to use our PCG scatter graph but I'm going to duplicate this one and call it pcgi together graph I'm intentionally creating this this is like an instance to my PCG I'm duplicating this one and I'm gonna start changing few things here in this one that's why I call it pcgi like an instant scatter graph because if I want to use this one for other purposes I still have it so I'm gonna drag and drop my pcgi scatter graph and I'm going to connect my density filter to the inner connection over here and if I start debugging this we're going to see nothing because we need to create some changes in our pcgi graph so I'm gonna double click on my pcgi and I'm gonna maximize this right now what we are doing is we are getting the landscape data and feeding it to the simple sample density filter and transform points and what I want to do over here is I want to get rid of those three but first I want to reconnect this uh which is going to my transform points and I want to reconnect it to my input over here all right so I'm holding shift on my keyboard and reconnecting everything over here to my end and I start deleting those things out here and this is the graph that we have right now all right pretty cool I'm Gonna Save I'm gonna minimize all here I'm Gonna Save let's try to debug it so that the booking is really not working over here and what I did like a mistake I need to connect my output also to my self pruning so I'm going to connect my output over here save it and now it should work yeah now we'll start to scattering some things around our white boxes over here all right looking pretty good so right now we've connected our PCG basic spline with our PCG scanner and what we have here is if I create or move those points we start scattering those things those boxes over here and we are creating some density over here but another thing that I want to show you is how you can combine the path spline 2. so I'm going to go to the PC blueprint and I'm gonna drag and drop my PCG pad spline and I'm gonna create a little path over here that I want to intercept with this geometry and remove it let me create one more point over here just like that and right now as you can see nothing is happening and we need to do some modifications in order this path to start cutting through our for example let's say forest so what you should do is go to the PCG basic spline open it and in our outputs I'm going to maximize this select our output and here in the custom pins I'm going to add one more custom pin and I'm gonna name it part mask this will be the masking of my path and the type should be points as we are using points I'm Gonna Save this and I'm gonna go back to my pcgi scatter graph and what I need to do here is I need to add one more for the inputs and from here I'm gonna click on the plus I'm gonna extend it and name it but mask this will be the mask for my path and I'm going to choose the points all right and here we have a difference over here but we need to create one more difference after the self pruning so I'm gonna maximize this move it a little bit like that duplicate this difference connect myself pruning here and connect my output over here and I'm gonna out to disconnect them so connect them like that and right now we need to connect this difference to the path mask that we've created over here so I'm gonna try to connect it like that and right now it's a little bit messy so I'm gonna clean up everything to look pretty nice I'm gonna move it a little bit like that so right now we are creating a pad mask that is going to create the difference between our PCG scatter and our basic path all right I'm gonna go back to my PCG sub graph save this and here and the PCG scatter graph I'm gonna create one more density noise we're gonna duplicate this connect this over here so we use this for the book save it and let's test this out click to the book here and right now nothing is happening and this is because I did not connect my PCG basic spline to my PCG scatter graph PCG I scatter graph so I'm going to connect it over here move it like that and it should work now right now we don't see any result and this is because our road is too narrow so I'm gonna save this minimize this and let's start creating a real space in our roles and you can see that it starts removing some points over here and we've created this interception all right so this is basically how you can create subgraphs and how you can combine them with your path over here to work interactively in real time all right guys so let's continue on with the next topic so let's continue on with the next thing that I want to show you I want to show you how you can connect your blueprint to the PCG so I'm gonna create one blueprint and I'm gonna connect my PCG to my blueprint and then you can have access from the PCG to the blueprint logic and vice versa this will be cool so let's start I'm going to right click here I'm going to create a blueprint class under the actor and so I'm going to name it VP PCG all right this will be my bppcg so this is a blueprint that I've created I'm going to save it over here and how can we add a PCG component here from this button add near the component we search for PCG and you can add a PCG component over here to this blueprint all right we've added it and now here at the instance it it will ask for us to hook up a graph so I'm going to go to my PCG graphs over here that we've created I've created here a new folder which is bbpcg just for the testing purposes and now I'm gonna hook up the PCG basic graph that we've created I'm going to drag and drop it over here I'm going to compile I'm going to save and I'm going to drag and drop my BP PCG over here and right now we don't have anything over here spawning and this is because the PCG component it is not enough only to be there we need to add a collision box so I'm gonna hit the add button and I'm going to search for box Collision over here and this box Collision is pretty small right now so I'm gonna scale it up all the way to 200 I'm going to compile and Save and right now our PCG will work so our PCG is working right now with a collision box and if I move it over here it will spawn my PCG components over here if I move it above let's try for uh for Z50 so I can move it up above and you can see it is not working over here and when I start intercept with my landscape it starts works all right so this is controlled by the z-axis which is our up Axis so right now we are using this box collider but we also can use any kind of mesh so if I hit here the alt button and if I add a sphere over here we can also use this sphere as a collision mesh which will Define different properties so let me move this sphere let me Zoom here let me move it all the way to the side let me minimize a little bit so you can see it and right now I'm going to compile and save and you don't see anything this is because I need to hide my sphere so I'm going to search for hidden and I'm gonna hit hit it into my scene I'm gonna press G on my keyboard and right now this is spawn in a sphere in a spherical shape and if I start moving things around you can see how I'm spawning this pack of trees but in the shape of a sphere all right so this is something else that you can do you can create custom shapes let me just shrink this like that compile and save you can create custom shapes even not in real for example you can use blender or so on to define the shape where you want to spawn your actor over here the next thing that I want to show you is how you can connect blueprint variables from the BP variables and connect it to the PCG so I'm gonna create one variable over here I'm going to hit plus and I'm gonna Define my PCG graph Max scale this will be my variable PCG graph Max scale I'm going to use a float because it's a number I'm going to compile and save and the next thing is to go to my PCG graphs and open my PCG basic graph over here and here what we have is we have our surface sample we have our transform points Etc and what I want here is to control the scale Max all right so how to control this we're going to search for a note which is called property to parameter this one property to parameter so what this will do is it will get the property from our blueprint this one this property and it will give it over here to the scale Max we're gonna redirect the variable over here and pass it over there the one thing that you need to do to redirect the variable is you need to make this variable uh public so you can do that by clicking here on the I icon or by going here and click instance editable it's the same thing the eye icon or here and now you're making it public so making it public will give access to the PCG I'm just gonna copy this variable and here in the properties parameter we have property name right now it is uh public we click on the I compile and save and now I'm going to pass the property over here by putting the name of our variable over there and right now we don't have warning and I'm going to connect it to scale Max and this is how you can give variables to your PCG component and you can do crazy stuff over here for example this variable can be hooked up to event graph here with your blueprint and it can work with the blueprint and the PCG can be fed up with the data over here and right now they're pretty small so I'm going to open my blueprint over here I'm going to go to my variable and I'm gonna set up the default value to B1 I'm Gonna Save and compile and from this default value I'm going to start tweaking the data here when you select your BP PCG in Unreal Engine you can scroll all the way here to the default values and this is the value that we add PCG graph Max scale and if I start tweaking it we have real time tweaking of our trees all right this is a cool way to create something uh pretty interesting and of course uh if you want you can go back to this graph and you can put this variable somewhere over here in the density filter and you can filter let's say only the pure white trees and you can just scale them and you can create different uh default values over here one for the let's say pure white trees maybe it's an orc and next uh maybe you have some palms and you want to scale them differently Etc you can do that by adding property parameter to data hook up some load variables over here and control it so this is how you can make the connections between your PCG and your blueprints all right let's continue on with the next all right everyone so we've covered a lot of topics I want to show you how you can spawn mesh on top of your current bash and right now we're going to create a rock and we're gonna spawn some bushes on the top of the rock this is very common from the demo of unreal ng5 PCG and let's create this first I'm going to create a new PCG graph and I'm going to call it PCG mesh spawner all right so this is my PCG mesh spawner and the first thing that we need to do is of course we need to surface the sample on the landscape so I'm going to right click and search for surface sampler surface sampler I'm going to connect it to my landscape over here I'm going to hit Q on my keyboard in order to align them and on the surface sampler I'm gonna stay and hold everything on default I'm just sampling the surface and let's drag and drop this one over here let's move it a little bit up and let's try D to the buck all right surface sample is working the next thing that I want to do is I want to filter out only the white ones from 0.9 to 1. so I can have a few rocks over here all right so let's do this so right click density filter this one under filters density filter and I'm going to connect to my Surface sampler I'm going to hit D to stop debugging this one and I'm gonna hit D to start debugging this one the settings for my density filter will be 0.9 and 1 because I want few rocks to be spawned so let me check this out we have few rocks over here I'm gonna put 0.95 to get rid of some of the others and I'm gonna use a little bit of seed in order to randomize a little bit more my points let me just try a little more I'm aiming not to have uh closer points so let me try 0.98 0.9 4.97 0.96 all right 0.96 and randomize a little bit more with the seed this is something that I like all right Four Points pretty cool okay so we have surface sampler we filter out the rock solve here and then I'm gonna apply a little transform point and this transform point will give a little variation in my roxol here so let's add this by right clicking transform points under spatial and let's connect my transform points over here and the thing that I want to do is I want to use the scale let's pull put let's say 0.4 and I'm going to start debugging this one this will be my smallest one and let's try with a rotation of 360. see how this works let's try 0 360. let's write 90. all right I'm gonna put 360 so we can have different variation in the rotation and this is the thing that I do with the transform points just a randomization uh nothing fancy I'm gonna get back here uh once we start spawning the meshes and the next thing is let's start spawning The Rock so I'm going to right click and search for static mesh spawner static mesh spawner this is the note that will start spawn meshes uh onto our landscape let me move this a little bit up and here from the mesh entry I'm gonna add my rock that I want to spawn geometry on it so I'm going to open the descriptor over here and here in the static mesh I'm gonna go to my mega scans and I've already downloaded a bunch of uh 3D meshes and I've got this four stroke wall you can see the code over here if you want to download the same and it is a little bit cut from one side but I don't care I'm just making an example so I'm gonna drag and drop it over here and as you can see we start spawning those rocks over here all right okay pretty cool and I don't like the size of it so I'm going to use the transform point and I'm going to put 0.4 so I can have them a little bit bigger let's try with five all right five is cool okay let's try with 180. let's imagine that I'm creating rocks for our background which the player will see only through that camera angle so this will be cool and you you're gonna not see this uh code backside all right so looking pretty good let's continue on with the next step so let me go back to my spawner over here and now oops and now we have our static mesh respawned over here the next thing is we need to add points to those static meshes in order to tell where to spawn grass bushes trees Etc so there is a node called meshed points I'm going to right click mesh to points and this note will add points to a specific mesh and right now the mesh I need to put is I need to go here at my Forest Rock and I need to drag and drop the mesh over here so after we added the mesh to points when you hit the book here on the masterpoints you should see here uh different cubes over here on the mesh but it's kind of buggy and right now I'm not connected to the static mesh spawner so right now we don't see anything but let's do a copy points which will transfer my static mesh spawner and my mesh to points and it will combine them so I'm going to search for copy points this is the sample and for my source I'm gonna fit with my mesh points and for my target will be my static mesh points let's debug this one and right now we can see the points over here all right so the reason that this didn't work is because we didn't reference it with the static mesh spawner and next right now as you can see we have those points everywhere on our mesh and we should face and place the points only based on our normals and we want our normals to face the z-axis so we're gonna do a normal to density so I'm going to right click and search for normal to density and I'm going to connect my normal to density over here I'm going to start debugging it and let's see what I have here we have the white points over here and the black points are over there right now we are facing the this axis the z-axis so we're facing the up Axis if you want to change it and face uh let's say the x-axis you just need to put 0 for our z-axis and one to our other axis and you can start spawning things over here for example you want to make a hanging trees over here or something like that you can filter it by using the normal to density so let's say we're spawning some grass over here we can filter this out we can spawn some grass over here we can create a spawner and spawn some grass we can duplicate this we can get it out and we can spawn something on our z-axis over here we can spawn here trees we can spawn some hanging uh leaves over here some hanging grass over here so this normal to density is pretty useful and you can create different variations using it all right the next thing that I want to do is I want to create a little density noise over here so I want to create a little variation so I search for density noise this one density noise and let me connect it over here and for my destiny it's right now I'm gonna use the multiply section multiply so I'm multiplying a little bit noise of it and I'm gonna start tweaking the Min and Max I'm going to put 0.3 or 0.4 let me just show you what it does 0.4 I'm just changing a little bit the color over here those gray areas all right I can do 0.0 yeah I will leave it to zero and one so I can add a little variation over here I can always come back later on when I spawn my meshes and fix this and the final touch that I want I want one more filtering so I'm gonna do a density filter again density filter and I'm gonna filter this area is from 0.5 to 1. let's try it yeah here are the points as you can see so I can have fewer points and I'm gonna tweak when I spawn the mesh this is my next step I'm gonna uh static mesh spawner all right and I'm gonna spawn something over here I've downloaded this grass and I have some bushes over here now let's try with this one first so I'm gonna go to my mesh entries and I'm gonna add this one over here and as you can see we started spawning some meshes over here which is pretty pretty amazing you you have some trees over here hanging rotting rooting from there but right now I see a lot of problems like the first one is you have a lot of homogenic trees over here and they don't look uh Pretty Natural so what I'm going to do is I'm going to transform some points before I do the static mesh spawner so transform transform points I'm gonna connect it over here I'm going to disconnect this connect it over here and start playing around with it so I'm gonna put 0.1 and here 0.4 let's try with 0.5 let's try with three two one point four so I'm gonna end up with 0.2 and this will be 2.2 something like this right so we have some small trees over here we have some big ones over here all right that looks pretty cool and I'm gonna play a little bit with the density filter let's try with 0.3 0.6 .45 something like this and in the transform point you can also apply a little rotation let's say 90 degrees which will be my rotation Max so this is how you can spawn different meshes onto your other mesh and create this variation of the nature of course you can go here at the mesh spawner and add one more component for example and let's add a little something different let's add this one let's add this one over here and we are filling up our Cliff with a lot more dense grass over here so as you can see we've created a little variation over here in these clips look pretty good with a little grass on them of course you can tweak this you can scale that you can change everything on it but it looks pretty damn good and this is how you can create and spawn mesh onto your mesh this is something that epic games did in their demo of course as I told you if you open your spawner and here with the normal to density you can Branch this and you can start spawning some grass over here hanging grass and create this variation this nice variation in your environment over here all right so this is something very cool that we've done and let's move on with the next topic if you want to support this channel gain access to all my assets join my patreon now alright everybody so we've gone through all the basics that you can do in order to create this PCG forest and combining all of those things that I mentioned before will lead you to this Forest I'm just gonna break down how I've created this Forest this Forest is available to my patreon members so you can download it uh so I'm just gonna break it down because it is quite time consuming and if I start creating this force from scratch it's gonna take maybe a few more hours maybe three or four hours extra so I'm just gonna go through all of my here uh subgraphs I'm just gonna go over to my tools and here on the BP forest and PCG Forest here at the notes I have a few blueprints to apply density and to apply it height to density so let's just start I'm just gonna explain pretty quickly each PCG sub graph and I'm gonna show you the connections over here so you can replicate them but I'm not going to go too much in details because it's going to take a lot of time so if you just want to straight download this and use it join my patreon club so let's start first with the PCG bushes I'm gonna double click here and here is the graph of the PCG bushes so here from the input I get going from the landscape into the project points on landscape so I'm just projecting points on landscape uh here the get actor property I set up the bush density so here we can control the bush density of our forest and this property name is under our BP Forest over here and here you just have the bush density here the float this is the one that will control the density of the bush and let me show you where this is here is the bush density where you can set it up we've also have a button over here so we can turn it on or off the bush density and the Boost density is from zero to one okay so you can control it from here then when I do this the get actor property I set up a little density filter with the lower bound of 0.5 and then here at the bottom I'm creating a points grid with those info 500 for the grid extends and 100 for the cell size then I do some transformation on the points then I go to copy points from the density filter and combine the transform point the transform point of the point grid is connected to the source and the density filter is connected to the Target after that I connect everything to the projection point of the landscape so the landscape is connected to my project points on landscape and points to project are the ones that we've created from the point grid alright then I move further and create a distance note which will use the target our density filter and our get actor properties which is density of the bushes and then I connect the source the points that we've projected on the landscape over here then I go a little bit crazy and just tweak everything with density remapper I do scale by density then a little density noise a little density filter some transform points just to change everything and here in the static mesh spawner are the bushes meshes that I want to spawn over here so I have just two of them here two different bushes of course you can place some others and you can tweak the weight and after that I put about modifier so I can have bounce of the spawning of those bushes and the bouncer between minus 120 to 120 with the steepness of 0.5 just gonna go pretty quickly around here from my distance so you can copy the the options here is my nasty remap my scale by density my nasty noise my density filter one transform point the static mesh points and the bounce modifier so this is pretty much about the bushes all right moving further let's go with the grass over here we need first to create all the nodes then we need to create the forest data because the forest data and the forest itself are having sub graphs in them so this is about my grass again I have a landscaper here going to the project points on landscape and here I have another actor property which will control my grass density from my Forest over here we have a grass density and my grass density is let me just go back a little bit here is my grass Dusty again I'm just uh putting here the variables setup I do a select and then I connect my select to my grass density I select the con this is a construction script and I've select my Boolean to control the selector here all right so let's go back to the grass itself here is the grass so I create Point grid here I create this variable grass density I connect to the density filter and this will control my upper bound of the grass then I do a transform point I do a distance to density then I copy all the points from the input over here going into the Target and everything here is going to the source after that I do some transformational of the points to create some variety in it and then my project points on landscape is connected to my landscape and it's connected to my points to project all right then I do again a transform point to create a little rotation here 360. then I do difference difference will cut the source and the mask of the input so here in the input I've created one custom pin which is called mask which we are going to use later on so we can filter and so with the difference the source is going from the transform point of project points on landscape and the difference is the mask that we've created here in the input node then I go with the density remap scale by density over here a little self-prunning so I can prune some of them of the grass then I go to the static mesh spawner here at the static mesh power I have this plant grass ground over here just one of them then I go to the output so this is pretty much about the grass the next one is the PCG scatter so the PCG scatter works like this we have a scattered Greeks grid extent over here and Scatter cell size so I've created two variables that are attribute set over here and I've connected them to create points on grid so we are creating points on a grid and from the input I go to a copy points note over here connect my create Point grid over here to the source and the target is the input after that again project points on landscape connect the landscape and connect the copy points to points to project after that I go to a distance note which will have in here in the Target and the distance point in the source after that to do some trans information just to change the rotation of it with 360 going further scale by density with those settings scale mean 0.27 0.25 scale Max 1 and then I connect it to my output so this is about the scatter nothing fancy just keep in mind to create this custom pins over here the attribute set and the scattered grid extends all right then continue on with the plans for my plants I have normal to density this normal to density is from the execute blueprint so you drag and drop execute blueprint and search here for normal to density this one that we have and you can create this node after you create the normal to density this is the setup that I'm using then I go to a density filter just to filter from 0.6 to 1. a little density noise again like a little density filter with 0.99 to 1 I do some self pruning this for my plants some transformation of the points some scaling and some rotation over here then I go to the static mesh and in my static mesh I have these plants on the ground all right so this is pretty much about my plans and the next thing is the shrubs here the shrubs are a little bit more complex but the logic is the same I have a property actor which is shrub density and this is into my Forest let me see what it is here it is shrub density and the block is the same here shrub density set selector and Boolean for it let me just go back then I go to a density filter I copy the points get it from the input to the Target and the source yes here the density filter go to transform some points those are the values that I use and after that I create a distance which the minimum distance will be 500 for me and I connect it to my input and the source is our transform points so the input here is our Target and the transform point is our source then I go to density map scale by density Destiny noise all these are tweaking density filter with those settings self pruning I do a project point on landscape so I'm projecting those points on the landscape and you need to connect your landscape over here and for the points to project for from the self planning block you connect over there then I do some transform points and here I've created three static mesh to spawn and about modifier so the first direct mesh to spawn are some grasses that I've downloaded in my Unreal Engine and then I do some transform points the SD filter and spawn those flowers in order to break up the ground over here as you can see here we have some flowers that is why I've created three different uh static spawners so the first one will hold different varieties of grass the second one will hold different variety of flowers and I have here another variety of flowers and the idea behind this is I need a different scaling per each and then I do a little density filters in order to filter those flowers and this transform point is working on my static mesh spawner which is the grass then I do a belt modifier in order to put bounce on it and put it into output moving further is our Shoreline this is when you place water inside your level and you have a shoreline at the border of the River or the lake so here I have a property actor Sean shrubs density so we have density in the shrubs again it is over here like a float and let me just see where it is here it is sure shrub density all right let me go back then again I'm gonna do some density filter I'm gonna do a distance with the source of the density filter and Target will be water and here at the water I choose points and I label it water all right so this is the water that is going to work on our Shoreline then this is the distance and the maximum distance is 500 this is something that I found out that works good at the distance and then I go to the nastier map destinos here are some modifications density filter those are the settings I did some transform points and then I project points on the landscape so right now I'm projecting the shoreline onto my landscape over here connect to the landscape and point to project are connected to my transform points then I do some transform points and here I spawn the flowers or the vegetation that I want to spawn in the water or near the shore of the water all right so this is the shoreline next I'm going to show you the water so here at the PCG water I have this gas plane data and I put it by class over here and selected water body River class over here all right so this will start filtering the water river class from the unreal water plugin and gets plain data here are the Lakes then I do some rock Shoreline over here with spline sampler two spline samples actually so one for the lake and one for the river I do Union which will combine those two spline sampers then I do some transform points some density noise density filter and again some transform points for the volume of the water I do two spline samples again for the river and for the lakes and then I do some transform points in order to transform the whole splines over here and do a union after that I put everything in the output for my rocks and this will work like a mask for the volume of the water and this will spawn my rocks at the shoreline alright and I do some uh the first one is rock with points and second one is mask again with points so this is pretty much uh how this PCG water will spawn rocks and we will have the mask of it now let's continue on with our PCG path for our PCG path I get spline data over here and I've put the tag to path over here all right from the spline samper I've created a spline sample here and I have a distance increment of 201 then first is my mask which will be the transform Point all right and then this transform Point go all the way here to the output but the interesting part is here for the randomization of the points on the path so I create a point grid I do some transformation on that point grid and then I get a pebble density so those are the Pebbles that I'm spawning onto my rope you can put any property name over here then I do a density filter and here from the output of the splice samper I do some transform point a union and then I start copying the points from the density filter over here for the grid point that we get and from the spline sampler over here so we copy the points then I do a transform point and here at the input which is in our PCG I connect my landscape to my project point on landscape over here then I do some transform points and we start spawning some Pebbles and some branches tree trunks etc those are just uh defining names for me you can spawn whatever you like over here so I go from the transform point to a density note I do some filtering some transform point over here the same density filter and transform point and those are for my different rocks here I have a static mesh spawner with some rocks here are different rocks and here are my branches and three trunks so I do a density noise density filter Transformer Point static mesh spawner where I have some branches over here so in the detail plants Point calculations we are creating a master point and I just reference my fallen tree as a mesh and then I copy the points from the static my spawner over here and from mesh to point so we are creating a mesh grid around our tree trunk then I go normal to density do a get actor properly with detail plan density so those plants are around our mesh as I showed you with the cliff and the trees then we do a density noise density filter and connect everything to the detail points and my detail points are using points moving further along is our forest data I know I'm speeding up this but the idea is just to check out my notes and recreate them you can pause at any point because this will take a lot of time to recreate again so for my Forest data I get a spline data and I call with with attack biomass I have a spline sample here for points of the forest and I have a spline sampler for the edge of the forest then I go to the edge transition with a distance field of 2200 for my source I got with my points of the forest and for my target the edge of the forest then I do some Union some transform Point apply density to height over here the nodes that we've created with the blueprint we have here for the edge transition of the water a distance applied density to height and of course for the Target oh here we get the water mask and here add the water mask I'm going to show you the water mask is point based and Pat mask is point based those are the things that are going to cut through the force all right so we have here a distance we have applied density to height then here we cut the water and the pad volumes we get the water mask and the pad mask we create we connect it to the union and then we do a difference difference will start cutting so we start cutting here uh from the source which is the edge transition of water and the ash transition and making the difference with the masks over here for the water and the path all right then we put some stuff on the landscape and randomize them with project point on landscape connected to my landscape over here to the input and then I connect the difference to my points to project then we do height to density with Max height of 2000 transform point and connect my outputs let's move to the tree saw here so for the trees we have an input to the transform point and the get actor property is the density of the trees how we want to spawn them then I do a density filter connect my variable to my upper bound you can ignore those errors over here then we have a density noise and this density noise will go to my high value trees and bushes then we have Wall trees and grass then we have shrubs over here so let's start with the first one the high value will be trees and bushes so I have a density filter and here I have my tallest trees my tallest trees are connected to the bushes because we want to spawn bushes over here and those are connected to the landscape so we've already shown you how you can drag and drop some graphs over here just select your let's say Bush over here let's see where is the push where is the bush this drag and drop it like that in the graph and you're gonna have this note over here then my second one is tree and grass again density filter static Mass spawner with some smaller trees over here I have one uh two pieces of trees then I connect to my PhD grass my Peachtree grass is connected the end to my static mesh spawner the landscape is still on the landscape and the mask is connected to my shrubs and for my shrubs I do a density filter bounce modifier because I want to have a Bound for my shrubs I disable the self planning curve here I've just tested it out but without self-planning it is better and then I connected my PCG shrubs and my PCG shrubs are going to The Mask of the grass this is pretty much how I've created the three note few more left to check it out so let's move on to the Rocks the rocks are again transform point from the input to the get actor property is Rock density just like before a density filter with upper bound and transformation point then we have a belt modifier with those settings and from bound modifier I go to the static mesh spawner where I start spawning my big rocks over here so here we have create points for the detail plans so we are creating some points around the rock for the detail plants we have about modifier we are copying the points mesh to the point is our Rock so we are getting this mesh and we are start to creating uh points onto that mesh all right we are copying the points from the belt modifier and the mesh to points adding a density noise and this is detail plans density all right this is adding to the density noise then density filter let's move to the smaller rocks we are creating a point grid with a transform Point connected from my bound modifier over here go to copy points source and Target then do some transformation we do project point on landscape and we connect it from the landscape over here and it's going to the project points over there and the transform is going to the points to project from transform points I do another transform points in order to create the variety based on the distance so so here I have source and Target and I have this maximum distance then I do some density noise density filter then stereo map again Destiny noise I'll scale them by density I do some density noise density filter transform points everything here is just to break up uh not to look similar then I do another static mesh spawner with another rock different this time and everything here is connected to my spawn points for smaller rocks alright which is the final note that I've created so from my density filter over here I go all the way to my union over there but here I create mesh to point get actor property which is the detail plan density then I do a density noise I do a density filter I copy the points the source is over here and the target is our small rocks all right then I do again a density noise density filter we connect the union with our create points for detail plans and then we go to the output which is our detail points over here at the points all right so this is pretty much the note for our rocks and the final one is our PCG Forest this is the combination of everything I've put my Force data over here and I connect my actor my in and actor over here to the force data my landscape is going to the landscape from the PCG water I've put my mask over here to the water mask and I put my pad mask from the PCG path output node all right the output node for the path is connected also to the landscape and we have PCG Shoreline which Shoreline needs the mask for the water we connect it to the landscape so we can create the shoreline base on the landscape and the forest data is in my input all right for from the forest data we have a little self pruning density noise density filter density noise and the SD filter just to break up everything then from here we do a union between our forest data and our PCG water rock layer all right Union between those those two after that we go to the PCG rocks which is connected to my landscape and to my union and the PSG rocks are going to a difference so we are creating difference between the PSG Rock and the forest data from the self-proning curve here connected to the source moving further we have a union between my rocks and between my path so we can create a union between them and then we connect them to my PCG plans and finally we need to create the trees the trees are connected to my difference over here and they're also connected to my landscape so this is how my Forest my PCG forest look like let me just move it pretty quickly all right the next things are my BP Forest blueprint here is the BP Forest blueprint what I have here I have for my component a PCG a box and a default scene rule this is my PCG actor I've added it from here you search for PCG then I have a box which will Define my collision and I have the default scene root so I have two groups here I have enabled detail plans enable strips and I'm gonna go to all of them those are turned off right now by default I have short foliage I have detail plans you can enable and disable them you can enable the pads enable the trees and enable the Rocks those are the bullets that I'm going to use and here are the floats in order to control the select note over here and everything is connected under a construction script so I'm connecting enable detail plans to a select node from 0 to 1 and I set up the variable the float variable over here I do this for every balloon and every float all right so this is my BP Forest the next thing is my BP Road my BP road construction script looks like this I get number of spline points I have a variable which is a spline component to the Target then I subtract -1 I do four whoops so I'm looping and I get location at the spline point over here for my point index I get the loop here the index and I connect my spline over here next I have a vector node here at the return value with z a 500 and then I add to the billboard component which have the relative transform location which is connect to my relative transform location and to my for Loop node in my viewport I have a spline over here created and very important thing is when you click on the BP Road and search for tag you need to put the correct tag so it can start filtering out so I put path over here and the final one is my BB Forest I put a circle spline over here let me just move it like that all right I put a green color I put a billboard with an icon over here and on my bb4 itself I put the attack biome Mass all right and here I have the billboard the spline and the default scene root I don't have anything in my construction script under my BB Forest alright everybody so this is how I've created this Forest I go through all the notes pretty quickly because it will take a lot of time to recreate them from scratch I hope you can pause the video and just recreate it yourself and before I end up this video I want to let you know that I've created a blueprints master class for Unreal Engine 5. it is available right now on udemy so if you want to expand your knowledge and not just only create art pieces in Unreal Engine 5 but create some characters create some game logic my course is the perfect solution from beginners to intermediate and real ng5 users the course itself is 15 hours long and it has all the foundation that you need to Kickstart your blueprint knowledge in unreal ng5 so if you want to keep evolving yourself Beyond just creating art in unreal ng5 and run out so I hope you enjoyed this video and if you want to support me and get access to all my files also to the auto material that I've created previously join my patreon page for 4.99 and with your pledge you are supporting me to keep creating amazing videos like this each one of you can make a big difference by supporting my channel so I can keep making those videos thank you guys for watching this video Happy game development I'm out foreign
Info
Channel: CG Dealers
Views: 137,438
Rating: undefined out of 5
Keywords: Unreal, epic games, fortnite unreal engine 5, free to play, game dev, game development, nanite, playstation 5, trailer, ue, ue5, unreal, unreal 5, unreal engine, unreal engine 5, unreal engine 5 cinematic, unreal engine 5 demo, unreal engine 5 gameplay, unreal engine 5 games, unreal engine 5 trailer, unreal engine 5 tutorial, unreal engine tutorial, unreal tournament, unrecord
Id: Y0UwL-Bo2l0
Channel Id: undefined
Length: 107min 41sec (6461 seconds)
Published: Sun May 14 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.