Create PCG Forest Path with Unreal Engine 5.3 - Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone in today's video we're going to be looking at how to create an advanced PL based road which will be created using the PCG from Unreal Engine 5 so in this video I'm going to teach you how you can create this plan base Road over here and how you can use this procedurally into your game if you take a look at the plan base path this is one piece of geometry but it's randomizing different assets from this component and that is how we achieve this AAA look without having a lot of repetition over here all right everybody so let's start creating this PCG spline based path if you watch my previous video you already know that my channel is demonetized so I've decided to switch to patreon becoming a patreon member you'll support me and this channel to keep evolving to keep creating more and more interesting videos besides that you'll have access to all the files that I've created from the start of my YouTube channel so right now you can download the water Shader you can download the auto material from my previous video if you didn't watch it go and watch it and you can have access to more in-depth videos about how the things work like the AO material the water Shader and few more videos and also you will have access to a VIP Discord server only dedicated to my patreon members where I am active most of the time so if you want to support the growth of this Channel and if you want to see more and more videos like this go to my patreon page enroll now and also you will have access to everything that I'm creating thanks everyone so the first thing that you need to do is you need to download assets from quickel and epic Marketplace I downloaded the European beach which includes different kind of trees this is free package you can download it from the Epic Marketplace the second thing you need to Define is what kind of environment you want to create you want to create desert you want to create Forest you want to create a beach or something else then open quicko Bridge from here and click quicko bridge and select a collection of assets in the type of environment that you want to create after that just import them into un real engine after you import them you're going to have a rich library from where you can choose your 3D elements in order to scatter around and create your path piece then the next step is to create a folder which I called PCG the second folder I created is actors and in this actor I have my PCGS which the first one is the BP PCG spline we're going to go back later to this one to create it the second folder will hold my assets I've created another folder which is materials and I have test materials this is just for the testing while I'll developing my PCGS and I have a floor grid which is this one just for the sake of testing after you created your assets folder then you need to create a graphs folder in this graphs folder right click create a new folder and call it spline graph in the spline graph we're going to hold our graphs for the PCG splines for the PCG Forest Etc then I created one more folder which is levels folder and here I'll will be including examples for each of the PCG elements that I'm creating for my patreon members all those examples and a lot more tools that I've created are available on my patreon if you want to straight download them and use them in your game and the final one is PCG custom nodes those PCG custom nodes are from Electric dreams demo which you can download from the Epic Marketplace so far I use three types of custom nodes the first one is apply hierarchy so download the apply hierarchy the second one is PCG copy points with hierarchy this is also provided by epic games in the electric deems demo and the final one that I'm using is PCG post copy points offset indices those three noes I'm going to provide them for free download on my patreon page all right so let's start with the actor the first thing that you need to do here is you need to create a blueprint and I'm just going to create a new one right click blueprint class select actor and I'm going to name it BP BCG Spore one I want to create it from scratch so I'm going to double click on it and what you need here is two elements the first element is to include spline and the second one is to include the PCG graph so I'm going to hit add and I'm going to search for spline I'm going to click spline and I'm going to select for my category I'm going to select actor the second thing that we need to include here is the PG graph itself which we are going to create so I'm going to hit add again and I'm going to search for PCG I'm going to click over here to the PCG and here in the PCG instance we will need to called the graph that the PCG will work with but so far we did not create the graph let's go and create the graph and then later on get back here and connect it so I'm going to hit compile and save the next thing that we need to create is this piece of art that we are going to use to repeat over the spine how you're going to create this I've created a new level so you're going to need to go to file new level and create an empty level without lightning then in this empty level I scatter around a lot of objects over here as you can see let me just show you maximize I start creating our ground in the side of our pet by scattering around a lot of objects so I've placed some rocks here I've placed some fages here I've placed trees Etc so on a separate scene on a blank scene just C around some objects over here and once you're done you're going to save this scene and after you saved your scene you need to create a PCG settings from this scene how to create a PCG settings from the scene select the scene which holds the part that we'll be repeating on the spline right click on the scene go to the scripted asset action and choose PCG level to PCG settings click on it and it will create this piece which is a PCG settings we're going to use this PCG settings to fill up our PCG graph when you double click on your PCG settings it will have a blueprint element type of PCG asset I gave the notes title PCG ground one as this will be the ground piece 01 that I'm going to use you can Define seed for the category I've added asset and for the description I've added PCG asset node so far so good we've created the PCG spline and we've created this example piece take your time to scatter around those pieces in order for you to get something good-looking after you created your PCG ground 01 scene without lightning any postprocess Etc just pure geometry that will Define your sply ground what you can do is you can drag this scene into your new scene where you're going to test the spline so I'm just dragging and dropping and we are creating a level instance over and this is pretty handy because we don't need to go back to the spline example and start tweaking if something is repetitive what you can do is select the level instance click edit then you're going into the scene of the PCG ground 01 included in the current scene so I can start tweaking up some things over here and when I click control save and exit this will be rebuilt and it will affect my PCG spine straight away in this new scene all right so this is a good workflow to work on your piece over here and see how it works but right now I just saved it and exit and this is not changing and it is not changing because every time you make a save over here you need to refresh the PCG settings and how to refresh them select your piece right click script asset action and click PCG level to PCG settings all right if you don't refresh your PCG settings you're not going to see the result over here let me just show you pretty quickly if I go here to edit let's say I move this rock all the way over here I click save exit this rock is not over here it is still over there but if I right click script asset action PCG you can see that the update is reflected so don't forget to update your PCG settings so far so good we've created the piece that we are going to use we've created the PCG settings I'll show you how you can import your piece inside your level so you can start working straight away on it and see the results in real time time the next step is to create the spline graph so let's create the spline graph from scratch I'm going to right click PCG PCG graph I'm going to name it PCG spline graphcore one I'm going to double click on it the first thing you need to do is you need to instance the piece that we've created so this one so go to your spline example select your PCG ground 01 and if you try pay attention to this if you try and left click and drag and drop it over here the green check says that it can be dragged here and it will create something I release my left click nothing is created if you want to create an instance from the PCG settings you need to hold out key on your keyboard so holding out on my keyboard and dragging over here I create the PCG instance don't forget that so after we instance the PCG ground piece we need to get the attribute from the point index so I'm going to right click attribute from point index I'm going to duplicate this because we're going to use this two times and then I'm going to connect my root over here in the first one and my points in my second one I'm going to select the first one and here for the input source I'm going to put door sign and then I'm going to set bounce Max bounce Max then for the output attribute name I'm going to put bounce Max scale bounce Max scale I'm going to do vice versa for the second one I'm going to select the input source I'm going to put door sign and this will be my bounce minan bounce min and for the output attribute name I'm going to put bounce minan scale bounce minan scale all right then we're going to append those two boundaries so I'm going to right click search for append attribute sets and I'm going to connect my first attribute and my second attribute no need to touch anything here in the append attribute sets the next step is to get the input from our actor and make a spline sampler so I'm going to open this and from our actor I'm going to search for spline sampler it will add a filter curve don't worry about it so here for the subdivision per segment I'm going to leave it to one and then we're going to come back and tweak it up the next step is to create a bounce modifier I'm going to right click bounce modifier and I'm going to open here from the arrow and I'm going to connect my output from the append attribute to overrides and the output from my spline samper to the bounce modifier for the minan and Max I'm going to put zeros everywhere the next note that we are going to need is attribute noise so I'm going to drag here and I'm going to choose attribute noise leave the settings to default and I'm just going to choose for my seat to be four then the next step is to create a point filter which will control the target attribute density so I'm going to right click I'm going to search for Point filter and this point filter I'm going to connect the attribute noise to the in over here and this will stay density it will have the operator greater then I'm going to click use constant threshold and here in the type I'm going to select FL float the float type will be 0.5 and after that the outside filter will go to transform points so I'm going to right click transform points I'm going to connect the outside filter to in and I'm going to leave the transform points as default then I'm going to merge so right click merge and connect the transform points to the merge node and the inside filter to the merch node and right now it comes the time to use the PCG copy points with hierarchy from the epic games demo so I'm going to select the PC PG custom nodes and I'm going to select this PCG copy points with hierarchy and drag and drop it into my PCG graph going to open this I'm going to zoom in and the merge will go to the copy points Target so I'm connecting it over here and for the copy point source I will need my points so I'm going to drag the way here and I'm going to clean up my graph pretty quickly after that we going to start creating the magic of randomizing all the elements in inside our chunk that will go across the spline so the first randomizer we randomize the trees so I'm going to create a point filter Point filter I'm going to connect the output to the input over here and inside this point filter we need to make few adjustments the first thing is use constant threshold selected and for the type we need to select integer 64 in the value select one for the operator we need to select equal and here for the Target attribute we're going to say three in this target attribute we use the T of our 3D mesh so each mesh that has this T three will be transformed each mesh that doesn't include this tag will be ignored so inside the filter so if there is a tag three we're going to transform points right click transform points and I'm going to connect inside filter to transform points I'm going to search for One More merch note merch and I'm going to select my transform points and my Al outside filter so each 3D object that has three tag we go here we're going to transform some points and we're going to merge with all the other object that doesn't have this tag I'm going to select everything I'm going to comment and I'm going to name this free I'm going to change the color to Black hit okay in this transform Point here you select how you're going to randomize your trees across your level so let's say we're going to scale them in to.5 2.4 let's say the maximum size of the tree is 3.5 let's say it can rotate from minus 180 to to positive 180 let's say it can rotate me to minus 20 Max to + 20 I'm going to do a little offset of 50 and here minus 50 and I'm going to do for the other axis 50 and again minus 50 all right so those are the settings that works for me the next layer that's I'm going to have is rocks layer so I'm going to randomize the Rocks what you can do select this block copy and paste it over here connect this to the next Point filter rename this to rocks here in the point filter just change the tuck to rocks and again you want to give a different transform point to your rocks you can put 0 0 0 let's say 1.3 1.3 1.3 let's say for my offset I'm going to put 15 and I'm going to put 20 over here the next layer that I want to create is so I'm going to copy and paste this rocks I'm going to connect this to my point filter and keep in mind that if you start muding too much right now I'm merging like four times the PCG will stop working I don't know why but it is the way it is so if you need more layers than those three I'm going to show you how you can add more layers on top of those three but let's finish it first so this will be ground select the point filter and give it a Target attribute of ground this is our tag then select your transform points and just slightly set up the scale minan to one and I'm going to set up the scale Marx to 1.1 I'm going to put zeros to my rotation and for this I'm going to put 20 and minus 20 and for the offset I'm not going to offset my ground at all and after you created the ground layer what you need to do is we need to apply the hierarchy so I'm going to minimize drag and drop apply hierarchy open it and connect my output from the merge to apply higher after that what is left is we need a static mesh spaer so I'm going to right click static mesh spaer I'm going to connect the output over here to the static mesh spawner and in order your PCG to grab the materials from this piece because right now when you start spawning your mesh your mesh won't have materials over here and it will be gray you need to click here by attribute material override open it and add one index and name this material so by putting here material your static mesh spawner will will spawn the mesh and we'll get the material information from the mesh and apply it to the PCG spline that we are creating keep this in mind if your material is gray you need to do this all right so far so good but as I told you if you need more layers let me show you easily how you can create more layers and you can get rid of all those merges over here the easiest way that I found out is by duplicating the point filter and let's say we need here to be a bush tag so I'm going to name this bush and I'm going to transform points again because I'm changing the all the elements all the 3D object that has Bush I'm going to connect the inside filter and I'm going to connect it to merge I'm going to disconnect everything and I'm going to connect it to merge and what you can do over here is you can connect the outside filter from the ground connected to the point filter so we are getting from here and we don't find anything that includes attack ground so we move forward to the operator which includes uh Bush tag then we turn transform everything that includes Bush and if we don't have this I'm going to connect my outside filter over here to the merge and from transform points we go to the point filter again so this will be let's say my grass layer and if you want to add more just copy those paste them over here and just move the merch and connect the final elements to the merch and connect each next element with the point filter and transform points to the next tag that you want to use so this is the easiest way that I found out if you want to have a lot of more different tax over here in order for you to manipulate them and randomize them across your spline path now after we create our PCG spline graphcore one what we need to do is we need to go back to our PCG select the blueprint of the PCG and here in the PCG we need to select our instance so I'm going to select here and I'm going to choose my PCG spine graph one I'm going to compile and save and we are ready to test and one thing that we forgot is here and the PCG mes selector weight we need to select an attribute so go and select PCG mesh selector by attribute and after you select PCG mesh selector by attribute you need to say the attribute name which is mesh and then we need again to buy attribute material overwrites and add material then click save after we make this fix then we are ready to test if our new created PG spine graphcore one is working I'm just going to go to my PCG select my PCG spine one drag and drop it and as you can see it is working pretty good now how you can manipulate the spline over here when you select your BP here in the details you can see your spline and you can select your end point of the spline and start moving it all the way over here and right now as you can see we have only two pieces this is normal because we didn't tweak them up just go back to your spline graph click on your spline graph and if you remember guys here we have a spline sampler and from this spline sampler when I select it we can add a subdivision per segment so if I add two you can see that we are adding more subdivisions from the segment this is one segment so we are adding two let's add three 4 5 6 7 8 9 10 and that is how you're going to test when they start overlapping so create one piece and start tweaking up and see how they going to start overlapping all right and in order for you to add tag select your piece that you're working on click edit select the rock here and if you want to add a tag search for tag and as you can see here I've added the T rocks each mesh that has this tack will start transforming and shaping from the PCG graph settings my Tre over here has this three tag and so on and right now you can see that you have this repetitive pattern and it's not working and here if it's not working just double click on your PCG SP graph and over here in each transform point we need to apply to attributes so click here apply to attribute and attribute name should be relative transform relative transform going to hit enter and now you can see that the Tre start working we're going to do the same for the Rocks observe here for the Rocks I'm going to put here the apply attribute relative transform hit enter you see the Rocks start working for the ground do the same you see how the ground moves and for the grass we're going to do the same same hit enter and our grass moves click save and now you have your perfect pad over here randomizing a lot of elements in order to create this kind of path that you want with different kind of elements just from one single piece and as you can see here it looks pretty good if you take your time to scatter around the elements correctly and break up this repetitiveness you will have an amazing path tool that you can use in your games so this is pretty much how you can create spinee pads using the PCG tool and in the next following videos I'm going to provide you a lot of additional PCG tools that you can use in order for you to help you create your massive open world with just procedural tools and without a huge team of artists so thank you guys for watching this video if you are not subscribed to my channel subscribe to the channel 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 UD me 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 un real Eng 5 so if you want to keep evolving yourself Beyond just creating art in EN real Engine 5 and roll now so I hope you enjoy 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 $499 and with your pledge you're 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
Info
Channel: CG Dealers
Views: 15,924
Rating: undefined out of 5
Keywords:
Id: ZJO_ss7ewUA
Channel Id: undefined
Length: 22min 25sec (1345 seconds)
Published: Tue Feb 06 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.