World Machine & Splat Maps to UE4 Workflow

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video I'm gonna walk you through the process of how to set up your world machine file or you can use any terrain generation program the file sizes you need to be considered of when exporting out your data as well as how to set up some of the mass that you can use to pre-paint your different layers on your terrain in unreal engine so let's go and get started so the first thing that I want to preface is that this video isn't sponsored yet at all by world machine I personally use world machine in my workflow I like it I think it does great results however I'm going to try to cover the principles that apply to programs that allow you to generate terrain based off of height data or to create that height data as well as creating some masks so even though that we're using world machine hopefully these principles will apply to other programs so with that being said let's go ahead and dive in and I'll show you what we're going to do in our setup for world machine so here I have just what is relatively basic so if you aren't familiar with world machine it is a node-based workflow what that means is that you can create generators selection masks all different kinds of things and you work with them in a node based workflow so for example what's coming out of here is a height field so if I click this this is the noise that generates we do some crushing of the levels so you can see input output we then do some erosion so there's our input based off of that curves and some erosion so that's a little about it so this is this is what we've generated with our terrain it's very basic you can go crazy with that but I do want to make sure you understand that this isn't about using world machine it's really about the information we get out of it so let's cover that so a couple things that I want to cover first is how you generate your height map and then how you generate masks which you'll see later when we set up in unreal so with this I've just got a basic height output now if I double click this take note of these settings so when you create your height map you want to make sure that you're using a raw 16 file and that's it now I've set this to go ahead and output to a specific directory every single time and that's fine I can write the output when I build it it will output all you need to know is make sure you output a raw 16 file for your height map okay that's the first thing I'm gonna jump down here I'm gonna skip this this is simply just colorizing for what essentially is a splat map now there have been questions about okay I want to generate a splat map what is a splat map a splat map is basically just taking bits of information so for example like a flow which we'll have right here or maybe like a dirt pass or maybe cliffs and you put those into respective RG and B channels so that's really all the splat map is now you can use this in your material setups I would caution doing that simply because in order for you to get the detail that you want so for example if let's say we've got this flow we want that to be you know like a dirt eroding from a mountain if you try to use a splat map inside unreal you're going to have to have a very very large texture to make this all work so say for example could be a 4k or an 8k that gets very expensive very very quickly the second option we have which is what I'm going to show you here is that we can still generate those Maps effectively think of them as masks we can generate those out of world machine and still use that information when we go to paint the different materials on our terrain material so that's some process we're gonna do here so I'm gonna skip over the splat map don't even worry about that but what I want to do is I still want to generate some of those masks so I'm going to click through these so you can see this is cliffs we've got planes we've got dirt we have a waterbed and we have a flow map okay now the key parts because I know this questions come up quite a bit in chat is that how do you get these it's very simple like I said if you remember that world machine is a node based structure this is what I've done so if you see this checkpoint it's simply taking this height output and what I've done is I've run just certain different selections think about it like creating just different masks in Photoshop or whatever that's all we're doing so after this height field I've simply done this and I'll double click it here I want to select any slope on my height map that is at a maximum of 90 degrees and a minimum of 45 so anything in between here and a little bit of fall-off that will be my selection so that's what we can see here so the white areas denote where we have those steep cliff faces so we'll continue down here I've got a height selection so anything that falls below 1,300 meters but is still above 60 meters that's going to be my plane so you could effectively think of that as any area below like high mountain peaks that's it mask input here for this one on dirt and we're simply doing selection so anything that's less than 2 degrees but more than 0 degrees is our dirt so that's the flat areas that's it you can choose to do whatever different kinds of mask that you want the key thing to remember is that these are going to associate with layers inside of our terrain material so for example if you create 20 different maps and you don't have 20 different layers it's kind of useless so try to associate them with the different materials that you will apply to your terrain ok so now that that's done that's said so all we need to do is just build this so I can go ahead and build now it will run through it will generate everything ok now one thing I do want to make note of here is and this is very important unreal uses a very specific set of pixel densities if you will for your terrain at a specific resolution so I've gone and built this this is all outputted you can see what the terrain should look like in unreal but I'm going to go up to world commands go to project world parameters and this is what I want to show you so I know that there's other programs out there that do this but world machine by default can cycle between various different resolutions now if you're using a free version of world machine you're gonna be capped at 5:13 by 5:13 so I've generated this terrain at 20 49 by 20 49 here's the thing and keep in mind and I'll show this here a little bit later in this video but this resolution while technically you can use it inside unreal it's going to present a problem it's going to create a border around your landscape because unreal doesn't use 20 49 by 20 49 or if I uncheck plus 1 2048 by 2048 right you would think that these would be the common values right powers of 2 that is not the case so what I'm gonna do here real quick is I'm gonna actually pull up the landscape web page that's from the Unreal documentation to show you what we need to take note of now again understand this that if you're using a program that doesn't allow you to necessarily specify the custom output and so you are stuck with you know a 512 by 512 1024 2048 4096 whatever it is we can still work around that but if you have the option to change this in your software let's go ahead and change it so here I'm gonna take a look these are the overall resolutions 8 800 129 by 8100 29 4033 about 4,000 33 so I'm not gonna go too deep into this you can read through this and figure out okay what size do you need obviously if you want a larger landscape smaller on escape there's a whole bunch of math in that in fact that's actually in the terrain master class shameless plug sorry that I cover this little bit more extensively but the point is is that once you've determined your overall resolution that's what's important so in this case we're really close to this 2017 by 2017 so that's what I'm going to use those are gonna be my values so jump back to world machine and I'm gonna go back to my project roll parameters I'm gonna uncheck the +1 and click the custom so this is where I'm gonna go in and type in our 2017 go ahead and press tab and there we go press ok it'll tell me to rebuild let's go ahead and rebuild everything and that's it that is ideally what you want to do so we're outputting our height map and all of our masks and we'll go actually let me pull up that direction you guys can see so this is what our output is now so we've got our splat maps which is that bitmap our outputs which are dot raw and then our height map our output are 16 in fact let me jump real quick show you here so on one of these outputs make sure they're set to low bit low precision 8-bit raw that's what you need for those so our 16 let me double check height map is raw 16 and our masks or selection masks are raw 8-bit and that's it so that now we have all our information so let's go ahead and jump over into unreal and show you how we actually integrate this into our scene all right so now we're back in unreal and for this demo I just preset up a scene there is nothing really crazy going on here I just have a sky I've got a directional light and a skylight this will just help us to better visualize when we import the terrain and that's it you'll see later too I set up a simple material and get outside of the scope we're gonna do here just so we can visualize and see in very clear colors what's happening so all right so we've exported all of our information from world machine and now we need to get it into the engine so what I'm gonna do is I'm gonna actually go up to my modes panel and click on the landscape tab and doing this it should open up here in a second and this allows us to create our new landscape and again ignore this because you won't have any layers by default but again I've already preset this up it's a basic material just to simply visualize what's happening so don't worry about that so instead of doing create new I'm gonna do import from file and this is where we're gonna import our height map so this is our output and this is what we're looking for so I'm gonna go to where we output it our 2017 by 2017 maps and I'm gonna click this output r16 and click open ok mazuma back here a little bit so conceived happening so the green is a representation of what this could be now the beautiful part about this is unreal is going to auto recognize the data coming in which you can see here hi map resolution is 2017 by 2017 the overall resolution 2017 by 2017 okay now if you remember a little bit earlier I mentioned did you know you may not be able to specify the output size of your terrain that is okay we can still get around this the important thing to note here though is when you import this data when you use this import from file you need to take note of your overall resolution that's the important part so we'll come back to that all right so there's one of the things that we need to do when it comes to importing the height map from unreal now this is in the documentation but basically the way I understand this is that when we're generating our height map inside of world machine it's going to take its values from I think 0 to like 1024 that is the range of that when we import it into unreal it can take values from 0 to well technically 0 to negative 1024 and 0 to 1024 so effectively 2048 so world machine is 10:24 unreal is 2048 as far as the height map goes so technically we have double the height map information when we bring it into unreal so really all my rambling aside all that means is that basically when you import your terrain from world machine make sure you go down to your scale and do a hundred hundred and fifty and you'll notice what happens when I tab that it shortens it that will get you the correct sizing so our terrain and unreal will match visually how it is in world machine if you use 100 by 100 by hundred you import your leg I forgot to do that that's fine you can change it later that's not a problem it's just easier to do this just understand that your height your Z is going to be half of what it should be okay so we'll go ahead and do import we'll give it a second to think and there we go so that is our terrain so I think this is probably self evident which is you probably have done this by now that this is why we would use an external program to create terrain because to try to do this all by hand would just be near impossible to do so okay so now that we've got our terrain the other thing that we want to do is who you want to use some of our masks now if you recall that I went back and I mentioned about this whole idea that you may not be able to import your terrain at those predetermined unreal sizes right like the the 2017 by 2017 forty 33 by forty 33 etc all those weird values if you don't have those values set up in your terrain you're going to notice that there is a border around it'll actually just look like kind of stretched pixels that's okay we can work around that and I'll show you how here in just a second but what we want to do now is we actually want to come in and associate all that information so I'm gonna go back to my landscape tab I'm going to go to the paint one and here you can see those materials that were already set up okay now I'm not actually gonna do any hand painting that's not what's covered in this video but I do want to show you how we can associate and basically do a pre paint pass on the terrain using those masks that we export it so to do this now again because I've set up this material I've also set up our landscape layer info notes now if you're starting from scratch you create your material and you're like hey I'm clicking this and I'm painting but it doesn't do anything why it's because there's no layer info node associated so to do that you can just simply click this create layer and phono and create one of these layers typically you'll use your weight blended layer you can use a non weight blended that's you're fine that's your choice if you want to do that but typically the normal thing is using weight blended layers I've already done that so I'm gonna go ahead and go into our green set this up click can you'll notice that our terrain will turn green we'll go ahead and add one to our blue and why not add one to our purple okay so at this point if you notice when I added those nothing happened and that's because those layer info nodes are blank they are just simply created and they're now associated so how do we get the information from those different masse those different selections that we had on to our terrain here's how we do that so I'm gonna leave our plains as default gray default green as I'm adding these layers they're stacking on top of each other so because these are weight blended it means that any point so say for example I do my water layer first and it paints it in and then I do my cliffs any part where the cliffs overlap the water it will override those now there's actually a cool feature we can do to reverse that and I'll show you how but let's just start with the basics so in my water one what I'm going to do is just right click in this blank space I'm going to do import from file so here I'm going to go ahead and we'll navigate to the ones that we had and I want to use let's do flow for right now so I'm gonna do flow even though you'd normally use water but just easier to see for example so I'll double click this and we'll give it a second and then you'll see it populate on our terrain there we go so beautiful and I think this is pretty self-evident why again we would use an external program to create this because that that is quite a lot of information now what's really cool here too is that as if you recall that I said that this is basically just pre painted on there so if I select my water layer take my brush size down a little bit I can still paint or remove information from that layer it's non-destructive now of course I can go in here like oh I messed up I didn't do this all we can do is we can simply re import and will overwrite so there we go ok now I'll cover this in a different video this is really to cover more of 424 and earlier there are some new terrain tools so this is kind of a what will eventually be an older method but still applicable but this is that process ok so I'm gonna go to my cliffs do the same thing we'll import from file and let's go ahead and do our cliffs output so we see that give it a second and there we go so it's in so I'll go to this little section over here where we have some water so you can you can see because I did the cliffs layer ii that it overrides that data now i can go back to my water and just simply click re import and it will paint over top of it so you can do that as much as you would like like opa now it's not what I wanted rien port from cliffs override that water so that's a process that you can reinforce and overwrite which is great but be aware and this is part what I don't like about the tools but just be aware of this is that when you do that of course it's going to overwrite any of your paint data again the new tools have some cool features with that but we'll cover that in a totally separate video ok so that is the process of doing this and that pretty much wraps up this video and I'm going to show you real quick one of the caveats if you don't have that terrain information how to fix that but that should get you through this whole process of getting your terrain imported getting your your different masks set up and then being able to import those and use those for your terrain ok so that being said I'm gonna go ahead and walk through the process if you don't have the squared resolutions or those one-off resolutions from your terrain output and show you how to correct that so in this section I'm just gonna quickly go over if you have a terrain generation program that you can't specify a custom output size how do you work around that so I'm gonna show you that process here real quick so okay so I'm gonna jump back to world machine and if you recall under our project settings in here we've got the ability to set our custom now let's say for example this was stuck at 20 49 by 20 49 which is part of the default width so uncheck custom lets you go back here so you know say whatever it is that I'm stuck at a resolution okay so that's what I've done is I've exported this with the non I think what is 2017 by 2017 resolution yeah of what unreal wants so I've done an arbitrary one so I'm gonna go ahead and go through the exact same process we just went through so I'll click my landscape tab I'll click import from file and we'll go ahead and specify and I'm gonna go ahead and go to my output here which again this is that one that's exported out of 20 49 by 20 49 okay so for all intents purposes it looks exactly the same but if you recall in the previous one I said make note of your overall resolution which in this case is 21:43 about 21 43 so I went ahead and set my Z scale to 50 so we should be good let's go ahead and import it I'm gonna take a look okay so it looks relatively the same but it's not and I'll show you why so if we look on the border here you'll see that this is what I was talking about with that stretching so we've got the material kind of stretching off into the distance fact let me go to detail lighting so you can see a little bit better and there you can see that stretching that occurs okay so what's the problem then well here's the problem so let's go back to our paint and we've got our our layers here I'll go ahead and re associate this so we can see so we'll do our planes and then I'll do our water because again we're just gonna show just this one process okay so if I go to my water layer and I do import from file and I go ahead and select that that basic one that we had so this one the flow output we'll use so it's easy to see technically it's resolution is 20 49 by 20 49 the same as our height map if I click open you'll see this boom layer does not match the current landscape extents there's that 21 43 by 21:43 ok so how do we get around that so go ahead and click OK and I'm gonna jump over to photoshop real fast and show you this file so go up to this is our flow map image size work 20 49 by 20 49 so the problem is the editor is telling us this needs to be bigger here's the problem though you would think oh I'll just go up into my image size change this from 20 49 to 21 43 about 20 or 43 hit OK and rescale it that is incorrect because if we do that you'll notice that this still goes to the extent of our terrain which we jump back to unreal it doesn't actually extend in fact it's got a border for lack of better like a better terms so okay so we'll go ahead and go back to photoshop undo this what you want to do is this go up to your image canvas size and in your canvas side this is where we want to change it to 21 43 by 21:43 hit OK and you'll notice it puts that border around it for us that's all you need to do again if you're exporting your terrain out at the right custom sizes you don't have to do this you can skip this but in the event that you can't specify custom size this is what you do so we would go ahead and save this out as our raw file which I'll jump back to unreal and jump into here and then I'm gonna go to our water layer and I'm going to import from file and this time we're going to use our 21:43 by 21:43 hit ok no warning message after a few seconds it'll pop up and we'll see that that information is pre painted on the map and of course it stops at our extent so there you go so that is the process in which you can import and export your terrain from a program like world machine or any terrain generation program how you set it up how you create your splat maps again it's it's entirely up to you what you do with those splat maps are those masks just remember that those are going to be associated with your terrain layers it's a little bit of pre-planning you'll be fine and you can generate those how you can right-click on that import that set it up and that is it so that should hopefully get you started with terrain in unreal and get you set up on the basic process and again we'll cover more in depth on this stuff in in future videos that being said I really appreciate all you guys the support I know it's crazy times right now so stay smart stay sane and again thanks for all your support I always hate the shameless plugs you know it's I never asked for subscribers likes dislikes I mean let me know what you guys thinks drop a comment if you guys have ideas or suggestion for you your videos absolute let me know I'm here to provide resources for you guys especially in these crazy times so I'm gonna do the best I can you do the best you can I'll catch you in the next video thanks guys [Music]
Info
Channel: Ryan Manning
Views: 32,240
Rating: undefined out of 5
Keywords: UE4, Training, Game Dev, Tutorial, Unreal Engine, Terrain, World Machine, Splat Maps, Terrain Masks, Terrain Materials
Id: Ia42xDVfGuc
Channel Id: undefined
Length: 21min 12sec (1272 seconds)
Published: Thu May 21 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.