Let's Build the RPG! - 55 – Unreal Engine 5 Water Ocean and Island Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this episode we're setting up a brand new level starting with the ue5 ocean water body and Island let's get to it [Music] hey guys welcome to today's episode and I know this episode is kind of a change relative to the stuff we've been working on and maybe you noticed this in the AI episodes but the performance of the first level that we made in this series it's been getting worse and worse over time and if you remember back in episode 6 of this series the whole purpose of that initial level was as a construct it was a prototype level where we could build and test things and so now it's on to the next level because with this episode I think this level that we're designing now is going to serve as eventually where we're testing Alpha gameplay for our game and creating this new ocean level in Island it solves the performance problem but it also solves the problem of the fact that we have a gameplay ability that allows our character to jump 30 feet in the air so inevitably we need some sort of barrier that prevents them from jumping out of the level now I could create like a giant Cliff face all around the level but that doesn't really seem natural the ocean is going to do just fine because in future episodes once we get past death and respawning mechanics I think I'm going to do an episode where we have a tentacle kind of coming up out of the water grabbing our player if he lands in the water pulling them down Into the Depths and that will be a death obviously so swimming for this gameplay Prototype at least that we're initially making is going to be a no-go but back to the purpose of this episode by the end of this episode you're going to know how to create an ocean water body and customize that to your specifications including adding foam changing the color changing the size of the Waves stuff like that so here are the key concepts for this episode if you're not following this series then the first two thirds of the episode that revolves around the water Body Ocean is all you need the final third will be setting up the island with its own materials some sculpting stuff like that so let's get to it all right all right all right so we are going to start today by creating a brand new level under file new level and we're going to use a basic template here create I'm going to zoom out a little bit because we need to go into landscape mode and the first thing we need to do is give this new level a landscape make sure you've got enable edit layers here checked and under material I'm just going to use a starter content material at least for now but by the end of the episode we're going to have our own material and I'm going to show you how I built that so I'm going to choose M ground grass here and and the section size I'm going to set this to be 127 by 127 quads I'm going to keep everything else here exactly the same and create so now we've got our lovely landscape I'm going to go back to selection mode just for a minute because I'm going to delete out our floor we won't need that anymore and so I'll go right back to landscape mode and next we need to make sure we have the water plugin turned on so for that I'm going to go under settings under plugins and just search for water here just make sure you have water experimental checked here if not check it and restart Unreal Engine and then actually we didn't need to go back into landscape mode we're going to do some landscape sculpting at the end of this episode but for now I'm going to go back to selection and we are just going to search for water body ocean water Body Ocean and already we've got trouble because well nothing's showing up for our landscape and that's because our location here is all out of whack so I'm going to adjust this to zero instead of negative 36 000 whatever it was and then for whatever reason it's moved all the way out there so I'm going to move it into the middle of our landscape next let's do two really quick prep steps that aren't related to the ocean but are just related to creating a new level so the first thing is I'm going to drag in a post process volume so post process volume right in the middle of the level and if I go up to the top and then under scale for that I'm going to make that 600 by 600 by 100 so basically encompassing the entire level and the next thing I'm going to do is add a player start so we'll come up here and search for player start and drag that into the level as well and I'm just going to put that right by the coast so let's go ahead and save this level and I'm going to save it under third person and under maps and we're just going to call it the island version one save so now let's talk about the settings that are relevant for our water Body Ocean so I'll go ahead and select that and the first thing is let's expand under Advanced here and underneath wave the wave attenuation water depth that's the first setting to mess with so the higher this number is the smaller our waves are going to be so if I make this something like 10 000 it's going to be a very steady ocean yeah it's very gentle but if I make this something like 1 000 giant waves but I found a number of around 5000 for an ocean yeah it was just kind of a nice tropical ocean feel so next expand the water height map settings here and specifically the fall off settings I'm going to zoom out a little bit just so you could see this in the Z offset here it's basically how much the beach is staggered relative to the rest of the land and so what I mean by that is if you set this to 100 you're not going to have this lip anymore so I set it to 100 it's completely flat if I set it to zero then it's going to have them maximum lip so basically that 32 makes the beach slightly above the water level slightly above the ocean level but not at the full height of the rest of the island and I'm going to set this a little bit higher I'm going to set it to 50. now the edge offset this is basically how deep how far back your Beach goes so to this lip right now it's about a thousand so if I've reduced this let's set it to 200 then that's going to reduce the depth of your Beach quite a bit but there's another setting that affects that so if you go under your curve settings here so the channel is this area under the water here basically how far that ramp goes in this channel Edge offset is basically the same thing as the beach but in the other direction so if I reduce this down to like negative 100 it's going to be a much shallower Beach but for my purposes I'm going to keep it exactly the same at negative one thousand the channel depth this controls How deep the landscape is going to go underneath the water so as it currently stands it's about 20 meters so all this goes down about 20 meters but if you wanted something that was crazy steep so I could set this to something like 20 000 and then that's just going to go down Into the Depths let's put it back to 2000 I think that's fine and then the curb ramp width is exactly what it sounds like that's basically how wide this whole curve is and obviously that can't go past the size of your landscape but you can make that very shallow so let's say it's 200 so then what that's basically going to do is you have a very steep drop and it goes right down to the bottom of the landscape and the bottom of the landscape is still 2 000 units so I can make that landscape let's say 200 so that would be a wide shallow area directly next to your beach and that could work really well for something like snorkeling scuba diving coral reef type stuff if you want to paint that kind of scene so I'm going to keep these pretty much exactly the same this is going to be 8 000 Channel depth let's make that 2 000. so next let's get into some interesting settings so also under the water height map settings if you go under effects here and specifically I'm going to expand the curl noise and I recommend zooming out a bit for this so you can see the entirety of the island because what these are going to do is give some randomization to the edges of your Island so back in episode 16 when we did water for rivers and lakes I showed you how to adjust the spline points but for an island in this case instead of messing with the splines you can get a lot of interesting effects just messing with the curl amounts so I'm going to set this first one to be about 0.3 and that just varies up the edges here to give it more of a random pancake effect and then the curl 2 amount I'm going to set to 0.5 and think of the curl one amount as your primary variation in the curl 2 amount as your secondary variation and you can get some pretty crazy Effects by cranking up these curl amounts so if I set the curl one to like 10 just a wild archipelago there curl 2 to 20. yeah you get the idea but like I said we're going to keep this nice and simple 0.3 0.5 I think it's going to work just fine as a nice strangely shaped pancake in the curl one tiling and the curl 2 tiling here I don't recommend changing those but those basically determine how sensitive each of these settings are like at what scale is it causing the variation some other settings that I recommend playing around with here so displacement is kind of interesting if you want to get like an arena type feel like a bowl inside the ocean so displacement height let's do 10 yeah so we could have that Arena inside I can make that like a hundred we're not going to need to do that here the other one that you could play with here that's kind of cool is the terracing so if you expand that so the Terrace Alpha determines how much of a terracing effect like a step effect there is with the water so if I crank that up to one yeah basically you got steps all the way down if I was making like an inking underwater Lost World or something like that yeah you could totally do that change the smoothness a little bit so if I want to put in some erosion and I should mention you can also fundamentally change the shape of the island by adjusting the spline points here I'm not going to spend any time on that here because we did a lot with spline points back in episode 16. you could check that out but now let's talk about adjustments to the water material itself so for the water material there were three specific areas that I found useful to adjust and the first is in the watercolor itself and that's very easy to change so if you come down here under the water Body Ocean you've got to come down down down all the way to water material and then we can go into that the water material ocean and in order to change the color here it's just this absorption right here so we go ahead and select that click here and let me just move the details panel over here on the right hand side and that way we could see this in action while we change it make the details panel here a little bit larger all right so let's say you wanted a blood I don't know why but maybe you wanted a blood ocean so we can change it to immediately be that dark red color but you'll notice that the distance color out here that doesn't change so let me show you how to change that so for that we have to go into a different material so not this water material it's actually the material on our water Zone and whenever we use a water body in the world we always have a water Zone and for the water Zone what you got to do is going to come down to far distance here expand this and we need to go into the water far distance material water fire mesh I'll make this larger as well and then if I come down to the same exact setting so it's under absorption here click here and then you also need to make the far distance material a red color and then we have our blood ocean well into the distance but I do not want to do that so I'm going to cancel here and to get the same exact color back in our regular ocean what I'm going to do is click on here and drag and drop this over to drag and drop there okay and then we can go back to our water material ocean click there and then click right up here and that's going to make it the same exact color now you might have just noticed and earlier in the video I actually had add a split second where you saw the water foam because as it currently stands in 5.1 as I'm recording this video the water foam is not yet officially supported but there were some lingering comments and mentions in the material and I thought to myself ah if I play with this maybe I can get the phone working and sure enough it's not perfect but it's pretty good and I wanted to show you how to get that working if you wanted to so we can close out of the water fire mesh we won't need that anymore and if you come down in your water material ocean all the way to the bottom you probably can't see it because of my head but you just click on your parent here and the parent is still a child material it's the water material instant child material we got to come all the way down again down to the water material here click that now I'm going to expand this alright so the foam is driven off of a material function if we come down here to this beach foam over here and I'm going to zoom out for a moment because what I found is that right here this node right here that says disabling due to landscape Global distance field issues this node was not hooked up and instead this multiply was hooked up to each of these height lerps so what I needed to do is I needed to disconnect the this multiply node here take this right here and hook it up to both of these nodes the transition phase here and the transition phase here now I'm not necessarily recommending this because Unreal Engine specifically disable this because they said it's not working properly with distance Fields I don't really know what that means and it worked well enough for my purposes so I'm going to play with it and the one other thing that I needed to do in this material function is I needed to hook up the output foam scattering from here into this multiply node here but everything else in the water material and the beach foam function I left exactly as is as I'm recording this on 5.1 so now over to our water material ocean and once again I'm going to bring this over to the side of my screen and we're going to go over all the beach foam settings that I found to be useful so we can scroll up here and just make sure you've got enable ocean foam checked here and then you get these Global scalar parameter value fields that we can play with so the first thing let's do is I'm going to set all the settings that I'm going to use in this particular level and then I'm going to talk about what each one controls so the first one is the depth for distance field foam I'm going to set this to be much lower at 2 and you see the foam goes all the way up to the edge then the next one I'm going to set is the foam distance instead of 256 I'm going to change this to be much further 1250 goes out quite a ways now if I get really close to this it doesn't look particularly good right it doesn't look realistic and so what I found works well is the foam depth minimum I set this to be much higher so about 1000 and that's going to make the foam kind of fade out and then it becomes much stronger right where you would expect it to be strong like right where the weights are breaking into the island the next setting I found to be useful is this foam scatter bias so if you set this higher it's going to put the foam out way into the distance and if you set this lower it's going to diminish the foam so if I set this to like 0.1 yeah almost nothing so if you set this to something like 0.8 yeah it's going to go way out and it basically looks the same everywhere so it doesn't look very good so I'm going to change it to something like 0.2 and the foam scattering MIP this is also a cool setting so if this is set to something much lower it becomes far more detailed foam to me it felt like the resolution of the foam went way up when I set it to lower so if I set this to 60 teen is just kind of a general cloudy foam this is really up to you whatever you want to set here I'm going to set it to about four last but not least this height bias is a very interesting setting so if you set this to something positive then foam covers the entire ocean and I can think of some useful cases to using this like let's say we have an Airship that's surfing along clouds we could totally set up a cinematic to that effect but maybe in the due course of time okay back down to let's make it negative one so those were all the key foam settings that I found to be useful but if you find others please let me know in the comments below the very last setting in the material that I think is useful to know about is caustics and we'll select that in caustics it's basically the shimmering that you see under the water I'm sure scientifically there's a better way to describe it so it's that blue shimmering that you see under the water so if I zoom out you can really get a sense of it personally I like it it gives kind of that fantasy ethereal feel so we're going to keep that in the very last setting I want to mention all the settings I was playing with under materials if you come all the way down under water shading this anisotropy setting so depending on how high you set this the one water is going to be a lighter green or lighter blue versus a darker blue so as it currently stands it has kind of a tropical feel but if you want this to be very dark kind of like a dark stormy ocean I could set it to be 0.8 all the way up to one but I actually want that tropical feel so I'm going to set it back down to 0.1 so we are all set for our Ocean material stuff I'm going to save this and we can close out of these so that's really it for the water Body Ocean stuff so for the rest of this episode we're just going to be setting up our Island here to get ready for the rest of this series subsequent episodes so selecting our landscape here I have a material that I created ahead of this episode and I'm going to go through it but what that is I'm just going to assign it and then we'll go over it so it's the MMS level landscape material instance and the way I set up this material very simple it just has a z base blend So Below a certain Z level it's using a combination of two different Beach materials that I got from quixel bridge and then above the Z then it's using our Earth quadrant that we set up all the way back in I think it was episode eight so here are the surfaces from from quixel bridge that we're using for the island feel free to download them directly from quixel bridge you can just paste in the code that you see right there and it'll come right up and I'm using 8K textures maximum quality if you followed along in episode 7 the landscape material episode you already know the techniques that we're going to use for the remainder of this episode and also then you already have the third and fourth material that are listed here so here's what I did to create the parent material that we're using for this island level so in our content drawer so under Ms presets so this was back in episode 7 the garden landscape material all I did is I duplicated that material and I put that duplicated material under MMS level landscape material and I named it m underscore Ms Island landscape material and in that duplicated material I simplified it considerably so let me show you what we've got here so instead of doing paintable layers I got rid of those and at the end of episode 7 we did a technique where we Blended two materials together that eliminated the tiling via noise and the only difference between episode 7 and here is that here we're using a parameter texture object so if I right click here and I search for Tech extra object parameter so texture object parameter here that's what I'm using instead of texture object and the reason I'm doing that is then it allows us to change these materials in our child material so what I'm envisioning is that we're going to have multiple Standalone levels in the game that we're building and each of those levels will always have a primary material and a secondary material but also a primary Beach material and then a secondary Beach material if they're by an ocean and so that way every single level every single Island could have different textures like a different material even though it's really the same material because we're just doing that in our child material so let me just go through all of this so first I started with this down here so this is the above the Z threshold so the Z threshold is at what threshold our beach starts and our land ends and that is determined over here so depending on the blend height here that's where we got a set where our beach ends and this is just a scalar parameter and the sharpness is how sharply they blend but let's go through our setup over here so these are just constant vectors and I set this to tile at 200 200 200 in this one at 168 168 168 I think that's identical to episode seven then I replaced each of the texture object with texture object parameters these are all exactly the same as they were in episode 7. here's the noise just to confirm so the scale is 0.005 I multiply that by four I think that's unnecessary if I just set this to 0.02 but keeping that as is saturate node is hooked up to the lerp for each of these we split the components of the lure up into RGB and then I add one for the alpha here make float4 the texture sample here this could be anything for our ambient occlusion and this is the same exact function that we set up in episode seven and the other thing I should mention is this is our primary land texture secondary land texture and our primary land normal secondary land normal so you want to change the parameter names for each of these and then once I did that I just took that whole thing duplicated it and then that's our below Z threshold and I just change the parameter names up here to be the primary beach texture secondary beach texture primary Beach normal secondary Beach normal all the other setup is exactly the same and then those is just blend into a blend material attributes node here based on this information and then all this setup up here after the blend material attributes node this is all coming from episode 8 where we did runtime virtual textures which could blend like a rock into the landscape but this is all optional you don't need it unless you want that realism of blending objects with the landscape so then in order to make a child material it's very simple you just right click on it you say create material instance and that's how I created this right here now based on the height of the landscape you do need to change couple of these settings the blend height and the sharpness I set this to 50 so that it Blends very sharply so it goes suddenly from the beach material into the land material and then the blend height I had to play with this until I got the right setting because you want that blending to occur exactly when the land material kicks in and if I get really close there you see the sharpness it's a quick blend in the primary Beach material that's the lighter color here and then the darker is our secondary so yeah here's our primary Beach normal primary beach texture primary land normal land texture I didn't change those from the defaults secondary Beach normal secondary beach texture and it's all tied into that parent so if you got all that and once you assign that to your landscape should be showing up just like this now the next problem if I play there are no footsteps so what we got to do is we gotta assign a physical material to our landscape so I'll select this and under default physical material here I'm just going to select the dirt PM that we set up in episode 19 and then we'll play again and now we've got footsteps but one other issue is that the footsteps are exactly the same regardless of whether we're on the land material or if we're on the beach material so what we need to do is back in episode 19 under our human character bfl blueprint function library and this is under blueprint function library's Pawn human in the footstep sound function and the jump land sound function we set a threshold by which if our character is below that threshold then they're going to get one set of sounds for the landscape and if they're above that threshold then they get a different set of sounds and I just need to tweak this to match our landscape height so instead of negative 65 being the threshold it's going to be set now to 100 and we do the same thing for the jump land sound here so 100 compile and save this and then we'll test again so now we get the wet dirt sound when we're on sand if we go up here then we get the regular dirt sound and I thought about changing these sounds but I think this sounds just fine to be honest I kind of like having the sand have that slightly squishy sound to it so for the last part of this episode we're going to sculpt our Island out a little bit and for this we're going to keep it really simple so I'm going to go over to landscape mode and we're going to do everything here just using the noise brush here we're going to do two quick passes over the island so for the first one the brush size is going to be ten thousand and the tool strength we're making this very very weak so 0.005 and for the noise mode instead of both set this to add and that way it's only going to be additive noise meaning the Island's only going to go up and by the way if it starts freezing and you're moving around set the brush size back to something small and then it'll be just fine so get in the exact position you want to be in and then set the brush size to some high value like ten thousand and so for this we're going to stay just in the interior of the island don't get too close to the edge so right about here is fine and then just move it all over the interior and so you want some randomization if you've got a little mountain just like that in the interior totally fine that's perfect and then for the second pass over the island I'm going to set my tool strength to about twice as strong so 0.01 and instead of add I'm going to change this to both add and subtract and then for this I'm going to go over the edges and the center so here I go and that gives us some nice variation in the beach so the beach goes Inland and we still have some rays kind of mountainous areas you want to make sure though you don't have any areas that dip below the ocean just like this because then you could get some buggy effects so what I'm going to do is I'm just going to set this to be additive again and I'm going to set this to be much smaller let's do 1000 and I'll just crank up the tool strength of something like 0.1 instead so it's a little bit stronger just a very slight effect so once you're pleased with the result go back to selection mode and save this and I want to show you one last thing which is how to make a level a new default level of your overall game and so for that we come up under settings and under project settings and go under maps and modes here and we have the editor startup map and we have the game default map and I'm just going to set both of these to be our Island level so choose our Island version one same thing here Island version one and then go ahead under content drawer save all so that wraps up our episode for today and in our next episode we're designing our first indoor space and I've cranked up the brightness here just to get a nice effect but yeah we're designing a cave level and I'll show you how to sculpt that directly into your landscape so I hope to see you there in the next episode
Info
Channel: NumenBrothers
Views: 11,387
Rating: undefined out of 5
Keywords:
Id: RVgxi-PN8c8
Channel Id: undefined
Length: 22min 31sec (1351 seconds)
Published: Sat Feb 11 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.