Building Game Friendly Assets | SideFX | HIVE Workshop

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello welcome everyone and this is the next part in the workshop so here we are building the cemetery so in this talk i want to talk about how i built a cemetery but also how did i bring it into unreal because part of what we generate we want to also open this into unreal engine or you could also use these approaches to open this in unity as well if you have seen the previous workshop you will also get some information about how things are working in houdini some procedural approaches and some basic understanding so again in this video i want to talk many about the cemetery scene and bringing this in the game engine so the cemetery scene itself here is some shots from the game engine so you want to have a few procedural assets and procedural placements of props by a houdini tool have this whole area automatically being filled and calculated based on rules we are making inside of houdini so an artist could for example draw the area of the cemetery and an houdini tool would then calculate whatever is needed for that so in houdini itself we basically then have this as final result so we have a terrain and we will have points on that terrain and each point will have contain data on what model to use which is called instancing so each point or the point cloud has an instance attributes so we also then have a unique parameter interface where we can play around with values to generate different results so in a moment i will actually then jump into houdini and actually go into the tool a bit more but here's just like an overview of that some other things we built for this tool was a cemetery was a procedural tombstone generator which is a small tool to generate variety of tombstones as you could see here i can have a basic one i can for example add some basic candles or it could make it destructible by breaking up some chunks here and there and things like that another procedural tool was here for the tomb itself so we could have basic parameters to change the scale or the size so we can make it smaller make it wider we can change the roof style we can change the door there so we can just play around with a lot of different parameters to make sure it works in our scene or generate variations also we have trees which are also procedural in houdini and specifically here we use the lab3 tool set so if you have been using side effects labs you have the ability to have the trees for that and this is sort of like my final i would say assets i have used to make the final scene so again all assets have a procedural touch or background so again the tombstones procedurally generated doom the tree the grass the stone fans they all have a procedural background or are made in houdini so for example like the defense it's it's not like a full procedural tool it's just like a procedural approach but not like a full tool like the tombstones for example like the tombstones were very useful to have its own tool since i want a lot of variation there so the topics i want to talk about in this workshop is giving you some overview and some detail on how the scene is built on how to to give you some context on how it's approached and also when i take it into unreal you also know that what's going on now secondly is then actually preparing for houdini engine so i want to prepare some data or maybe delete certain data so we have a clean result as output for houdini engine to use in unreal and unity so the scene itself so i'm gonna jump over into houdini for that later but the main things i want to focus around is building the terrain having certain inputs having also talking about acid placements so these sort of our three main topics that are quite important here uh to make the scene so again we need the terrain as as ground to start on we want to have user inputs to make sure we have artists controlling where certain positions are and then we also have our asset placements like where do i place three where do i place a tombstone things like that the next step is we have the houdini engine so if you would be very new and did not watch all the workshops hooding engine is basically a way to open houdini files into game engines or even mox and maya so we have a houdini user making a tool they can share that tool and they can then use that with other artists making something in real or unity and they don't have to necessarily have to know who they need they could be known with any artists and they can just open and play around with these tools by the plugin within the engine so if i make a procedure 3 they can open the procedure 3 and play around with the parameters i made for them so to prepare our data than with houdini engine there are a few areas where i want to talk about so preparing the terrain so how do we actually get that terrain in the game engine we then also want to talk about instancing we can also automatically assign materials and also talk about collisions there are also different types of data you could prepare and handle but most of the time you will many uh talk about instancing terrains and materials do those are like the three things you will often uh need to prepare data for to work nicely in houdini engine uh the docks will tell you even more about what you can do with these plugins so i can heavily recommend you searching the houdini for in real documentation so also each game engine has its own features sometimes like sometimes there are features from unreal that you could use but sometimes there are also features from unity that you can specifically call with a group or using instances attributes uh things like that so definitely worth checking out the documentation on what is possible with certain packages like unreal and unity so with that said we are done with the small presentation and i want to jump into houdini and actually talk about the network and what's going on so here we are in houdini and we have our scene so i have one main tool here again where i calculate the terrain and all the points where my model should be like i mentioned i have built other tools like like the tombstone maker here where we generate tombstones and i can have uh different types of tombstones like you could see here i could generate them so in previous talk in previous workshop there was some information about that as well but yeah you can get these files as well and look into more detail also here like a small tomb maker where we can play around with this as well and then here again like if you're interested in making procedural trees check out the lab tree tool set so if you just type in trees you should be able to see the lab 3 tools so these are all available for you for free to try out and use we also have tutorials covering these so check out these tutorials as well so let's go into here our main tool and talk a bit about that first so here we have our tool and we can open here our parameter menu and we can see that we have a lot of different parameters that we created so again this is this workshop is also meant for someone who's already a bit familiar with youtube and knows how to make custom tools and parameters like you see here so i have different parameters like if i want to change the seat so i could play around here with the seat and then i will take a sec and calculate a new version so now we have a new version of that so i can change it back to normal and now we have that version so again i build a lot of different variety of properties and sliders you can build more if you want to like you have the option to build more so i have specific options for cemetery like how many tombstones i want i have options for the tree how much trees we should have and on also uh instancing which i will talk about later when we bring this into a reel so let's jump into the tool and give you some context on how this works so here if you would open the tool i have made a small color coding so the green one is the terrain so this will be all about calculating the terrain and integrating the shapes into the terrain then here i have this orange box which is basically the user inputs so like if i draw a curve my terrain has to adjust to that curve so these are like inputs for like curves and so on and then here uh we have placeholder models these are just models for previewing what's going on here and furthermore i also have like the blue area here which is then for preparing the data for unreal or unity so let's start at the beginning and talk a bit about how i created the terrain so here we have this block and this is the base the range shapes so overall this is quite simple in setup it's not super complex here so we have our basic height field we're going to make sure we have a good size so in this case i took 500 units uh and then with the scaling difference between undrill and houdini which is always 100 units difference this will then be quite larger terrain already so with that terrain i'm gonna make a noise on that and we're gonna have a noise like this and a one that's a bit more rougher in shape and we're gonna blend that together so we're gonna have like the sort of like the mountains of the rough noise and then the flat surfaces from the other noise so we have this result the next step what i like to do is then the slumping so here if i look at that this is basically smoothing the area so if i would remove this lamp it will basically sort of simulate a dirt on top of this so it sort of feels like it's like a dirt layer and that we can also spawn grass on that as well um the the slims is also based on a mask so you need a mask for that and then next step is also setting the resolution and if i dive into that i just made a switch and important here uh is that we make a that are specifically game friendly so each terrain system from real urinary has specific resolutions for terrain data so in this case it's 505 instead of the 512 so you're going to have to look up what's the best terrain resolution houdini hodini engine will sometimes automatically convert that to what's the closest but it's always a good idea to set it properly from the beginning now next up here in the network is the fencing around the cemetery so here i'm going to project a shape to define my cemetery area so here the shape is actually from my input so here i have a input which is this curve as you could see and you're going to basically also move up the curve 200 units so i'm going to make sure it's actually flying above my terrain and the reason why it needs to be flying is because i'm gonna project this with the ray so in the ray note we can project this based on a vector direction which is minus one so basically look down from that original curve so here's my curve and we're gonna say look down until you hit the terrain so that's basically projecting on the terrain and i'm going to use then a pulley wire or you can also use a sweep to then give it some geometry and then we project that into the terrain so of course the more quality you have on your terrain the more detail you will see so in this case i don't have that much detail going on so you can see it's not perfectly so you're gonna have to choose what you want to see like more quality or just something of course lower your quality the faster it will work so next up let's move on to creating a cemetery area this is basically then a mask the red mask to sort of know where cemetery areas are in this case i have two areas so i have here and here a symmetry area and i use a very similar approach by basically using this curve that we projected and closing it so in the close is basically then a add nodes which is set to closed so if i then take this we are opening and closing those shapes then next up is then using again some projection but instead of geometry projection you can use mask by object so we have a mask and i'm going to add some noise in there so it's not consistent and also important here is i'm going to save the mask to a new layer called cemetery area and that is very important to know is that we can save out this information to be later be called back again so laser i will use this back as you will see the next step is the walking area so here i have this walking path and again this comes from a curve so the same process over again so i basically draw a curve and i put it up over and i put it high up in the terrain then again i'm going to use here projection of the array then i'm going to resample this then i'm going to use a sweep with a noise value and the b scaling so we have this randomized as you can see we will have this randomized shape here so it's not super consistent then we're going to project this into the ring so as you can see here it's super subtle so we have that shape projected and i'm also going to make a mask from this so we can again save this into another layer which is called pad area so if i would go here to information i can now see that i have an extra layer called symmetry area and pot area so i can use this to later define for example don't spawn trees on the pad because i don't want that and i want to walk around on the pad now next up here is then placing the tombs so here again the final result is a mask but how did i do that is by again using inputs from the user so the user would place boxes in the world like this and then we're going to use this and extract the bottom area so here i'm extracting the bottom primitive i'm going to make sure it's a bit bigger so i'm going to use a fully extrude with the inset value so it's a bit bigger in shape and i'm going to just use again use the projection here so we're going to project this in the terrain and also we're going to project this with the mask option here so we have the area where this house or tomb will be so here i'm also using the expanding mode so we are this is what you get out of the box so we are actually also taking uh that sloped part as well and i also want to blur that as you can see we want to blur this a bit better in the terrain because this doesn't look that nice so we just gonna make sure it's like integrated better so our final result will be that our house will be placed on top of this so we have that information ready and nicely integrated with the terrain then again same process as before i'm going to save the mask in a new layer called tomb areas these are all the areas where i have a tomb so again i can know don't spawn any trees or rocks in the area because i have a tomb there now we're gonna place the tombstones so again we will do a projection of that so we will project those in the terrain so these small bumps so the reason why i do these small bumps is they actually feel like the dirt is going a bit upwards when we place a model and i've created a small network for this so let's look at that network i'm going to mainly look at this one over here so this is where actually calculated tomb stones so here at the beginning i'm going to call my cemetery area so here i'm using the height i'm here i'm again using the copy layer but i'm saying like hey call the symmetry area and save it into my current mask so if i would not do this this is my current mask so i would like to see my cemetery area as current mask then i want to combine this with for example the pads and the tombs area so i cannot place any tombstones inside of the pad because i want to walk there and also when we have a tomb here don't place any tombstones there so the next step is a scattering based on the masks so we can use the height field scatter node so we can use this based on the masks and then we scatter around some points so these are quite random we can also then fuse them with a on based on a grid so here if i make this a bit bigger you can see that we are snapping to the grid here so they are specifically now spaced out so they are a bit perfect now so again cemeteries are often a certain structure in a certain layout so to quickly get that i just use a free fuse by grid now we're going to use this uh move this upwards and i'm going to use the same technique i'm going to use the same technique as i did with the with the method and i'm going to use the same technique as i did with the curves so i'm going to move them up and i'm going to project them back onto the terrain to make sure they lie nicely on top of the terrain so since i did the fusion grid i'm not sure anymore if they are nicely on the terrain so and we also gonna make sure if there are any overlapping points because that could happen fuse them back together and then here is a interesting process for rotating them so here if i look at the results you can see that the rotation is based on that call that you see here so i basically group or cluster certain points together and give each group or cluster a specific rotation so you could see that these orange ones are rotated are rotated in that direction but if i look into another group they are rotated for example in this direction so each group has a random direction so it feels like it has some sort of structure but also some randomness in there so the first thing i did this is using the cluster node itself so the cluster node itself here if i view my labels you can see that we have colors for each of them so each area is now a cluster so the cluster node is quite useful for creating these so you can see that here we have these groups or clusters of points so now i do a loop and i do and i just use the and i just using the four each by point so you can just use that one and we're going to make sure here that we're going to use the attribute for looping value so here we're going to fill in cluster so that's important to put in here so you will see that i will also do it here so i'm going to import cluster so we're going to loop over each cluster and we're going to give it an audience values the ordinance value will control the rotation of an object so in this case i'm also storing this in the detail mode so and i'm gonna then promote it back again to points so the reason for that is that we have the same value on all points if i for example directly now use points here and make this in the sprite sheet we will see here that we will all have random values and i want to have one consistent value for all the cluster so i'm gonna just use detail and in detail here we then have one specific value and if you promote that to the points back again we can see that we have just one consistent value i mean there are some other ways you could do this but simply promoting that will work so that's finished so i have a random rotation for each cluster and i've also added a small jitter so the jetter will basically uh do a position offset so if i would increase this you can see that we are just jittering with the position and i'm going to keep this quite subtle and this is even exposed as a value so i can get some more variation and step away from the perfect grid structure i have so this is basically then my result when i would copy my models on that so this is my output so again i'm outputting only points here so this is my output just a group of points which then will later be used like you see here to copy and mobile on then i've also have a special system here for adding trees because i already was thinking like i want to also add specific trees and in this case i took this took a small note here to actually add trees specifically around in the cemetery area so here if i look at where i have my mask available this is done the area where i could scatter around this tree and what i'm also doing here so i have scattered around a couple of points i'm also using the points that i had from the tombs to double check if there is not overlapping with my trees so here i'm just copying a sphere on the points and i'm using a group by bounds to check if my trees and my tombstones are overlapping so i know that if there would be overlapping that that might be problematic and models could glitch in each other so i could just delete that so that's basically my output so i have two outputs the tombstones and the trees inside of the tube area inside of the inside of the cemetery area that's about the tombstones then next up here is a tree so i already spawned some trees here in the cemetery area but i also want to spawn here uh trees overall so here i made a mask that is basically calculating where flatter areas are so mask by feature and i'm inverting this because this is the slope and if you invert it we get the flat areas then i cannot use combine with certain masks so don't place any weathers cemetery area or the pot area so don't place any trees there i'm going to specifically here's like separate the cemetery area and i sort of like spawned trees uniquely in there as well so you could have some more control about how many trees actually want to have in here and then next up what is interesting is calculating the flow field so this is a flow field calculation this note is pretty interesting like you could see like the the masks like the moss like the mask you're getting here is super interesting to look at and you really see like the flow and i'm gonna use a layering here and i'm gonna subtract that so this will give me this mask which is quite interesting so you will actually see certain flows in there so i'm subtracting basically this with this and then we get this so again height field scatter and then we scatter around points based on the mask here and i can combine this here with the trees from my cemetery here from my tombstones here and this has done my results i'm going to copy a small sphere on this and this sphere is basically used to lift where we have uh trees so we just have like little bumps where we have three so where the tree area is growing like the roots of the tree might actually lift up the ground a bit so that could be interesting to also integrate here so you don't have to do this you can also play around with the sphere like if you need more of this like you could see like you can boost this a lot or you could make this more random so this can be just be an interesting idea to again integrate the model with the terrain better um then so again like same as we did before we're gonna have the mask saved out into a layer called three area so later i can call this back again so we're almost done here with the terrain and the last thing we want to do is setting up here a road simulation so we are actually doing a simulation from debris and water to make it more natural you so you will see after the calculation is done like you could see here if i would turn this on and off you can see that we have nice details here in that terrain so that can definitely be interesting if you're looking into that so this is how the terrain is set up so further i have a bit more here about the rains and this is mainly for game engine so i will talk about that um in the next part so this is basically what's going on with this whole system and how the terrain was made so now for our actual models we already have some information about it so i know here for example i have my tombstones data so if i look here so if i look here um so if i would for example now have my preview scene here so this is my preview scene as you can see with very temporary models so for example i already have the tombstone information so here we calculated the tombstones so i can just now use a copy to points with a placeholder or template for just houdini then also here have like the defense the border which is this one so again we already have that information from the ray here so all the way back up here i have that information now specifically here for this one is if you take a closer look at when i draw when i draw my curve we can see that the points are not super consistent so i did a resample and specifically here i did the resample on this specific number because that is the size of my fence so the points are now evenly spaced out and if i'm going to copy my fans on the point it's specifically this size or scale it needs to be so that's uh good to know and it's also sometimes interesting to also set this to a subdivision mode uh to sort of like make the curve a bit smoother so that's a bit on that um so then we have that result i can also see here if i look at the end of my curve of my fence that it is open and i made a separate system here to then place one pillar here so here we so here i place the group range node and i just took the last point here so here the so here the last point is not selected as you could see and then i basically then uh and then i basically can use this as group so group one is basically that that last point as you could see uh also something important i have not told you here yet is that i use the orient along curve nodes and this will basically make sure that our rotations are correctly so here you have my fence and if i would not use orient along curve we basically get this result so my fence is totally going nowhere we don't have any direction but if i use orient along curve i specifically have this direction where i follow the curve that's just good to know uh so that's a bit about the system also then same again here for the trees so i have the information from the scatterer here where i have the trees and then i'm gonna copy and model on that so i know where trees are so for the next part i want to bring this in the game engine so in unreal engine in this case so you can do the same process again for unity but it might need to have some different approaches but overall the steps would be very similar so here we have our setup and before i sort of like bring this into unreal i also want to talk a bit about unreal itself so currently here in unreal i have a scene this is already a scene that has been generated as you can see and what we want to check is our plugin installation first so we're going to make sure that our plugin is installed so here i have putting the engine so that means i have it installed and we also need to create a session so we need to click on this to create or to warm up the tool now the my tool is warmed up and you can see that this is also now grayed out so in case it would for example not really connect immediately you can try to create a session here again so sometimes you might need to click this another time if it might not fail if it might feel to connect also here we can go here of course to our plugin settings of our scene of our project and we can see that we are using houdini engine version two and this is also specifically tied to a version of houdini this is also quite important that if you would install a different version of or uninstall the niche versions the houdini plugin is often bind to your houdini version so currently i'm using this version uh as a demo here so it's quite important that you remember that to make those uh versions and to update those files again so we have videos about installation but basically what you do is you need to drag and drop a certain folder into the plugins folder of houdini engine and then that should work so now my tool is basically warmed up so we have within the engine enabled and we can basically then drag and drop our tools inside of unreal so our already wrapped up this student to a digital asset so as you could see here i already have my digital asked here so already made that and i can just like look up the location where i originally saved this and drag and drop that into unreal so there that's nothing special there uh so for my current scene here i'm gonna then quickly uh start removing things so i already have uh like baked out results so i want to just delete all of the things we have so let's select everything here and i can probably just delete that so now i don't have so i only have here some of the lights and i have some particles i think i can also delete the particles here for this demo so i just have an empty scene with some lights now and i can now just drag and drop my tool so again drag and drop it and it will immediately start calculating so again it will do a whole calculation of a variety of things so it will calculate the terrain in certain positions the three locations things like that and this is then the final output so we have our terrain as you can see with the trees uh the houses and some other things so before actually jump into more of this i want to like break it down a bit and start a bit from scratches let's talk a bit first about bringing in the terrain so what i'm also going to do here is i'm going to place my tool here in the middle of the world so i'm going to reset the position switch actually in the middle of the world that's just useful uh so you can see that we also have done the same interface as i had uh inside of the knee so now let's jump back into houdini and in here we're going to have our tool and let's talk a bit about the terrain system so here this is my output node that i have so everything that is connected will be seen as output so since i only want to show the terrain let's output the terrain data here so let's plug that in over here so now i'm only outputting the the terrain as you can see i'm not outputting any points or meshes just the terrain so what is special here is i have this process going on so what is this process this is basically the mask or layering setup for a game engine so what we had here is previously we had our terrain and i'm going to just clear out the mosque so we have a clear result and i'm going to start making masks or layers to drive a certain material inside of a game engine so what i'm going to do is i'm going to start building up a layer so i'm going to start selecting the dirt areas and i'm going to mask that again with some other areas here and this is then what is called layer dirt what is also special here is i'm using actually also information from that they wrote notes so here i'm using the debris but my root is not enabled so maybe i can go quickly switch to that so i'm going to go here and enable simulation this might take a sec so of course if you do this in the game engine it will also take a moment to calculate since this is since this is an actual simulation so now we can see that we have way more interesting masks here so before it was just like one big area but now it's actually sort of like details about certain simulations or things falling down because this is on a sloped area so you have more interesting detail so again we have a mask and we're going to save this to layer dirt now next we want to make another layer and this one is here for the grass so i'm going to calculate the flow field and this will automatically also overwrite the mask that we have so it will just overwrite that and fill fields are quite interesting as you can see like really interesting results what you get from flow fields then we're going to make sure we combine it with some other masks like you see here so we are basically calculating the flatter areas here again and we're going to start combining things together so again i would use the subtract dirt layer the water layer and add some of the three areas so this is where i would like to see my grass so i'm going to call this then grass layer so we can also see that we also have some nice detailed grass on the side of the rocks here so it actually blends a bit with the grass on the border with the rocks so that could be cool um the next step is i'm actually calculating here the back to the rock areas rock shapes and cliffs so i'm basically doing a invert so i'm going to use a remapper and i'm going to say to the mask just in for this so the minimum is 1 and the maximum is 0. so if you would just reverse this is the normal mask and if i invert this we have this must so again we can start subtracting things like the third area and we can again do the same process of saving this into a layer called rocks so we have three main layers dirt grass rocks and these will then be used in unreal so to finish off i'm gonna just clear off the area so we don't see that i'm also often would visualize this already here in houdini with a quick shade note so i'm going to visualize the layer dirt grass and a rock so i know in houdini that my information is correct so if i would see something weird that means that i made some made a mistake in a certain operation there now what is also important now is to actually delete all the other layers i have so i'm only going to keep the height information the dirt grass and rock information so if i would look up here the information about all our layers we can see that we have a lot of different layers so we have the cemetery part doom the tree bedrock water the flows things like that so we have a lot of different layers so if you would open this in unreal it will import all of that information but you don't necessarily want to have all of that information so that might be too much to handle so now let's view this in game engine so i'm gonna go here and save my assets so in real we should just click here recoup or rebuild and then it should update our scene here so now it's being processed and i currently don't see anything so i might made a mistake or should probably change a few things let's also do a re-cook maybe that will help okay so with the rest with the full rebuild it actually helped on getting my terrain riku didn't uh so with the rebuilt it actually helped getting my terrain since i made a lot of changes like i directly outputted the train and did not calculate everything else so uh that worked so here we have our terrain done so we can see that this is the exact same uh result we have from uh so you can see we have those mountains we have those little areas where we should have the trees and tombs and let's take a closer look at the actual terrain data so if i switch here to my landscape modes we should then have data from the terrain so if i go here to i think it's paint mode we should now see the layer systems here so i see grass and rocks so i don't see my dirt since in this case there is no dirt um and that makes sense because there is something in my tool [Music] because there is some setting in my tool currently that is not outputting any dirt layers so you can see that these layers will get converted into the system here so again if you won't delete any of that like i showed you here in houdini if you won't be able to delete this i can show this you will see all of these layers so here save assets i might also disable here the simulation since i don't want to wait every 10 seconds to be saved here so that's also disable the simulation here so that will just go faster so now it's almost instantly so now if i would jump back out to my normal view and i go here and rebuild my terrain again we should see that the terrain will contain a lot of different data so we only had two datas because i filtered it out but now we should see a lot of different data in the terrain what you can also see here is that the tool takes a lot of time for calculation actually made here a uh like i see like a fast mode and the other thing you could do is actually reduce the resolution or the quality of the terrain so the lower the resolution the faster it could calculate and bring it into unreal so before now i'm just going to leave it like that and talk a bit and talk later about it so if i go now to landscapes we can see that we have all these different layers but again like we have the flow the water debris dumerias and other stuff like there's so much data you could import but i think it's safe to control what you're outputting since you might not want to have unexpected data everywhere from this then let's jump back into houdini and set up things a bit further so i'm going to switch it to normal mode again and go into it so here in houdini let's enable here my blast node again so this is basically again filtering layers and next step is automatically assigning a material so so what you saw was so in unreal here uh you see basically no material like it's just like the default checkering pattern so you want to automatically assign a material so i made a small material here terrain material and i want to use that so we can do this quickly by just saying unreal material so this node will add a attribute which is called unreal material and we'll add then the material so we're going to have to fill in a pad to the location of that material we're gonna have to right click on the material so i have my terrain material here and we're gonna say copy a reference so we want to copy the reference where this is in my project so when we have that reference we can then paste it into here and now it has a direct link to that material instance so if i would now start saving this it will immediately work so if i would now start to recoup my tool normally it should also now add the material as well and as you can see we have automatically the material so maybe switching to enlightenment so you can see that we have the the grass and the gray of the rocks going on you can also see that i automatically spawn grass based on materials so the grass system is built in inside of uh in real here because it's automatically also based on distance so you can see that for performance-wise this is a bit easier to implement since it's automatically done by unreal and for those of you who are interested in the setup of the material we're gonna take a quick look at that so here i have my material and let's take a look so the main thing that is important here is this one here so we have the layer blending modes here so if you just type in like a layer landscape so we can have the this node and then we just basically add uh how much layers i want so in this case i have three layers so we're gonna have three different uh labs here so we're gonna have this so you will need to give this a specific name what you set up in houdini so in my case if you remember it was something which is called growth grass layer and then i have dirt layer and raw clear so basically as you can see dirt grass rocks so this is how this works and then i give this a color so my dirt is here this color so this is basically for my dirt and i also mixed in some noising so i get some variation uh then for my grass i just basically have a simple green color nothing special you could also like do something with like a like this with like some certain noises so it's like a bit variation and for my rocks i just used this gray color so this is of course super simplified because in reality you want to actually make this with real textures and some more parameters to play around with but this is what is it would look like you could also like copy this for the normal map like i did here but i end up not using it since i had some more stylized approaches so you could also like have three normal maps on each layer so that's also possible so there are some more tutorials on youtube explaining more about terrain materials and so on but this is at its core it's basically this nodes controlling the layers of the terrain so with that setup we have our base drain but next up let's also talk a bit about this fast mode that i had here so let's quickly talk about that so i'm going to enable fast mode but it's probably not doing anything if we go into houdini i'm going to plug this back into my system here so this is my terrain so this is basically the fast mode so this is a switch node that is switching between these branches so the fast mode is basically uh checking the terrain system only until here so it's not doing these calculations so it's not calculating tombstones trees erosion it's not calculating all of these things and the reason for that is because this takes more time to calculate than this so this is just way faster for visualizations so again like this is only for visualization and working faster so the artist hasn't has a sort of like a nice workflow where you don't have to wait 20 seconds for every small update so this is just a fast mode which contains the basic information from that so again like the layer system is similar so we're going to have to again create layers for the rocks and we're going to create a layer here for then the grass and the layer for the paths and other stuff so we have that information available so this is basically done the fast mode so if i would save this we would now be using that as well so one of the reasons why i use the fast mode is because i'm going to switch to the next thing is our inputs so we want to make sure we have inputs from unreal inside of houdini and the reason and the way i do this is by using a object merge node so if you would type in object merge this is what i use all the time or often for inputting data from the game engine so with object merge node what we're going to do is if if we're going to go to our properties we're going to basically expose the object level here so i'm going to drag this into my scene into the parameters and this is then basically a special menu in unreal so in this case i already made this so i'm going to delete this back again here but this is how you would add the object merge node so as you can see this is my object this is my input for the unreal uh for the fencing system so i input my curve then i'm gonna actually do some cleanup so it is possible that that there is certain data on the curve that could conflict with my system so i'm just going to clean every single attribute and information on there then i'm also going to do a face note and this is basically a clean up of the line this will just clean up points and i'm also going to do a resample to control the positioning of the points so again i want to specifically space out the points on this distance for the fence and then i'm also using a switch node to switch automatically between these things so if i don't have any inputs use my hard coded curve if i would have an input like say if i certainly have an input it will then automatically switch to then this input here so that's what is going on here so this process about inputting as you can see i'm doing this multiple times this is done for the paths so same process inputting a curve cleaning up the curve and then using this then also then for the boxes for the the dooms i'm not i'm just only using the object merge and there is no cleanup here involved since they are basic boxes that i'm going to use so no need for any cleanup so this is how i set up inputting now let's jump into a drill and show interaction so here we have our inputs and as you can see this is the special menu that i'm talking about so you can see that they are quite special in setup so first thing we want to do is i want to actually have also a curve in my scene so i have a blueprint with a curve so here we can drag and drop that curve and as you can see it's like a basic curve or spline component uh in in real so if i quickly show the blueprint here i've got a viewport you can just add spline and then just add spline here this one so this is a very basic spline and i've also make gonna make sure it's actually set to a linear spline so i just like the linear bit more since this can be more controlled or quickly controlled so what we're gonna do is let's place it here on the surface and let's draw a area for my cemetery so i'm going to grab the points and make a symmetry area like this so we have this curve and we're going to now use our input for our my fans so i'm going to switch instead of curve inputs i want to actually use a world input so something from the world or in my scene so we're going to switch this to world outliner you can see there will be some calculation here and i'm going to make sure i'm going to select curve and i'm going to select this one and use as current selection so it will input the basic curve as you can see here and the tool now automatically sees this as an input as you can see we have this working so if the fast mode is enabled and the resolution is not set too high you should be able to have a quite responsive way of working now so if i would grab this point and place it over here it should only like take a sec to calculate so that's quite fast in working so again like a a artist level designer could go recommend to this and like design a certain level for this cemetery so this is how i would then place this tool so you can see that i'm also here doing like a smoothing of the curve with the resamples it's like smoothing that out and then let's also bring in a curve for the pad so i'm going to make a new curve so i'm going to drag that in here and i'm just going to rotate it like so um and let's say i want to have a pad coming from the middle uh that goes like down here uh to over there something like that so we don't have to be like super accurate as long as the curve is above the terrain you should be fine since you are projecting that and then again same here we're going to choose world outliner so we want to pick something from the world start selecting click on my curve use this as my selection and now i have the path here so again this should be quite interactive so if i would grab the point and it should immediately update so again we are doing some certain like smoothing of the curve so it's nicely fitting so that works fine now the last thing that we had here as input was then the tomb area so we're gonna also uh first of all pick a cube so we're gonna pick the basic cube um and i'm gonna actually change the scale to i think it was something like five that is a proper skill for this i'm going to place it for example here like here i would like to have a tube so now if i can go here roll outliner start selecting use this and now it should also blend with the terrain so if i lift this up the terrain should also lift up as well so we're gonna make sure wherever your cube is we sort of have that left up so even if i want to specifically have this here like a bit higher up it will automatically sort of like blunt that with the terrain so you can see it sort of like left the door tutorial here and this is how you can use inputs and again like building a fast mode is very useful here so that's very important that you might need to think about the artists working with tool that they want to actually have something more attractive instead of having to wait longer so if i would disable the fast mode you will see that automatically my terrain will now take longer to calculate because it needs to calculate some of the like flow fields and so on uh so it will actually take a bit longer so if i would now grab the point you can see it already takes a couple seconds more and especially when you start enabling the simulation so the simulation is not enabled right now so if you enable the simulation it will actually calculate probably like 10 times longer because it's actually doing a simulation um yeah so that's about input so next step and the last thing that i mean you want to talk about is about instancing so how do i now place my models on the point cloud so i have my terrain setup materials work nicely i have inputs that i can control and play around with but now how to actually start placing these models there so we have our network and here is my instancing system so but first let's build this from scratch as example so let's grab some of our instancing information so for example the trees so here i think i have my tree information so if you remember i scattered around a lot of points with the height with scatter and i want to use this as instancing information so what we want to do from the points we want to create a attribute so let's find some space here i'm going to just build it on the site here so we're going to use create attribute i'm going to grab my points and i'm gonna use that over here so in this menu we want to add some things so first of all we want to specifically add a name to this and we need to use the name called unreal instance if you use unity uh you will just use unity instance so that makes sense right so in real instance it's also actually the same for that uh material so if you have like the unreal and uh unity material it's actually also just it's basically in the naming and also in the pads for assigning that so then it's quite similar that we also have to set this to a string and we need to put in again the pad to this location and it's similar to what i just shown you with the material so we go to unreal and unreal we can for example grab our models here so in this case i want to scatter trees so i'm going to right click copy reference and we have that reference now so in here we're going to just then copy paste this and then for viewing only maybe let's output the trees only so here that's outputs only this so this is now my output which is basically points but when we import this it will actually then be our trees so let's save this and then rebuild our tool so if everything goes right we should only see our trees and as you can see this works as expected so i have my trees now scattered around the scene this is basically what instancing is so we have a point cloud and we're going to say copy this model on points and that's it so this is what basic instancing is now you can actually do more than copying here models you can also use blueprints to copy the on that as well next what is also important is actually merging the terrain and instancing for example would merge near to the merge nodes my terrain so this is my terrain with my instances we will have actually a small warning here so we have a small warning here so the warning is saying that there are conflicting attributes so we're gonna have to keep that in mind so here let's take a closer look we can see all our information so one of the interesting things here is that my point clouds the points hold different attributes as you could see and they are holding different attributes than my terrain for example my train has information about where the grass should be but my my points here only may hold information about where the tree should be and what model i should copy on this so when i merge these two networks together they will have conflicting attributes or information so what is the common issue that can happen is for example something like this here so we can see that we merge different data together and it doesn't know what data to fill in so it's going to leave it blank or fill in zero so here for example for instancing my models on my point clouds it knows exactly what to instance on my terrain it doesn't because it also doesn't need instancing so we can leave it empty that's no problem but this can be an issue for example with scaling so we can have conflicting scaling information like we could see here already now another example of this is let's place a quick point here so i'm just going to place a single point and on that point i'm going to create an attribute and i'm going to create an attribute called scaling and scaling is also a value which is controlling the scale of instances so if i now would also make scala factor three since it has an x y and z direction let's fill in this one two and three so now let's merge the scale with my trees so now let's look for the scale value and we can already see here something interesting so this is a problem that can happen if you don't see your instances this can happen when there is conflicting scaling information so here i have a scale that is conflicting so i can for example quickly show this if i would now use this here as output and save here this information let's then recook our tool and you can see we have nothing in our scene and this is because there is a scaling conflict with the attributes so here if i actually go to my components of my tool we actually have a certain instancing of my trees but i don't see them in my scene so one of the reasons for that is because the skill is set to zero and we don't see it because the scale is zero so it actually has an instance so we can see that here that there are instances created so it has that information but we don't see it so here we see that there are actually our instances so again coming back here in houdini we have here our scaling conflicts so we have our p scale value which is basically saying the overall or the uniform scale of an object and then we also have the scale value which is specifically scaling the x y and z of a model so if i merge something which the point here doesn't have p scale in it and the trees don't have scale it only has p scale so here what cause what will happen eventually is here this issue where my p scale is zero so on my single point here the p scale is zero and on my model here uh with the trees our normal scale is actually zero zero zero so that's basically an issue that can happen that's something important to keep in mind uh that could happen and this could also happen with other things for example with the rotation for example so here with the rotation or the orientation or the normals this can happen as well where certain values could be zero if you don't define them so that's something important to keep in mind so let's delete this here and i'm gonna show you some examples of how i set up the final instancing now so here for the final instancing here are some of these examples so here is defense so what i did first for defense was creating a b skill value of 1 then also setting a overall scale value of 1 and then i convert the normal to a orient attribute because i personally prefer to use orient instead of the normal vector to a correct rotation so you could see that normally if i would zoom in and maybe go here to the scale we can have a normal direction as you can see to guide my model's orientation then i'm also splitting this up uh if you remember correctly i i had like a stone here so i had like the fence but i also needed a small pillar at the end that this is basically what i'm doing here so this is again the whole fence model and this is then only the end here but i'm going to place a pillar so this is the process of creating that fence now creating the trees is then very similar i'm going to also make sure i have an audience available in this case already had it so that might not change that much also if you are looking forward what's in here it's basically using the normal making making an instance transform you can also use the effector and then converting the matrix to x4 matrix to actually a quad quahatrian or vector4 so that's what i'm doing there then for the trees i'm also gonna here at a unreal instance but i'm gonna randomize between multiple trees so this is quite interesting is that we can use the randomizer on custom discrete here so custom discrete and set it to a string of course and we can give multiple values so i can add more if i want to i can add more of them so we can have multiple variation entries so they are not all the same and then when i have that i'm going to also add a scale value i'm going to add also some custom randomization in there then for the tomb stones i did the same thing where we have to custom discrete and we're going to add multiple variations here i'm also going to here use then a scale and p skill value so i'm also always going to double check is there any scaling and p skill value available so i don't have that scaling issue that i just showed you then i also have then my tomb so again same process converting making sure i have my instance we can have here specific blueprint and we also then here have then our scaling so that's basically how it's done so we have all all these instances so i merged them you can see that there might be some small warnings so as you could see there there are some issues but if they are not uh directly infecting the scale or direction then it's fine this is also for the fast mode since i don't want every model in the fast mode then i'm also using the add node to get rid of any other geometry i just want points and this is done my result so the final output here is first this is important first by instances then by terrain always keep that order that works for me most of the time without any issues first instances then the terrain and then we can now save this and now we have our full tool and let's talk a bit more about the tool then in unreal so now with that setup let's then quickly rebuild this and then we should see now a final result uh with everything ready and we see then our results so as you can see we have things right so here the cube um maybe also enable uh actor hiding game so we can actually see what's going on here so that works now let's also look at the at the instancing so here i made a specific menu for instances so i can have or control here what models i should use so if i quickly jump into any uh so if i go into my interface so here at the bottom i created these instances and again you might have seen this uh that i've actually you know like i can just drag and drop these in the interface so again if i would for example if i for example would like to have here like tombstone if i for example would like to have another tombstone variation i can just here grab this and add this here under tombstones and call it tombstone number seven or something like that so this is how you can create that custom interface so so what is interesting here in unreal then is that we can actually drag and drop these models in there so currently i'm using static meshes but i would like to see the blueprints used so i can just drag and drop the blueprints in there so i'm just going to drag and drop them in here and you see that my scene disappeared but i'm going it's also re-cooking here as well so i'm going to drag and drop so you can see that the tool will automatically always try to stay up to date and calculate things uh i think i missed one so we have that ready to go and you can see that also one of my blueprints is actually a small i would say gameplay element where i have a trigger so this is a collision trigger and when the player walks through it the hand will basically come up and break through the stone so let's test that in game so here i for example have one of these triggers so i'm pressing play and when i walk close to it it will actually then creep up through here the same it will then show up so it's just like a cool thing you could do here as well like this is also again like a blueprint with like lights and particles so to make it a bit more foggy around this area so you can play around with these things so again like you can instance blueprints uh particles lights so you're not like limited to static models you can just as you could see like half blueprints also automatically braced around and again you can use gameplay elements like you could scatter around certain props that have a certain gameplay interaction like you see here with like the collision thing this is just like a blueprint so the thing also about blueprints is i can i can actually now grab this and place this around so with a static mesh this will not be possible always to actually grab it as you can see for example i cannot just grab one single tree or one single fence since since this is really like an instance uh area so these are all different blueprints so we can grab them separately and this is then basically my tool so again i can change the curve here so everything is perfectly along that curve and to finish off my terrain i would then also enable here the simulation here so the simulation will make it much better since it will also simulate some grass here and some dirt here as well and you can see that the simulation is already done here so we'll make it a bit more blind and i might notice an issue here that i need to reset the simulation since it still has some information from my terrain in houdini so what we could quickly do here is go to hemi uh and then hitting here still have my menu open so i can go here to the simulation and i can drag and drop the button into my reset here so if i would go here and then simulation and then just reset simulation and pressing apply so now if i would uh re-cook my tool we should see the button so i can now just click re-simulate preset simulation and it should like calculate the tool and here we go that already worked so you can see it automatically we'll add more of that grass so we will have some more grass details we are basically done with the overview i'll also note here that my border is not showing up so that might be an issue with instancing so offense uh and i think i have to and i think i have here two times the c model so again we can boot to models grab my pillar fill in my pillar and done so of course my pillar needs a specific pivot point as well as my fence they have like the specific pivot point in the stone here so they can easily spawn and rotate like this so i can have more control when i procedurally place them so this is basically an overview and a detailed view of how i brought this in the game engine some setups you could do and again there is so much more you can do and i can recommend you checking out the documentations for that if you want to see more information on what is possible with this plugin thanks for watching everyone i hope you enjoyed this information about how to build a scene and how to actually use houdini engine
Info
Channel: Houdini
Views: 4,460
Rating: undefined out of 5
Keywords:
Id: bZAXVKOix1E
Channel Id: undefined
Length: 77min 2sec (4622 seconds)
Published: Thu Jul 08 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.