Unreal Engine 5 Tutorial - Data Layers

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello everyone and welcome to this one-off episode talking about data layers a brand new feature part of unreal engine 5. we have to learn about what day layers are and how they can be used inside unreal engine so let's jump straight in and take a look so in unreal engine 5 world petitioning is a new tool and to enable world positioning on a existing map such as this one which isn't world positioned so far you have it open you go to tools and you go down to convert level and it asks you where you want to put it and we're going to go find the map there is i'll open this map okay and we're going to convert in place click ok wait for that to complete and we'll have it partitioned and then when it's complete you'll get a little dialog box and click ok and you'll get this scene as it is like so so when it first does this you'll find we possibly will find that the cells have been unloaded for you uh so we can do go into world partition option here if you don't have this here you can find it in the window and go to world petition okay world position editor and you can see the different cells down here we're just going to select all of this right click load selected cells there we go there's our now a wild partitioned scene so now we're going to use data layers so data layers are the replacement of level streaming because if we go to the levels you can see this is disabled when well partition is enabled so you can't use this so the alternative is data layers which are actually better as it gives us a lot more options to do things uh with regards to how things are loaded up in blueprints and at the start of the game so you enable it by going to the world partition option in your windows setting and go to data layers outliner it looks like this so data layout is set up by very similar if you know how to do level system it's very similar to that where you can select different actors so i could say these airships i'm going to click on each one of these okay and i'm going to add these to their own data layer so with them selected i'm going to go over to my data layers table here right click and do add selected actors to a new data layer and there they are and you probably want to rename this one so let's rename it and do airships okay so let me just make this a bit bigger here we are so on the data layers here you can see your airships here and we've got visibility so we can hide them show them we also got whether or not they're loaded in editor and so if we do that we have to save it um so they're not loaded up in in the game so if you want your editor to start up quicker uh you may also want to say certain certain data layers are not important you can make them load up later rather than when you first start the editor and you do that setting down here in the data layer set inside over here so it says it is initially visible so if you were to start up the editor if this is ticked on then it's going to be visible okay if it is initially loaded then it's going to start up when you start to unreal editor it will show as it loaded now if you have these turned off it is going to start up quicker something like airships which aren't important to me developing my scene i can just turn these off and my scene will actually load up a lot quicker and so you can start really optimizing how your level and editing process and workflow really do benefit from using data layers now alongside this we can also change these settings in runtime during the actual game and you find that in your advanced options and you go is run time and you tick that box there so now it's told to listen out for any changes in code and we can change things like initial runtime state whether it can be unloaded loaded or activated activated basically means visible um and we've got debug color there too so i'm going to say it's unloaded by default okay and let's say when i play the game i'm going to push a key to load it up so let's go to my player character um there it is and in here we're gonna make a simple input to enable this data layer so i'm gonna do the one key for example and in here just search for data layer and you'll get the data layer subsystem and then from there you can access the various features of the data layer subsystem so type in data layer again and there you go you've got all these different options available for you so let's say we are going to do um get a say set data layout runtime state we do this and plug that in now this requires the data layer itself what state we want it to be and is it recursive or not so if we tick um this to be activated okay so then we want to get the data layer here now you want to what you want to do with this is you can promote that to a variable you know in data layer and then hit compile now over here on the right hand side we can find the in data layer option we can click on this and we will find the list of all of our data layers in this one we've only got one so we're gonna tick air ships and that's it hit compile and save that let's close that and let's go and push play in this scene this seems not that great by the way because it seems to be small for your character but we'll make it work i hit play there and if i hit one there's my airships okay hit one again nothing will happen because they've already loaded so let's say you want to flip-flop that you can do and go into our character here we want to check to see if a data layer is already um activated so go data layer and we're going to get data layer runtime state and we need to know what data layer which is our variable and in here we're going to do uh select and oh and the co we're going to make the select index be checking if this is equal to activated so if it is already activated and it's true we can make it go to unloaded if it is uh false we're gonna make it activated so now it should toggle off and on gonna hit the one key okay so it is unloading them so be aware that if you do unload it then it's going to basically restart whatever action they are we're doing so for example you can see over there that one that's moving if i hit the one key and make it one again it will restart its pathing in the distance there so there we see we've got data layers and obviously you can make more of them um over here on the right we can just go and add building here add new layer and likewise we can unload and load those really uh you can also make sub uh layers as well inside of each other make groups so if i right click on this one uh we can create new data layer under this one so now it's a group of them and so i can say okay this one's a building but this one is say uh this building in particular and crate uh sorry add selected actors to new data layer oh no also to date layer one uh yep okay so i can hide got the whole layer there to hide the whole lot and has it not selected that let me show that again maybe because i've made that inside of there i need to remove that one there there we go so yeah beware if you do add it to two uh day layers it will only go into the top one there okay um but there you go daylight is pretty cool pretty useful check them out and uh yeah have fun and there you go we've now got data layers under wraps we are confident in using them in our games if you like this video and want to see more unreal 5 content head over to patreon.com where your donations help me keep the channel alive and you get to see bonus content before anyone else i said thanks to all my patrons and youtubers for their continued support thank you for watching make sure you subscribe and i'll see you all next time bye everyone [Music] you
Info
Channel: Ryan Laley
Views: 33,109
Rating: undefined out of 5
Keywords:
Id: _OlAs-fvICc
Channel Id: undefined
Length: 10min 1sec (601 seconds)
Published: Fri Jul 15 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.