Navigation Mesh

From Valve Developer Community
Jump to navigation Jump to search

A navigation mesh needs to be present to allow units to move around in a new map. This should be generated every time there are changes to the map that would change navigation data. The navigation mesh controls all movement in Dota 2 and defines where units can or cannot move to.

The navigation mesh in Dota 2 is a 2D plane generated from the top down. This implies certain limitations such as overhangs and bridges that cannot be traversed beneath. The mesh consists of a grid of 64x64 units that encompass the entire map. In order to generate a navigation mesh a material must be present on a surface in a custom map that is walkable. All of the "blend" materials have this attribute. Custom materials should specify a "User Material Attribute" of "dota.nav.walkable 1" to allow the navigation mesh to generate on top of it.

Note.pngПримечание:Props such as rocks or signs do not have collision in Dota. Most of the time this is preferred; however, if a rock of a certain size is placed, it may be desirable to clip that space off to prevent units from moving through it.

Hammer Navigation Preview

Navmesh button preview.png
Preview of the navigation grid inside of Hammer.

It is possible to preview the navigation mesh before seeing it in game. This can be accomplished via the navigation preview button in the top tool bar. This will dynamically draw the navigation grid on any valid surface. In game it is possible to preview the grid by typing "dota_gridnav_show 1" in the console.

Значение цветов

  • Green: Открытое пространство - Любой юнит может по нему передвигаться
  • Red: Закрытое пространство - Cannot move here. Large height deltas between grid squares or clip meshes can cause an area to be blocked. Flying units can still pass through these locations.
  • Purple (Hammer Only): Blocked Dynamic - ent_dota_tree will show up as these inside of Hammer.
  • Blue: Hero Clip - Герои не могут войти в это пространство
  • Yellow: Creature Clip - Юниты контролируемые AI не могут войти в это пространство. Это не относится к героям которых контролирует AI, они подчиняются тем-же правилам, что и герои которых контролирует игрок.

Creating a Navigation Mesh

The navigation mesh is created automatically when the map is compiled.

  • Click the Run Map button on the upper tool bar or press F9
  • Build Physics must be checked
  • Build Grid Nav must be checked

Clipping

Example of clipping an area off from units.

Unlike other Source games where clipping can affect the collision of a model against a surface, in Dota 2 a clip mesh only affects the navigation grid square it contacts. Texturing a mesh in one of the clip textures will cause it to influence navigation grid it contacts. Clip materials applied to meshes are invisible and will not render.

Once a navigation mesh has been generated for a map it will be made up of a large grid of squares. Each one of these squares contains clipping data for any unit trying to pass through that location. Player controlled heroes are still units.

Types of Clip Materials

Materials can be applied to mesh surfaces to provide data to the navigation mesh when compiled to affect navigation through the world. To learn about mesh construction and material application to mesh faces, see the basic construction tutorials.


Ниже находятся типы материалов clip, которые могут быть применены к mesh.

Skip
Блокирует зону для передвижения наземных юнитов. Для летающих юнитов данное пространство остается доступным для передвижения.
Clip
The most basic variation that units can traverse on top of but are treated similar to terrain in that ramps, stairs, and other shapes can be created and the navigation grid will still generate on top of them. A bridge over a river is a good usage case of a clip brush.
Hero Clip
Герои не могут пройти это пространство. Этот параметр влияет на наземных юнитов и летающие юнитов.
Creature Clip
Подобно Clip героев, но блокирует юнитов под контролем AI.


Tip.pngСовет:As the navigation grid is made up of 64x64 unit squares it is often easier to create a small 32x32 column in Hammer, place it in the middle of the 64x64 grid square and duplicate using arrow keys rather than encompassing an area with a large single brush. This is useful for very accurate clip placements but not recommended for large swaths of area to mark off.

Консольные команды

dota_gridnav_show
  • "0" - Выключить
  • "1" - Basic Clip
  • "2" - Hero Clip
  • "3" - Creature Clip