Fully Dynamic NavMesh And Navigation Invokers; UNREAL ENGINE

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi guys in the last video we took a look at Dynamic nav meshes with modifiers only in this video we're going to take a look at the fully Dynamic nav mesh option and one of the things we're going to take a look at with that Dynamic nav mesh is navigation invokers so let's go ahead and get started with that okay to start we're going to go to edit project settings and we're going to search for runtime and under the navigation section we're going to look at runtime Generation by default it'll be set to static and in the previous video we looked at Dynamic modifiers only that's where the nav mesh stays basically static but wherever you place nav modifiers those specific areas will be dynamic so that allows you to control the resource cost on your machine but in this video we're going to take a look at fully Dynamic that means every nav mesh tile that's drawn is going to be dynamic and so it's a very resource intensive nav mesh but let's go ahead and take a look at it and see how we might use it so we'll go ahead and select it and we'll close the project settings okay so let's go over to our navmesh recast object and we'll select draw poly edges and that's just so that we can see the tiles that are being drawn and we also want to see what effect the dynamic nav mesh has so let's go ahead and start the game okay let's turn on the nav mesh and then we'll go over here to our setup and what we're going to see is that each and every tile in the nav mesh is performing a constant tick to detect any changes in the geometry above it now that works really well for these two tiles and these two tiles because they have changing geometry but unfortunately every single tile in our nav mesh is also performing this exact same constant tick and that's just kind of wasting your computer's resources so what we want to do is change the dynamic nav mesh so that it only ticks when and where we need it and that's going to look something like this so here I'm using something called navigation invokers and what that does is it invokes the nav mesh only around the characters that I designate and only out to a certain radius so that means that the rest of the nav Nash bounds volume is going to remain empty until I walk into that area and so the benefits of this is that now I'm performing that constant tick over a smaller number of tiles and that ticking will only update the nav mesh when I tick near objects that are actually moving and as I walk away from those objects all of that extra ticking and updating stops so now I can have a nav mesh over a much larger level and not have to worry about all of this extra resource drain so let's go ahead and see how we create these navigation invokers so let's go back into the project settings and we already have the nav mesh set to Dynamic so now we'll search for invoker and here under navigation system we're going to check this box to true for the navigation invokers only option and when we close the the settings the first thing we're going to see is that the nav mesh has disappeared so it's important to note that the navmesh balance volumes are still there because those are the volumes that we're going to invoke the nav mesh in okay so now how we designate individual characters as having as being able to invoke the navmash is we're going to open up their uh their Blueprints and we're going to go over here because I have some AI characters that are waiting for our player on the other side of the map so I'm going to open up their blueprint and I'm going to go add component and I'm going to type in invoker and I'm going to select navigation invoker and then over here in the details panel under navigation there's tile generation radius and tile removal radius right now I'm going to set them both to 200 but we'll come back to what these are in a bit I'm going to compile and save and when I close this blueprint now these characters are invoking the nav mesh around them up to a distance of 200 units and the same is true for the player so I'll go ahead and start the game okay I'll show the nav mesh and let's go ahead and go over to the other side of the map where the AI characters are and we can go ahead and check them out and over here we see the um the different AI characters is kind of wandering around on their own nav mesh until they see the player and they go ahead and chase them let's see if we can find the other guy and so now he's chasing me as well okay so everything seems to be working so far so let's revisit the uh the nav mesh radius for the invoker and let's talk a little more about that okay so back here on our character blueprint with the navigation invoker component selected earlier we had saw we had seen the tile generation and removal radius so again the generation radius is how far out from the player new tile will be generated and the removal radius is how far once the player moves away from that location will those tiles be deleted now generally you want the removal radius to be a little more than the generation radius and that's just so that there will be a trail for characters like your followers or enemy characters to kind of Chase you they'll be able to keep track of of the trail you're leaving behind but now the question is is how far out should you um actually set these values so if we go back into the game real quick and if we turn on the navigation system we can see that he can walk around here but if he Clicks in an area where tile hasn't generated yet he can't move because there's no tile there now we can understand that because we can see these green tiles but when the person is playing your game they're not going to understand why clicking there isn't doing anything so what we want is to zoom the camera all the way out to the furthest extent that that we have it set to and we want to make sure that tile will always generate and be removed off camera so that it never interferes with where the player is clicking so let's go ahead and go back to the character blueprint and back on the tile generation and removal radius I'll set them back to their defaults which are three thousand and five thousand now these seem high but that's actually the suggested default numbers so that's not going to be enough to actually cause any resource problems for your computer it's just going to look really big on my map because my map is actually pretty small for this demonstration but it's assumed that you're using this technique on a really really really big map so these values actually aren't that bad but I already know that these still won't cover my entire screen so I'm going to try them at 8 000 and 10 000. and we'll see what that does and so when I hit play and I turn on my navigation my nav mesh I'm going to see that no matter how far out I zoom any new tile being generated or old tile being deleted is always going to happen off camera so that the person playing the game will always have a valid place to click on screen no matter how far out they Zoom and the only exception was that there is a bald spot here but that's because I specifically placed the null area so that we could use the nav link so that doesn't count but on the other side of the null area we can see that the nav mesh is generating all the way across okay and so now let's talk about some games where you would actually want to use this uh this technique so the type of games where you would probably want to use navigation invokers is when you have a very large map but different types of games will have very large Maps so for instance you might have like an open world RPG something like Skyrim or Fallout for open world games like that I generally tend to use a different technique called level streaming and we'll do it another video on that specific technique but for large Maps where I would use navigation invokers that would be something more similar to like a Diablo or a Titan quest game something where you're doing like a bird's eye view or an isometric top-down View and the character has to go from one side of the game world and Traverse across all the different traps and and enemies to the other side of the game world that's really where navigation invokers seem to work the best um so I hope this video helped please like And subscribe and I'll see you guys in some other videos
Info
Channel: GamingDev2020
Views: 2,634
Rating: undefined out of 5
Keywords: Unreal Engine, Blueprints, Fix NavMesh, Pawns, NPC, NavMesh, Nav, Nav Mesh, NavMeshBoundsVolume, Nav Mesh Bounds Volume, Dynamic NavMesh, Dynamic Nav Mesh, Dynamic Nav Modifers, Navigation Invokers, Generate NavMesh Around Pawns, Generate NavMesh Around Character
Id: YAStYjqSVzA
Channel Id: undefined
Length: 9min 47sec (587 seconds)
Published: Mon Sep 04 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.