Getting Started with Level Streaming | Live Training | Unreal Engine

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hey everybody and we're back this is the Unreal Engine livestream and you were gone well we've been here for like yeah so the the live stream went up for about a split second there did some funny stuff but but we're we're back back for reals reals to dirty please the whole stream make sure you repeat every single thing you say at least once at least once at least once got it so he's gonna be showing us some stuff with level streaming very basic stuff yes yes but it's it's all about getting started and running with that we've got a lot of questions coming in to chat I'm gonna be monitoring Facebook twitch and YouTube so please just any topic or hands talk with my hands you think y'all know me as long as I don't start talking with the stands we'll be okay please don't okay well we're going to hop right into the Puffin into the main screen before I get my hands grabbed I can hold your hands you say that now but I say that now so what I'm gonna use as kind of the framework for this is the talking with my hands thing can see you it's okay we're pictures yeah I know I know is the content examples level streaming persistent level so for those of you who don't or haven't taken a look at level streaming the the core concept is that you have a persistent level and that is what when you first start the game we load a persistent level the persistent level then has the logic for loading any sub levels or streaming levels for something like a Gears of War linear experience you tend to have like a chapter of the game or an act of the game is a persistent level you progress through it as you move through the world in a linear fashion we load and unload levels before you get to them and after you leave them we'll also have things like doors that close and can't be reopened you know collapse of a bridge something like that that we then used to basically say you're never going to go back so we no it's completely safe to unload everything behind you freeing up memory for you to progress further in the game and then we'll have an end of the the persistent level the last streaming level once you have finished that we then transition streaming levels persistent levels sorry and that lets us load up a whole new set of logic and core experience for the player to progress through so the streaming level example in content examples is is kind of a snapshot of some of that behavior to start with I'll just play it and run through it real quick so you can see there's nothing visible past year because it's waiting for me to reach this point to load in the next chunk of level it's a series of volumes just in the level as well kind of flying around seeing me and you obviously colored and things like that yeah and you know that they're there because you've seen a little beforehand but I like how they added the level streaming sky back there you're not seeing yeah yeah one common thing that people will eventually pick up on is that we don't necessarily have to build streaming levels in kind of the linear checkerboard pattern where I'm going from A to B to C to D we can also use the system to split levels up between different disciplines internally so say you've got a level that has all of your geometry so your your core world and then you might have an atmosphere level that is always going to be loaded alongside but isn't necessarily part of the same level and that's kind of what you're seeing here with the streaming level sky in the background and then we can have kind of a vertical slice of levels where you have the mesh you have audio maybe a scripting and then we might even subdivide that further and still load them all at the same time but that lets one person work on one chunk of the environment simultaneously with another so I can be doing audio layout or effects while alex is working on lighting or something like that we're still working in the same space without being on each other's toes now because we've partitioned out there exactly we still have to check in and and you know sync to the latest version of each other's changes were on ESPN or perform exam you so internally that's that's what we do we use perforce primarily and yes I'm working on measuring alex is working on audio and we sync up at some point to make sure that our changes aren't clobbering each other oh quick quickly I forgot to mention in the beginning in the stream here people are already asking what what version and what we're in like project wise this is content examples all we did was open up the level streaming map so we can just show you around and explain things it's got a lot of pre-built content it was a lot easier for Alan to show it off there and the version that we're in is for 15/1 so that's where we are today sorry about that Alan no no I'm sure that everybody out there could keep up with us so to the vertical split this can be used in conjunction with the the more linear a to be to see progression that you'll see in in some games like Gears war and others so we use a combination of those and they don't have to be contiguous with each other you can have say an audio level that spans almost the entire or even the entire persistent space that may only get loaded or unloaded in special circumstances or scripting or or even lighting and things like that so a lot of our splits are based on the type of content when we need the content how much content we're loading and unloading we tend to move things between levels during the course of development to make sure that things are visible at the right time that we're within our memory budget things like that so the first thing you'll need to do when you're when you're building is a persistent or a streaming level set up is you'll need to open your level browser and this is where you can see all of the levels that are going to be or possibly be loaded during the course of gameplay the persistent level is the one that you'll actually open for the most part when you're working you'll open the persistent level it knows about all of its levels because the the data that you see here is taken from the persistent level and then all of the different level types are here and you can see what type whether or not they're currently visible if you need to get into their particular level blueprint you can do it that way whether or not they've been modified and can be saved and the level color so the wireframe can be colored based on which sub levels you're currently looking at so there's a couple different ways that we can load and unload a map there's the level blue level streaming volumes and those are basically a I am inside this volume of space which levels don't need to be loaded and then and all that's additive so if you happen to be standing in two levels streaming volumes the levels from both of those will be loaded so if you expect to have say kind of a almost nonlinear area where you could be coming in or out from different directions you may have a couple of different level streaming lines set up to make sure that no matter what direction you come into the area from the correct levels are loaded so that is reflected here so I have a level streaming volume here whenever I'm within the bounds of this level streaming volume whatever sub levels are associated here will be loaded if I leave this volume and nothing else tells the engine to keep this level and visible and in memory it will unload the map and you can see that when I play when I cross into that volume the next area becomes visible when I back out of it it disappears again you can pull up stat levels to see which levels are currently visible and that was just stats base levels yep stat space levels so as I move through the environment you'll see the if it's green it's not loaded if it's yellow it's loading if it's red its loaded and visible so as I move through all of the the setups here you'll see levels come in and out based on both the blueprint scripting and also the level streaming volumes now when a level is unloaded all of its collision Aid is unloaded as well so if you do happen to get to a situation where you're not in the volume but you're entering the space where the messages are the engine unless you put collision data into the persistent level because that's never unloaded during the gameplay unless you explicitly unloaded you're gonna fall through the world if your AI traverses into that space they'll fall through the world exactly what I was gonna say is I've dropped AI off of off of my worlds by walking through a level stream before and forgot to keep some sort of persistent ground collision so the day even though I can't see them they can at least navigate around the corner right and and then that goes through your nav meshes as well yes you can but we tend to put them in the sub levels so that as they load they they automatically connect to adjutant but you can also do it so that you have your nav mesh in the persistent level the problem then does come that if you do have an unload collision data and your nav mesh doesn't get updated it there there the AI is going to think that they can traverse this empty space and they'll fall through and your games not going to work quite correctly so setting up a level streaming volume is not too terribly difficult so you select your level and you can actually select streaming volumes that are associated with this and then you can make sure my it's been a fair amount of time since I've done this so it's funny I actually don't remember how to add a level to a streaming volume oh it's not just add Plus on the plus sign yeah even I will Google like the wind thank you it's been years since I've actually had to set up a level streaming volume from scratch so while Alex looks that up I'll talk a bit about the blueprint side of things so when you get to this point this is where blueprints start kicking in to take over loading the levels and that's why there's a couple of different volumes a little hard to see because they are orange on orange but if I go into my sub level 4 I believe it's to find which level these are in area so when you touch this it calls the load streaming level blueprint or blueprint function which because it's latent doesn't fire its completed until the level has loaded correctly the way it knows which level the load is you literally type in the name of the level as long as it's in the correct path in your Explorer and in the engine and the name is correct it will will load when you touch this and this is pretty important because if you get the if you miss type it it's going to fail to load it's an another thing to kind of keep an eye on a case and all that matters so if you open up the other menu I can yeah so yeah I'm just going to teach me I'll say click on the levels drop down see if those levels create new or add existing well that's adding a level to the 30 it's not loaded I'm looking for adding a level to a streaming volume oh is it not in the details menu on the right there where it's is that where it's of streaming levels the details you can't add from here that I know okay yeah alright if that's not it then I will go back to search here it is I found it what where was it there's now a level hell's button that did not used to be there you used to be just an irregular cleaning but this tells you in for for these particular levels what streaming volumes are controlling this level so if I wanted to remove this make fewer volumes keep this level loaded I could do that as well this is also where you set the this state for whether or not the level is loaded at start and things like that and the level color the little color again that only shows up if you turn on level coloration in the wireframe view it tints the wireframe for objects that are in that level to that color so it makes it easier to kind of get an overview of what levels are positioned in in space during gameplay so again level streaming volumes show up just under the volume drop-down or the volume portion of the classes tab you drag it in and then start associating levels with it so you can see some of the levels have none because they're completely controlled by blueprints both loading a level based off of the player's actions in the world like touching a volume or pressing a button or activating something and using the streaming volumes are considered the same thing the difference comes if you set it to always load it that's that that's the case where the engine goes if the persistent level is loaded I'm also going to load these sub levels and that's good for things like sky maps where you're your environmental map like the sky level here is set to always loaded so anytime I live with the persistent level it's also going to load the sky level and then you know all of the sub levels under that are are based off of your your blueprint scripting or your level of line behavior so T use gears isn't as an example again I worked on mount Kedar and gears - which is you're in a tank you're driving the entire level you can't get out and it's very much along the lines of the linear experience with some vertical stacking of levels so you start off there's an environment level that is the sky and some of the the like distant mountains and things like that and then as you move as you drive through the scene you're driving in and out of level volumes and at certain points I completely sever your ability to go back but either by having you drop down and since the tank can't climb back up you're no longer in view or in a in a position to progress back so I I just completely unload the levels behind you instead of just setting their visibility and then also eventually you you get to caves where I collapse them behind you and you can no longer go back and I know it's safe to unload certain other things then the reason to toggle visibility but not unload is usually if the player can go back and you don't want a eye to fall out of the world so say you drive past a creature that you've spawned you you get to another streaming environment and you you want to be able to go back and fight that creature if you unload the level that he's in he will be removed and discarded if you just toggled the levels visibility he will no longer be visible but when you go back and you enter the volume again you you can resume fighting him so it's important to note that toggling a levels visibility and toggling it's loaded state are two separate things one actually removes it from memory and destroys all the stuff in it toggle sets it all out for garbage collection and the other is literally just setting whether or not it's visible mm-hmm I've definitely seen quite a few different games to kind of utilize systems like that where it's clear if you leave just outside of the bosses area he'll be kind of fine but the second you completely unload yeah it just resets everything I think it's a couple of games that do that like Monster Hunter I guess kind of like you turns things invisible as you change areas but kind of persists in a way and then once you get back to town they just totally unload how much health the guy the persistent level is a great place for storing data that the streaming levels can use to set themselves up so in the example of like leaving a town and coming back if you want to store the state of whether or not you've opened a door or things like that you can store that data in the persistent level and then when the level loads it can kind of use that to initialize its logic to say well this door is its state is open you've you've purchased this from a storekeeper whatever all of that can be stored in the persistent level and then when you load those streaming levels in there on begin play event they can start going through and kind of go harvest this from the persistent level I'll use that to tell me my inherent data what what state it should be in so to talk about a bit of the level streaming blueprint stuff for example as we get here and start doing the actual level blueprint or blueprinted level behavior there's a couple different I keep trying to open a little goofer for that there we go so we have just a default trigger there's nothing special about the actual logic behind triggering it we then have a couple of different options for loading levels so we can do things like getting the current level and use that to find out like what level I'm in if you want to know for any particular reason so we can load or unload the streaming level and then you have the option of not having that visible so it's loaded but it's not visible yet and then here for example the rid of that when this triggers touched the level streams loads in block unload means should it actually wait until the levels loaded to fire completed to make sure that everything's working and there are a couple places when you start looking through this streaming level what you'll start to see that actually being used for example the door here when the trigger box here is touched it loads the next streaming level which is 4 and then uncompleted it fires the open door behavior in this blueprint now that does mean that this particular blueprint is part of the streaming level you're starting from not the destination so as I load here mmm and I think there's even text somewhere to reflect it you can see through to nothing oh yeah you could you could tell pretty obviously as we approach the door it loads it up yeah here so I can see I can clearly read streaming level sky through as I get close the the level becomes visible and the door will then open because the latent function is completed and opens the doors yep it's it's really important to just make that little note that you said earlier it's this has to be in the level that's already loaded down so that you can actually collide with it and get the overlap event and actually load in the next one after that yeah not not to mention you can't call a function on something that yeah it doesn't exist on pretty important mm-hmm and so things like making sure that you know that the next level was loaded this is a great way of making sure that the the next levels loaded before it actually fires the next batch of logic we use things like airlocks where I enter a room there's a door in front of me there's a door behind me I press a button the door behind me closes when the level is finished loading it opens the next door and an aggressor yeah and that way you can unload everything behind you while loading in front of you I know that I'm neither a little pace to micromanage things in that way yeah and typically we don't have transparent doors for that reason yeah it seems kind of like obvious once you see it happening behind the scenes that yeah if you look at and a lot of games do that right they have either an s-curve where you can no longer see the level behind you and while you're in that that usually a very small sublevel of a hallway you know that the the player is trying to get to the next section so you go ahead and and either switch in between streaming volumes or explicitly do that using blueprints so those are two of the like most common I would say game isms for for presenting it to the player is either stopping them and closing the door behind them and you know it's safe for them to move forward or giving them a stretch of hallway or or canyon or river or whatever that is going to keep them occupied long enough to make sure that you can get all of your your streaming levels in and out appropriately there's also things like intro next row cutscenes where we you know take the camera away from the player we present some small amount of data or show something that's interesting while that's happening we're also micromanaging the streaming state and then we have also done things like caused the player to trip or slow down stumble things like that which we know the levels not ready yet so slow the player down slightly to make sure that lil elbow can get in okay the levels in think they can keep moving yep you can see that in a fair number a lot a lot of games especially more adventure games and stuff seem to do that where they push you down a hallway slowly and it's pretty clear that's they as a designer you can tell what what they're doing have explosions that cause the player to stumble so you don't have much forward momentum you can't progress to the point where you can't see uncharted is very guilty of a lot of these yeah uncharted massive Andromeda does that a fair amount oh yeah feel like you're going slowly as you come up to a door there's a lot of games where you'll suddenly go into like talking mode and Gears of War even does the Saturday where they go into kind of a conversation mode and you can't run you could only do walk walking around like this yeah yeah they're all doing that number like Secret Service yeah with a good mic you don't need to hold your hand off it's the future they have really bad ones yeah who are sitting there wondering why they they you can't see their earpieces so yeah there's a lot of ways that designers will hide what's going on to the player and that's that's a good way to do that there's also a number of things that you can do based on whether the level is is loaded and things like that to make sure that it's safe to to move from one space to another and things like that so I would definitely recommend taking a look at this content example and some of the documentation with it it's it's all annotated so you can see what's going on there are a number of other ways to handle some of this stuff obviously world composition comes up a lot um that's generally designed for larger kind of open world spaces the idea is that you have this kind of grid of places that levels can be it's not actually a grid but it's it's if you think of it in terms of a 2d plane and then your your levels get positioned on there and as you move through them it's much more of the checkerboard style of loading levels where you you really don't ever want to be in a case where there's no level around you so you're moving from one chunk of sub level to another the world composition logic is handling whether or not levels are close enough to be to to be visible and we use lots of stuff like hierarchical LOD or H LOD to loading content as you close to it and see that and I think Alex already put up some the documentation for that yeah actually uh we have so for HL o DS we had both a couple of Doc's around and I'm gonna make sure to include these in the descriptions and stuff but we did a previous stream with Tim Hopson and Ian shed and and we all came on here and first debated how to pronounce H LOD it's not pronounced flawed no but I mean for H log just you still get the the key consonant of yeah H and then LOD to let you know that you know but yeah at land of Destiny but we we did cover H LEDs in another stream and the for world composition that one's going to have to be a future training stream because that's like a whole yeah it's a massive system and it's really great and and I believe you're telling me it was designed kind of for a large world game yeah the idea was that like when you're doing a linear experience and used gears because it's got kind of the key components for that it's it's a finite set of of interactions you know the player is likely to be along this path and it's it's not trivial but it's manageable to set up the the interactions in a way that the players never really aware of what's going on in a more open world setting where you can literally just you know pick a direction and start traversing at whatever speed the player is allowed to move that the the interactions and and the amount of micromanagement goes up dramatically so it makes a lot more sense to have a system that handles that for you and then the designers are informing the system versus having to build that from scratch every time plus as a system there are a lot of things like optimizations that can be integrated that that make the whole experience better so for the more kind of freeform open exploration type environment whether it's something like Mass Effect with a big planet or an MMO or something like that where your player could just conceivably wander off in a direction world composition is the intended solution for that mmm it's definitely for kind of stitching together the large landscapes we had kind of a few questions about that and when we get to this I'll just kind of point back to this but we do have a couple questions very specific about this code wing asked off of the forums can we build such dynamically dynamically generate levels and stream them into the game or would you do it differently and I believe the answer is do it a little bit differently yeah it is there's a couple different kind of approaches that I would look at in terms of that one is having the blueprint logic in the level look at I said the begin play gets fired when the level gets loaded so you can have a level that essentially has its own random behavior for setting itself up right if you have if your level is built out of blueprints that have different configurable options you could have your your begin play in that sub level set things up differently every time that level is loaded and unloaded so that's one possibility the others there's actually a blueprint function for load level instance and this is different than loads streaming level in that low level instance basically creates a new copy of the level and adds it to the the current environment you can see it takes not only a name but a location of rotation and it says whether or not it's successful you can get whether or not the levels loaded and whether it's visible off of this and this is the I'm going to piece together levels based on logic instead of based on the explicit level browser so as long as you know the name of the level and you could easily have a a list of these levels just remote now right-click promote to variable yeah I see what you're going for and then yeah you just click make a rate of that yeah I mean normally I just or you can take okay but yeah so if I wanted to have an array of variables I get yep exactly and through this you can create what is procedural generation using the level system yep now obviously you'd want a lot more structured logic than just randomly a level it'll be fine yeah yeah was together it'll be fine what could possibly go wrong but this would let you have something like the the level is created for you you know I have a menu I select level and the level just appears in front of me in game whether it's you know I'm doing some magical portal thing where I'm picking what environment I'm going to go to and going through it like that or whatever but because it also gives you a location and rotation provided you know the layout of the level or can derive that from something you can basically build up your environment out of pieces that may not necessarily look the same the next time you could have random seeds like I've got here where you're just picking one from an array or it could be cyclicals so you know a then B then C then D and not have to have those part of the level browser so this is the this is probably your best bet as an approach to dynamically building up an environment you have X number of pieces that are somewhat modular eyes they they you know how they they need to snap together and you're using this system to like rotate them 90 degrees and attach them and build them that way awesome formula e has a follow-up to this what is the memory impact of using low load level instance if I have two instances does that mean double cost it's not double cost because of the way we do instancing but it is going to increase the cost of having levels loaded and and stat level and that memory will give you an idea of that because for every unique instance of a static mesh let's say you have four pillars in a row you load that the core pillar mash into memory once and then there's a certain memory cost for each instance that tells the engine how to render each of those instances in their location with whatever properties you've defined for them uniquely things like that so it's not the exact same memory cost duplicated but there's going to be some overhead yeah um so it's it's a level space stat base level and then it's stats based memory sherpas mmm I just like to always make sure that step memory stats based memory so you can see how much memory is being used you can see which levels are currently loaded and unloaded sweet yeah we've just got quite a few questions in about like how do I know what's being performant what's heavy right so you can actually see as I cross over this border yet you watch the numbers junk god I can't see just the reflection capturing memory alone goes from six and a half roughly or six point seven to seven point eight five and that's one of the things where it would like things like reflection captures would double because there's no instantiation of those between instances of a level so if I was loading the same level seven times I would have seven sets of reflection captures but the actual core static measures that make up the level may not be loaded into memory the same way I would incur a small cost but not a a geometric cost to to the linear cost to loading a power rate same thing with the kind of a cost question here do you have kind of offhand what what the difference is between performance wise hidden and unloaded level or a hidden level versus an unloaded letting us unload it is there's no cost because it's just yeah unloaded well there's there's there's some costs during the unloading with us and the CPU is working to unload level yes the difference the biggest servers been loaded and unloaded or visible and loaded if it's loaded but not visible it's still in memory there's still it the engine still is is maintaining the state of these objects it's just not showing them to you so level visibility is much more on the GPU side of things whereas level loaded is GPU and CPU and memory yes Alex is waving at whom he like someone in chat accused us of actually being a simulation of ue4 unless I waved up yes so well I mean we've got you know animation blueprint this is all procedurally generate literally alex is sitting behind this puppeting both of us even Glynnis commentary in the chat is all just procedural generation yep we did just release the photorealistic yep example content yeah we actually have that new it's it's a I call it twin bust it's not actually twin blast yeah it's this twins which went through a lot of iterations oh yeah so we'll cover that one Thursday - but yes new content out there alright um let's see here some more questions yeah we've got we've got quite a few here so of quite a few people are of course asking if I have some logic that must be processed before new area streamed in are there events I can use to trigger that well that's again if you look at the specifically in this example content you know the the door here right the door itself it's it's like a series of kind of switches in a way where it's like well it's not even that it's even I'm just like it you know grab there so in the level blueprint mm-hmm when the streaming level loads this is what's called a latent function meaning it doesn't progress until the function is completed and you can tell that because this little clock on it and so that means when I mouse over for it is completely latent yep streaming the level with the level name calling again before it finishes has no effect what this means is that I can call this from from tick and it's only gonna do it the the ones and it will only fire when this is completed which means most likely you would never want to do this from tick but it means that I know that once this is visible and loaded it's going to fire off this behavior meaning that I can rely on this particular chunk of logic to say it's now safe to call further behavior because the level has loaded successfully the level instance has a out success boolean and it returns an object that references that streaming level so here's where you can go is loaded get the space with the same boolean that says it's successful but if you're doing this somewhere else like you have a portion of your blueprint that's just handling level loading behavior and then you also need to know elsewhere whether or not the level is successfully loaded you can just reference this promote it to a variable for example and then grab that and say is it loaded mm-hmm which this all answers another question of course so here's where you would say I have a manager that says here's the levels that need to be loaded and I'm gonna set their location or rotation based on whatever the player is doing and then elsewhere you have a should I allow this to happen yes or no based on this level being loaded yep because that was one of the questions Zeo URI had asked us if there were things that we can use to see if on if the level is loaded or etc and so yeah there's on level loaded is level loaded yep and again that this is there's a lot of logic is already built into the level streaming behavior that says it's safe for me to be for functions to be called on me it's it's safer logic to assume that I'm now loaded and things like that cool now we have quite a few questions about multiplayer as well now when you were developing gears there's also a co-op multiplayer but there's also like online multiplayer etc so can you talk a little bit about level streaming with multiplayer in both of those instances for the most part for games like Gears Unreal Tournament stuff like that we use streaming levels as a way of dividing work versus loading content into and out of the game the reason for that is with multiple human players the odds that any level any particular level needs to be loaded goes up quite dramatically for co-op games this is different we basically block make sure that however many co-op players are currently in the world are all inside the the area that says it's time to move to the next streaming level we don't allow them to go in completely different directions and load separate sub levels unless the game design calls for it but for multiplayer level for multiplayer say arena based shooters or things like that things like Unreal Tournament we use streaming levels as a way of dividing work between people like I was talking about earlier where alex is working on lighting and I'm working on audio because that allows us to do more work simultaneously more people can focus on building out a level but moat for the most part those are tagged as always loaded so we're not utilizing the level streaming behavior so much as we're using it as a convenient way to to divide up tasks so that's that's that's our kind of typical workflow for multiplayer maps that do use streaming either we know you're in co-op and we're specifically setting up logic in parallel with the single-player for example with Gears we just had a is co-op game boolean set that the the gameplay team had written for us it's just one more if it's like one more little thing to it it's basically a branch for any kind of door interaction that caused a streaming level that says should i if I'm doing a cinematic intro/outro thing I'm going to teleport while while the camera is working I'm going to teleport all the players to their new location but not let them have input cinematic completes and I've now moved all the players where I need them to go if it's something like the airlock thing I wait until all the players are in the airlock before I let the door close right the it basically says all your players need to be here before this is active things like that and in fact some games even prompt you where it's like in order to predict personally and even in really old-school like arcade games in order to move to the right side of the screen and the other guys come over and you get total dragon stuff I mean you could always do the I'm going to kill off the player and move them here yeah yeah Morgan just do like a prompt saying the player one is ready to proceed do you want to teleport to this location and proceed yes and then it just moves you to some area around the players trying to access the neck the neck zone kind of like the like a World of Warcraft thing where the you know the leader is trying to enter the instance do you want to go with them yes so there's there's a fair amount of logic that you can kind of set up by yourself in a lot of cases gameplay teams will write their own specific functions based on what type of gameplay objects the players interacting with to cause this type of behavior right if your game has a dropship that comes down and picks you up you may want to have something that says you know here's the pickup zone all the players need to be within that inform the player of that and and move forward from there awesome let's see here next question is oh do large nav meshes work with level streaming I was hating this is from GMI asks I was hitting navmesh size limit in a large level and was wondering if I would if it would be able if it worked better to split it into smaller chunks and stream it that will work you you have to be aware that when you unload the navmesh if you have a eye that's out there say so you have your loading and unloading nav meshes but you're not loading and unloading the level but they sit in right you kind of have them proportioned out that way you want to be careful to make sure that a eye that cares about the navmesh has a nav mesh to be on when no or else is just going to stop and be unable to find their their route to whatever their goal is so and then and something like a large open world thing where what we typically do is have the world composition handled loading and unloading the nav measures as well and then very simplified movement for you know we've had a couple people also asking about AI we kind of talked about a little bit in the being in the stream is there any other advice you'd like to purr for take a pause in terms of AI how to handle it when it's leaked let's imagine you've rounded a corner and done that drop down off to the next row coming around that corner and dropping down so depending on what's going on if you have something where it's explicitly following the player because typically what we do is we have a a streaming level that is dynamic objects so we can load and unload those dynamic objects and leave or not the static geometry it's like you know the actual environment alone so that lets us kind of micromanage whether or not the AI is going to be allowed to continue in the case of a drop down conceptually I'm usually severing ties with the previous environment right I'm killing off all the AI I'm unloading the level explicitly I'm just going you are gone if I come back I everything will reset or I'll I'll have a persistent flag that says don't bother spawning the AI or something like that but if you want it to to follow then typically what we had to end up having is either we spawn it to the persistent level you have like a remote function call that says something happened in the sub level and in the persistent level I want to create AI that's going to live basically as long as the the player at that point unless I explicitly kill it off that way it's it's taking advantage of the fact that it's it's I can I can now unload the purse to the streaming level that initialized this behavior and not lose the AI creature itself but again you have to be careful with the fact that the AI is going to be looking to have collision with the world and a navmesh to find its way in if you unload those things under it you're gonna end up with the stranded AI taking up CPU cycles and doing nothing you've utility yeah if it's just kind of off they're running around trying now the gable or if it's just sitting still occasionally pinging trying to find its route yeah it's not like you're gonna eat up a third of your CPU doing that but that kind of thing is cumulative and does add up so I'm gonna be careful not to orphan your a is much as you can get away with don't orphan your a is yes I kind of like that as a phrase you shouldn't orphan people either but AI is important yeah they they might turn evil one day and yes guys don't know that all right so next up Mott's a matzo ugh okay I think that's your name matzo ugh asks what are the best ways to set up level loading / streaming for VR or any other advice with long fades I mean a lot of the same techniques to apply I think we also kind of talked about this in some of our other like articles and some of our previous streams the one about cinematics we like you said the long fade yeah we'd what we did in robo recalls we have like an egg that you're in that's all black or white and then it just fades off or right do you this week and we've done that for various other demos and things like that the matter of fact the human race cinematic that we showed at GDC when you fade from the car configurator and literally there's a black sphere right in front of the camera that I control the opacity and it doesn't write to depth so it's always weird rendering on top of everything else and everything goes black and then when it's black that's when we transition there's some guidelines I don't know I don't have the link offhand but for VR like you shouldn't do things like move the camera independently of the play the the players head unless it's absolutely necessary because it tends to unsettle people stomachs the same with teleporting transitions if you look at Robo recon a number of the games you don't teleport in a single frame there's a fade a transition to help your your inner ear kind of stabilize and not have people get uncomfortable the same is true for for level streaming right if you are a VR and you you grab something that should should transition you to another level your safest bet is to fade off when the fade off has completed do your level transition and then fade back up like over 2 or 3 seconds to make sure that you know everything is smooth for the player and for their their their equilibrium yeah otherwise you're gonna throw them off and make a puke yeah really it's I mean making games isn't about making people throw up yeah at least not for me it's important I mean unless it's like a primary mechanic of your VR title I think in which case you need a very different environment than say my living room please don't play those kinds of games in my living room yeah cool the next question we have on here see Mateo again asks what are said are there any ways to get rid of hitches when using low level instance nodes that's challenging because a lot of it has to do with what you're loading right if you have a lot of content that gets loaded all at once the engine has to handle at some somehow there's a couple different ways of ameliorating that one is to make sure that you don't load large amount of content all at once you can sequentially load smaller pieces another is to not have a lot of physics active immediately on the assets that you're loading a lot of hitches with level streaming are related to either a large amount of content coming to view all at once so suddenly your your GPU thread spikes up CPU spikes due to large amount of content being hitting the i/o bus and loading plus physics initializing which typically is a pretty big hit to the CPU and a I don't have everything spawn at once have things spool out over time so that you have some kind of you're spreading the hitch out and making it less obvious and that's a that's something that we talked about also in the row will recall stream about the guns when they were firing the shotgun for instance not everything fires on the same frame and they did that so to prevent hitching yes it's nuts yeah basically the less you do instantaneous and simultaneously yep the better things like hitches and and and things will be exactly next question up on here streaming level on dedicated server streaming levels always hang on there's he reworded this question and I think the rewording is a little bit easier and better on yeah can I set up the streaming levels to always load on a dedicated server and use client-side streaming volumes for the clients to load slash unload in the streaming levels I had thought we did that already we do I thought so so that the but the idea being that the data fated server can like a I can navigate on the dedicated server on the client side is the client receives data that the AI is moving correctly but doesn't have to have the same content loaded but I I don't know the correct answer for that alright that's a handle far off distance measures again that's a cello tease you can do other things like you can have a handoff where you have say a to go back to under oh one there's a tower that's visible in almost all the outdoor levels it's literally built into the distance for all the levels matter of fact I think it even switches like Sun sides and stuff like they got it wrong oh well but what you can do is with the concept of the like sky level if you have something in the sky level that is do you eventually reach like whether it's a skyscraper or a large mountain or something like that you can always switch levels so you can say I'm getting close to this so load the level that contains a higher detail version of this landmark and unload the one the lower resolution one so you can kind of stair step your way to the higher resolution without necessarily using HL 88 ility is the whole purpose behind it is to take collections of doesn't make simplified representations for things like that but if you're only doing like one particular thing and you want to make sure that it loads kind of progressively closer you can have sub levels that are only that object that get that load more detailed versions as you get closer awesome that definitely answers a couple other questions about dealing with large worlds again we're getting a little bit closer to three here on time so I'm gonna probably wrap it up with one more question that's kind of a big one sorry guys oh okay I have a world that 64 terrain streaming proxies but I have a helicopter and it looks really bad when I'm flying above the world so I guess in this one's kind of a I have a very large world and I want to see a lot of it we're a composition this is yeah that's that's kind of what that engineered for so I think the CPI on on when we schedule a stream directly talking about that is is gonna be a better bet yeah I wasn't sure if that would also cover if you're trying to look at something really far away that hasn't quite fully loaded in yet but if that's the case then we'll have together that's definitely along those lines so somebody asked about specifically demonstrate level streaming workflow whether you start with the complete level and split into sub levels or if you oh if you start with all the different chunks and pieces right one zero piece I guess we can come you know depending on how you're working you may find that your assumptions about which level things need to be in are wrong or that you have a level that is too heavy for what it needs to be so there's if in looking at the level browser like if I select streaming level three and drop this object in because streaming level three is now my my current or there now its current I can move this actor between levels so let me switch over to level one when I right-click I can see that this object is not in my level because it's off to make my current level that leveled this object is in or I can move this actor to my current level so if I hide streaming level 1 now this bench piece goes away or this arch and conversely if I switch to streaming level 3 and move it between levels again one goes away and the object still stands there 3 goes away and that object disappears so we use that to kind of micromanage which actors are in which levels but you can also take this and create a new level with the selected actors meaning I'm going to take these this chunk of level and create an all new streaming level that it will automatically add to so the only thing in this streaming level is this one actor and then I can say you happen to be always loaded and now my persistent example and streaming sky are always going to be loaded no matter what so if I came all the way down here again all of this geometry it doesn't actually have to be in you know like a checkerboard pattern where it's in this part of space therefore it must load and unload I can easily micromanage that and say my my little level prop here could be the the tower we were talking about so now it's always visible and then I can explicitly load and unload to that if I want or I can make it any any of the other styles of streaming levels and control its visibility that way awesome that is how we take existing levels and create all new streaming layouts you can either chunk it up further you can create a new level from scratch and begin working in that and populating it and that's that's generally speaking when we're doing our initial pass-through is I'm gonna start the first system level I'm going to create a sub level drop a bunch of stuff in visually move off to the side create a new level drop some stuff in and so on and then I'll start going back and refining what is on which side of either streaming whether this thing should be in a new streaming level and visible longer things like that and then the streaming volumes control based on where the player is which of these things should be visible in which what these things should be in memory awesome it's really good to have all that info out there now that's about what we have for time for today so thank you so much Alan for coming on you did it on kind of short notice and you rocked it thank you so much for bringing all this information about deeper the one button yeah the one button it's okay every now and then there's a well know that button didn't exist the last time I set up streaming live arrives so in my defense it's been a few version had been moved yeah yeah and actually I don't think we've had a stream yet where we didn't have a developer come on and actually have to like sit here for a second really where is that fish oh so so check out some of our previous Robo recall streams where we have like chef Ferris company here be like I didn't even know that that existed McDonald's is doing stuff but yeah it's a lot of fun to check these out please come check out content examples this is the streaming levels map you too can follow along with this stream we'll have the YouTube archive up don't forget like follow subscribe hit all the buttons all around us in every direction and all that and we will see you on Thursday button right before the uh sorry we will see you on Thursday for the spring ue4 jam results and also these ponies not working no don't touch the button said push all the buttons behind find very literal keyboards but yes we will see you all on Thursday where we will in fact have will talk about the new bust that came out for the realistic hair eyes and skin rendering and additionally will reveal the ue4 Jam winners and I'll play them live and if they're multiplayer wall so probably have to grab Clint over here to bring them on screen can they see that you're very excited they can't see how excited he is he's very excited he actually fish probably fist bump you is very hype very very much so yes we'll see you all soon thank you all for coming out
Info
Channel: Unreal Engine
Views: 59,061
Rating: undefined out of 5
Keywords: Game Development, Level Streaming, Gamedev
Id: GkDg9GPpzXE
Channel Id: undefined
Length: 60min 34sec (3634 seconds)
Published: Fri Apr 21 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.