-
Notifications
You must be signed in to change notification settings - Fork 77
Basic Navmesh Editing
What is a navmesh and why do i need it?
A Navigation Mesh represents the "walk-able areas" of a map. This data is required by Bots [...] allowing them to "know" how to move around in the environment. Navigation Mesh data is stored in a NAV file corresponding to the map file (.bsp) for which it is used. For example, the nav mesh for cstrike\maps\de_dust.bsp is stored in cstrike\maps\de_dust.nav.
Source: https://developer.valvesoftware.com/wiki/Navigation_Meshes
The zombies in the gamemode use the same system, so i recommend reading the linked article as an introduction.
To create a navmesh you can press the generate navmesh button in the settings drop-down of the F1 menu
. This will trigger an auto generation. The generation takes some time depending on map size and your PC specs, so be patient even if your gMod is not responding (It's a performance hungry operation). Once the generation is finished the map will be reloaded automatically. You can test if the generation was successful, by entering nav_edit 1
in your console, if you see colored squares on the ground the generation was successful. Those colored squares a called Nav areas, and represent a walk-able space, that means the zombies can move everywhere those areas are present.
The auto generated navmesh is enough to make the zombies move, but since its auto generated it will have some issues. Read the following sections to learn who to resolve those issues.
It's highly recommended to apply the information of the following sections to your navmesh, to lower the chance of zombies getting stuck.
First of all make sure that nav_edit
is set to 1
or you won't be able to see your changes.
Sometimes the auto generation will generate areas under objects and therefore marks them as walk-able for bots even though they can't walk through the object. Once again you need to delete this areas and leave a clear space around those objects so bots can evade them. Most often you will see this at corners of rails.
You will need to remove those areas by using the nav_delete
command in console or by choosing the delete mode on the nav editor tool (Tool Page)
Examples:
Example 1 Fences/Rails:
Example 2 Poles:
There will be some areas on top of objects or walls that are not reachable by bots (and players), they should be removed by using nav_delete
or the delete mode in the nav editor.
Examples:
Example 1 Boxes: