Navmesh VS Nodes (GAME AI)
In most games, such as Garry's Mod, every NPC (non-player character) either has navigation code using navmesh or nodes.
What is a navmesh?
A navmesh code is when an NPC calculates how to get somewhere. Let's say we have an NPC whose goal is to get to a certain object. Navmesh squares, which are invisible 20x20 metered ground squares, allow the navmesh NPC to get to the object. When the NPC reaches the navmesh square containing the object, it will move directly towards it.
What is a node?
A node is when an NPC has the knowledge of where it is able to go to. Nodes are much harder to code because it is pin-point accuracy on every point on the map. A node point is an invisible stick pinned on every little piece of a map. NPC's are much, much smarter than navmesh-coded NPC's, because, the NPC has to go to a player and talk to it. The NPC quickly calculates multiple paths that it can use to get to the player and recognizes the node that the player is standing in. This is good if you want to code an NPC that is extremely smart.
However, a command you can use in the console is "nav_generate". This will make all NPC's study the map using navmesh AND nodes at the same time. Generally, the navmesh will finish first since it studies larger areas, but nodes take longer since they have to study every meter
of the map.
of the map.
Waypoint Ggraph is "Nodes"
Navigation Mesh is the full name for "Navmesh"

Comments
Post a Comment