Clarification on Navmeshes

Post » Wed Nov 16, 2016 9:00 am

A bit ago I was working on going through the Creation Kit introduction for Skyrim modding, and got hung up on the navmesh section. I am confused as to what exactly the navmesh does: does it control exactly where actors (AI) can go or is it just a general representation. In other words, does it act as the "ground" for an actor or just as a baseline that says "actors can walk here as long as they are slightly above/below the navmesh?



The reason for asking is that I originally thought that the navmesh was responsible for specifying exactly where an actor could go, meaning that a sloppy navmesh that was accidentally a meter above the ground would cause the actor to be a meter above the ground. Or a navmesh that cut through terrain would allow an actor to also cut through the terrain. This made me be extremely dilligent with navmeshing to the point of taking all my time (so I quit).



However, recently I've begun to understand that this is incorrect and that the navmesh is more of a baseline. This would make much more sense, as they you don't have to be nearly as careful, but rather get an approximation of terrain features. That being said, this could be taken to the extreme and result in a perfectly flat navmesh that covers everything. I'm assuming that this wouldn't work properly, but why not? Does it have to do with pathfinding?



Any help would be greatly appreciated, as I am ready to get back to it sometime soon! Thanks!



Disclaimer: This may be a obvious question to most, but I am unfamiliar with game AI and pathfinding.

User avatar
Vickytoria Vasquez
 
Posts: 3456
Joined: Thu Aug 31, 2006 7:06 pm

Post » Tue Nov 15, 2016 7:04 pm

My understanding is that it's a bit of both. The collision surface, not the nav-mesh, will determine where the root node of an actor follows. So stairs can have a sloping plane as a nav-mesh, and you don't have to follow every step and riser. But also, a spawned actor will be positioned on the nav-mesh and then dropped to the ground, so if the nav-mesh is below the floor, they'll drop too far.



The main purpose is path-finding, as you surmise. A flat nav-mesh would not allow things like spiral staircases in towers to work, so there is some requirement for the nav-mesh to approximate the walkable surface, but since it also needs to approximate an irregular ground with flat triangles, it can't be exact.



Plus the nav-mesh also records preferred paths, arrival points for load doors (which gets used in combination with the door marker. The door marker aligns the player, and the nav-mesh is used for followers(?)



I could be wrong on some of that, as most is based on observation, but others will no doubt add their own insights.

User avatar
Claire Vaux
 
Posts: 3485
Joined: Sun Aug 06, 2006 6:56 am

Post » Wed Nov 16, 2016 12:03 am

NPC's don't walk on navmeshes they walk on the collision surface but they won't exceed its boundaries either i.e they won't progress beyond the edge of the navmesh. Nor does it negate collision objects either if your navmesh extends underneath a wall surface they will try to walk through the wall but the walls collsion will prevent them from progressing.



It doesn't have to match the collision surface as you surmise there is a certain amount of leeway I'm not what the exact tolerances are but its fairly generous.





Load doors require a navmesh triange to be directly underneath the door marker then you finalize the navmesh and the triangle should turn green, that means its now linked to the marker. You also have to do the same to the other navmesh and the other load door in the other cell. Without it the NPC's will be unable to use linked doors.



There is also another record for undewater areas its marked blue I'm not sure how those function

User avatar
leigh stewart
 
Posts: 3415
Joined: Mon Oct 23, 2006 8:59 am


Return to V - Skyrim