NAV (file format): Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
m (fix merge notice)
 
(59 intermediate revisions by 21 users not shown)
Line 1: Line 1:
[http://coastguard.gov.ph/content.old/license/rnqxkr.html asp news] [http://hoosierfishing.com/phpBB/images/avatars/avatar/twntbt.html rose valley lake pennsylvania] [http://tarsierfoundation.org/content/license/akvpoj.html long beach wa cabin] [http://www.biblored.org.co/agenda_actividades/programas/images/jedrma.html point rental sale software store] [http://xuccco.org/themes/AT-Green3/vxxgfu.html nj college closings] [http://asie-voyages.com/upload/images/lens/hwfkhw.html lemon aid com] [http://coastguard.gov.ph/content.old/license/jttqpu.html public storage truck rentals] [http://cvscaft-tcc.edu.ph/gallery/uploads/cache/nawwci.html purchase mailing list] [http://www.biblored.org.co/agenda_actividades/programas/images/mpnsgq.html naked lesbian porn] [http://smallbizbohol.com/democatalog/images/baner/lwnqvv.html preoperative care] [http://smallbizbohol.com/democatalog/images/baner/dgcvph.html valence electrons in transition metals] [http://www.sedbogota.edu.co/FINANCIERA/temp/tmp/uvqxwi.html vulcan engines] [http://tarsierfoundation.org/content/license/pvglsv.html night skinny dipping] [http://www.lewakins.com/sr/images/fphxob.html jobs for portuguese speakers] [http://asie-voyages.com/upload/images/lens/cafswf.html plastics models] [http://xuccco.org/themes/AT-Green3/bghtxc.html mood swing wild] [http://tch-voyages.com/documents/prague/896/gaentq.html one piece flow] [http://www.lewakins.com/sr/images/qkpcwu.html american therapeutic corporation] [http://www.lewakins.com/sr/images/ixlseb.html universal motion picture] [http://indianaoutfitters.com/s/info/tmp/qvmwpn.html kansas secretary state state] [http://tch-voyages.com/documents/prague/896/asfnfj.html tsp login] [http://lumayagrealty.com/catalog/images/pics/frwici.html jianhua chen] [http://www.sedbogota.edu.co/FINANCIERA/temp/tmp/twaucc.html tsunamis forms] [http://www.biblored.org.co/agenda_actividades/programas/images/rmabmv.html wealthy americans] [http://indianaoutfitters.com/s/info/tmp/onwkcs.html auto body salvage yards] [http://panties-pictures.com/free/lib/temp/huvqvc.html vent cleaner] [http://bluespringsbmx.com/4IMAGES/data/media/10/tmp/jbwren.html electorial map 2004] [http://panties-pictures.com/free/lib/temp/ukinvp.html s club 7 dance move] [http://indianaoutfitters.com/s/info/tmp/bvwfbk.html ac hour meter] [http://www.redacademica.edu.co/manejocorreo/Cliente/cache/erktfp.html street fighter vol 1] [http://asie-voyages.com/upload/images/lens/gmqogm.html ad campaign ebay] [http://lumayagrealty.com/catalog/images/pics/nsflul.html process piping and design] [http://indianaoutfitters.com/s/info/tmp/lvjwet.html la county sheriffs dept] [http://roycemotor.com/carpics/cache/cwruwb.html shes a one in a million girl] [http://bluespringsbmx.com/4IMAGES/data/media/10/tmp/udfuhw.html men only magazine website] [http://asie-voyages.com/upload/images/lens/ekvbnw.html waters consulting group] [http://bluespringsbmx.com/4IMAGES/data/media/10/tmp/cjvpok.html water park wave] [http://indianaoutfitters.com/s/info/tmp/dukauj.html scavo] [http://www.redacademica.edu.co/manejocorreo/Cliente/cache/nduxxf.html why incorporate in wyoming] [http://www.lewakins.com/sr/images/erbqjd.html stanovanja v ljubljani] [http://coastguard.gov.ph/content.old/license/iqqwod.html vera needs] [http://www.norcab.com.au/joeavatiforum/templates/cache/obqwbe.html jtag tools] [http://smallbizbohol.com/democatalog/images/baner/qwambt.html in home colon cleansing] [http://www.biblored.org.co/agenda_actividades/programas/images/ctlfei.html southwest michigan vacation rental] [http://roycemotor.com/carpics/cache/tjxjxg.html school of record] [http://panties-pictures.com/free/lib/temp/jmevic.html removing moles] [http://www.sedbogota.edu.co/FINANCIERA/temp/tmp/jkuejh.html mr skin free video] [http://www.sedbogota.edu.co/FINANCIERA/temp/tmp/ckjcai.html agent bryan estate real texas] [http://www.hdac.org/hdfaq/faq/xdeswm.html veterinary medicine careers] [http://panties-pictures.com/free/lib/temp/imxrec.html tobago tourist info] [http://www.sedbogota.edu.co/FINANCIERA/temp/tmp/eqwtel.html weather channel store] [http://hoosierfishing.com/phpBB/images/avatars/avatar/xvtlna.html le lien multimedia] [http://lumayagrealty.com/catalog/images/pics/rbbwon.html make me a channel of your piece] [http://coastguard.gov.ph/content.old/license/dhjpig.html sued by the debt collector] [http://www.norcab.com.au/joeavatiforum/templates/cache/mmemhm.html us news education schools] [http://bluespringsbmx.com/4IMAGES/data/media/10/tmp/luxciv.html maine wood turning] [http://asie-voyages.com/upload/images/lens/kobaro.html ass big booty movie white] [http://asie-voyages.com/upload/images/lens/wcbsvw.html sony z520i] [http://panties-pictures.com/free/lib/temp/ltvcqt.html master card web site] [http://coastguard.gov.ph/content.old/license/dckatx.html learn to play the snare drum online] [http://www.sedbogota.edu.co/FINANCIERA/temp/tmp/dwqtsd.html matched pairs definition] [http://bluespringsbmx.com/4IMAGES/data/media/10/tmp/ccrvfq.html non representational artwork] [http://tch-voyages.com/documents/prague/896/xkwpjr.html soak she] [http://roycemotor.com/carpics/cache/flvqoi.html restaurant recommendations chicago] [http://www.redacademica.edu.co/manejocorreo/Cliente/cache/gfisie.html search havana] [http://www.sedbogota.edu.co/FINANCIERA/temp/tmp/paokun.html unknown system error in call to start scan] [http://talentmodeles.com/mannequin/images/cache/qoxfsi.html airline broker mile] [http://panties-pictures.com/free/lib/temp/dmstmw.html research on treatment for melanoma cancer] [http://www.biblored.org.co/agenda_actividades/programas/images/aegoxv.html nipple licking] [http://tch-voyages.com/documents/prague/896/nvqelk.html electrical standards] [http://bluespringsbmx.com/4IMAGES/data/media/10/tmp/fdlald.html name of fortune tellers] [http://www.sedbogota.edu.co/FINANCIERA/temp/tmp/idxmth.html make me a channel of your piece] [http://www.biblored.org.co/agenda_actividades/programas/images/plsxow.html sms text messages college] [http://lumayagrealty.com/catalog/images/pics/hlerix.html absence civil commission employee law philippine service] [http://talentmodeles.com/mannequin/images/cache/uxqqgd.html early pregnancy symptom discharge] [http://smallbizbohol.com/democatalog/images/baner/voovqs.html ebusiness hosting] [http://www.biblored.org.co/agenda_actividades/programas/images/avdpab.html prostrate treatments] [http://smallbizbohol.com/democatalog/images/baner/hwxavq.html sand art projects] [http://www.redacademica.edu.co/manejocorreo/Cliente/cache/fogmhl.html technical translation services] [http://xuccco.org/themes/AT-Green3/sxaucu.html queen creek az homes] [http://smallbizbohol.com/democatalog/images/baner/pvqcao.html maxwell house commercials] [http://indianaoutfitters.com/s/info/tmp/uwbqfv.html endangered species in utah] [http://www.hdac.org/hdfaq/faq/mknjld.html pet care pet] [http://tarsierfoundation.org/content/license/fftqwk.html kazaa lite mac free] [http://indianaoutfitters.com/s/info/tmp/tkgoqi.html journal of research in crime and deliquency] [http://www.lewakins.com/sr/images/gbllfk.html xbox computer monitor adapter] [http://www.redacademica.edu.co/manejocorreo/Cliente/cache/havirv.html importing china] [http://asie-voyages.com/upload/images/lens/mdddvg.html improve life love] [http://www.biblored.org.co/agenda_actividades/programas/images/vkmhge.html examination board] [http://asie-voyages.com/upload/images/lens/fxigwb.html summa sign] [http://www.sedbogota.edu.co/FINANCIERA/temp/tmp/bcqtfi.html name of the vice president of the united states] [http://www.lewakins.com/sr/images/bwmwgr.html adult brazil escort] [http://hoosierfishing.com/phpBB/images/avatars/avatar/qxcpna.html vincent collateral] [http://asie-voyages.com/upload/images/lens/kklkth.html systems integration group inc] [http://www.sedbogota.edu.co/FINANCIERA/temp/tmp/gkdjgw.html robert b stone] [http://lumayagrealty.com/catalog/images/pics/svcasd.html austin music hall map] [http://asie-voyages.com/upload/images/lens/udpmdt.html you shine christian lyrics] [http://hoosierfishing.com/phpBB/images/avatars/avatar/gtwvuf.html music sheet stripes white] [http://indianaoutfitters.com/s/info/tmp/fgdlpe.html love more war] [http://smallbizbohol.com/democatalog/images/baner/ckcwow.html affect butterfly movie]
{{back|Nav Mesh}}
[[Category:Glossary]][[Category:Level Design]][[Category:AI]]
{{distinguish|AIN}}
A '''NAV''' file is a [[Navigation Meshes|'''Nav'''igation Mesh]] file for Counter-Strike: Source [[Bots]]. It defines, among other things the walkable space in a level. The file is generated automatically when bots are played for the first time on a specific map. One can edit a Navigation Mesh manually by typing nav_edit 1 in the console with [[sv_cheats]] enabled.  NAV creation is an open-source task available in the SDK.  If one were to implement their bots, it would be easier because NAV creation is already supplied.
{{merge|[[Nav Mesh]]}}
A '''NAV''' file is a map specific [[Nav Mesh|'''<u>Nav</u>'''igation Mesh]] file that defines the walkable space in a level for [[bot]]s in {{gldsrc|1}} ({{cscz|1|nt=1}}) and {{src|1}} games. They usually reside in <code><game folder>/maps</code> and can be integrated into [[BSP|BSPs]] in some [[Source]] games.{{clarify}}


The difference between an [[AIN]] and a '''NAV''' file is that an '''AIN''' file is mainly used for [[NPC]] navigation.
{{Todo|Document GoldSrc version. Format is identical - {{cscz|1}} uses version 5.}}
 
== Games ==
In {{css|4}} and {{csgo|4}}, the file is generated automatically when bots are played or being added into a map for the first time on a specific map that doesn't have one.
 
Nav Mesh file write is open source in Source SDK 2013: https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/game/server/nav_file.cpp#L1071
 
Nav Mesh generation is also open source in Source SDK 2013: https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/game/server/nav_generate.cpp#L3399
 
{{l4d|4}} games have extra data per nav-area, as well as in after the nav place directory (null term string + short?), both of which have unknown format.
 
== File format ==
{{todo|The information listed on the NAV file structure is too vague.}}
{{confirm|At least two versions of .nav files.}}
{{todo|Add approach spot data.}}
{{note|This is reverse engineered data.}}
{{ExpandBox|<source lang="cpp">
unsigned int magicNumber; // Magic number to check if the file is a .nav file (little endian 0xFEEDFACE)
unsigned int version; // Version of the .nav file, for example GMod and TF2 has 16
 
if ( version >= 10 ) {
unsigned int subVersion; // Sub version of the .nav file, for example GMod has 0, TF2 has 2. This is usedt
}
 
if ( version >= 4 ) {
unsigned int saveBspSize; // Size of source bsp file to verify that the bsp hasn't changed
}
 
if ( version >= 14 ) {
unsigned char isAnalyzed;
}
 
if ( version >= 5 ) {
// Callouts. Places data. This is the "Mid", "Banana", etc stuff that is used in this nav mesh
unsigned short count;
 
for( int i = 0; i < count; ++i ) {
unsigned short len; // length of the name
char name[len]; // The name. Maximum len is 256
}
 
if ( version > 11 ) {
unsigned char m_hasUnnamedAreas;
}
}
 
{
// PreLoadAreas( count )
// This is by default is completely unused, it is left for mods to store custom data
// Assuming that the data is per nav area
//for( int i = 0; i < count; ++i ) {
 
//}
}
 
unsigned int areaCount; // number of CNavAreas
area_t area[areaCount]; // Area Data
 
if ( version >= 6 ) {
unsigned int ladderCount; // number of CNavLadders
ladder_t ladders[ladderCount]; // Ladder Data
}
 
{
// Load Custom Data
// Again, by default this is unused
}
</source>}}
 
===Area===
A navigation area is a bounding square in which bots can move.
<source lang="cpp">
struct nav_area_t {
unsigned int ID; // Identifier of the navigation area.
union AttributeBitField {
unsigned char; // In NAV versions ≤ 8
unsigned short; // In NAV versions ≤ 12
unsigned int; // In NAV Versions ≥ 13
};
float nwCorner[3]; // North-West corner vector.
float seCorner[3]; // South-East corner vector.
float NorthEastZ; // Z coordinate of North-East corner.
float SouthWestZ; // Z coordinate of South-West corner.
 
connectionData_t connectionData[4]; // Connection data in NESW (North, East, South, West) order.
 
unsigned char hidingSpotCount; // Amount of hiding spots.
hidingSpot_t hidingSpots[hidingSpotCount]; // Hiding spot data.
 
/* Approach spots were removed in NAV version 15.
unsigned char approachSpotCount; // Amount of approach spots
approachSpot_t approachSpotData[approachSpotCount]; // Approach spot data.
*/
 
unsigned int encounterPathCount; // Amount of encounter paths.
encounterPath_t encounterPaths[encounterPathCount]; // Encounter path data.
unsigned short PlaceID; // ID of place.
 
// Ladder data stored in order of vertical direction (up then down).
struct ladderIDSequence_t {
unsigned int ladderCount; // Amount of ladder Ids.
unsigned int ladderIDs[ladderCount]; // Ladder IDs
} ladderIDSequence[2];
float EarliestOccupyTimes[2]; // Earliest occupy times for teams.
float LightIntensity[4]; // Light Intensities for each corner.
 
unsigned int areaBindCount; // Amount of area-binds stored.
nav_area_bind_t areaBindSequence[areaBindCount]; // Sequence of area-binds stored.
 
unsigned int InheritVisibilityFromAreaID; // Inherit visibility from area.
void* customData; // Game-specific data.
}
</source>
 
===Approach Spot===
{{todo|Describe variables.}}
<source lang="cpp">
struct approachSpot_t {
uint approachHereId;
uint approachPrevId;
byte approachType;
uint approachNextId;
byte approachHow;
}
</source>
 
===Area-bind===
Area-binds are a structure type used in nav areas to determine the visibility between the parent area and another navigation area, based on area ID.
<source lang="cpp">struct nav_area_bind_t {
  unsigned int target_area_id; // Area ID of area.
  unsigned char AttributeBitField; // Attribute flag field that determines the visibility type.
};</source>
 
Area-binds were added in NAV version 16.
===Connection===
<source lang="cpp">
struct connectionData_t {
unsigned int count; // Amount of connections.
unsigned int AreaIDs[count]; // List of area IDs that each connection points to.
};
</source>
===Hiding Spot===
Hiding spots are data structures used to determine points in a nav mesh that bots can hide at.
<source lang="cpp">
enum Attribute : unsigned char // Hiding Spot attribute values.
{
IN_COVER = 0x01, // In a corner with good hard cover nearby
GOOD_SNIPER_SPOT = 0x02, // Had at least one decent sniping corridor
IDEAL_SNIPER_SPOT = 0x04, // Can see either very far, or a large area, or both
EXPOSED = 0x08 // Spot in the open, usually on a ledge or cliff
};
 
struct hidingSpot_t {
unsigned int ID; // Identifier of hide spot. Added in NAV version 2.
float position[3]; // Position of the hiding spot. Added in NAV version 1.
unsigned char Attributes; // Attribute field. Added in NAV version 2. Defaults to IN_COVER for version 1
};
</source>
 
{|
! Game !! Used For
|-
| {{tf2|4}} || Determines where Spy bots can lurk for targets.
|-
| {{css|4}} || Determines where bots can take cover and shoot at.
|-
| {{csgo|4}} || Determines where bots can take cover and shoot at.
|}
 
===Encounter Path===
Encounter paths are structures used to determine routes to take to get to certain areas.
<source lang="cpp">
struct encounterPath_t {
unsigned int EntryAreaID; // ID of the Area entered from.
unsigned byte EntryDirection; // Direction of entry.
unsigned int DestAreaID; // ID of the Area destination.
unsigned byte DestDirection; // Direction towards the destination area.
 
unsigned char encounterSpotCount; // Amount of encounter spots.
encounterSpot_t encounterSpots[encounterSpotCount]; // Encounter spots.
};
</source>
{{warning|Encounter paths are only used in {{css|4}} and {{csgo|4}}.}}
===Encounter Spot===
Encounter Spots (better termed waypoints) are data structures used in encounter paths to determine the order of area IDs in a route.
<source lang="cpp">
struct encounterSpot_t {
unsigned int AreaID; // The Area ID to go to.
unsigned char ParametricDistance; // Parametric distance in bytes.
};
</source>
{{warning|Encounter spots are only used in {{css|4}} and {{csgo|4}}.}}
 
===Ladder===
A navigation mesh ladder.
<source lang="cpp">
struct nav_ladder_t {
unsigned int ID; // Identifier of the navigation ladder.
float width; // extent of ladder
 
float top[3]; // top endpoint of ladder
float bottom[3]; // bottom endpoint of ladder
float length; // ladder length
 
unsigned int direction; // Direction of the ladder (NavDirType)
 
unsigned char bDangling; // if version 6, dangling status
 
unsigned int topForwardArea; // area ID
unsigned int topLeftArea; // area ID
unsigned int topRightArea; // area ID
unsigned int topBehindArea; // area ID
unsigned int bottomArea; // area ID
}
</source>
 
===Custom Data===
Some games store custom data in areas.
{| class="wikitable"
|+ Custom Area Data
!  Subversion !! Data !! Label
|-
| 2 || unsigned int || {{tf2|4}} specific attributes.
|-
| 1 || char[14] || {{csgo|4}} unknown data.
|}
 
==Versions Used By Games==
 
{| class="wikitable"
! Game
! Version
! Subversion
|-
| {{tf2|4}}
| 16
| 2
|-
| {{gmod|4}}
| 16
| 0
|-
| {{l4d2|4}}
| 16
| 14
|-
| {{l4d|4}}
| 15
| 13
|-
| {{css|4}}
| 9
| n/a
|-
| {{cscz|4}}
| 5
| n/a
|}


==See also==
==See also==
* [[Navigation Meshes]]
* [[Nav Mesh Editing]]
 
===NAV processors===
* [https://github.com/Blackfire62/TF2_NavFile_Reader Nav file parser in C++.]
* [https://codeberg.org/WhyIsEveryYearAlwaysBad/libSourceNav libSourceNav] — a NAV parser in Common Lisp.
* [https://github.com/WhyIsEvery4thYearAlwaysBad/kaitai_struct_formats/blob/master/game/source_engine_nav.ksy Base NAV file format in Kaitai Struct.]
* [https://github.com/mrazza/gonav Nav file parser in Go.] (Outdated)
 
[[Category:Level Design]]
[[Category:AI]]
 
[[Category:File formats|nav]]
 
[[Category:Counter-Strike: Source|nav]]
[[Category:Team Fortress 2|nav]]
[[Category:Counter-Strike: Global Offensive|nav]]

Latest revision as of 18:41, 8 June 2025

Nav Mesh
Not to be confused with AIN.
Merge-arrows.png
It has been suggested that this article or section be merged with Nav Mesh. (Discuss)

A NAV file is a map specific Navigation Mesh file that defines the walkable space in a level for bots in GoldSrc (CS:CZ) and Source games. They usually reside in <game folder>/maps and can be integrated into BSPs in some Source games.[Clarify]

Todo: Document GoldSrc version. Format is identical - Counter-Strike: Condition Zero uses version 5.

Games

In Counter-Strike: Source Counter-Strike: Source and Counter-Strike: Global Offensive Counter-Strike: Global Offensive, the file is generated automatically when bots are played or being added into a map for the first time on a specific map that doesn't have one.

Nav Mesh file write is open source in Source SDK 2013: https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/game/server/nav_file.cpp#L1071

Nav Mesh generation is also open source in Source SDK 2013: https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/game/server/nav_generate.cpp#L3399

Left 4 Dead Left 4 Dead games have extra data per nav-area, as well as in after the nav place directory (null term string + short?), both of which have unknown format.

File format

Todo: The information listed on the NAV file structure is too vague.
Confirm:At least two versions of .nav files.
Todo: Add approach spot data.
Note.pngNote:This is reverse engineered data.

unsigned int magicNumber; // Magic number to check if the file is a .nav file (little endian 0xFEEDFACE)
unsigned int version; // Version of the .nav file, for example GMod and TF2 has 16

if ( version >= 10 ) {
	unsigned int subVersion; // Sub version of the .nav file, for example GMod has 0, TF2 has 2. This is usedt
}

if ( version >= 4 ) {
	unsigned int saveBspSize; // Size of source bsp file to verify that the bsp hasn't changed
}

if ( version >= 14 ) {
	unsigned char isAnalyzed;
}

if ( version >= 5 ) {
	// Callouts. Places data. This is the "Mid", "Banana", etc stuff that is used in this nav mesh
	unsigned short count;

	for( int i = 0; i < count; ++i ) {
		unsigned short len; // length of the name
		char name[len]; // The name. Maximum len is 256
	}

	if ( version > 11 ) {
		unsigned char m_hasUnnamedAreas;
	}
}

{
	// PreLoadAreas( count )
	// This is by default is completely unused, it is left for mods to store custom data
	// Assuming that the data is per nav area
	//for( int i = 0; i < count; ++i ) {

	//}
}

unsigned int areaCount; // number of CNavAreas
area_t area[areaCount]; // Area Data

if ( version >= 6 ) {
	unsigned int ladderCount; // number of CNavLadders
	ladder_t ladders[ladderCount]; // Ladder Data
}

{
	// Load Custom Data
	// Again, by default this is unused
}

Area

A navigation area is a bounding square in which bots can move.

struct nav_area_t {
	unsigned int ID; // Identifier of the navigation area.
	union AttributeBitField {
		unsigned char; // In NAV versions ≤ 8
		unsigned short; // In NAV versions ≤ 12
		unsigned int; // In NAV Versions ≥ 13
	};
	float nwCorner[3]; // North-West corner vector.
	float seCorner[3]; // South-East corner vector.
	float NorthEastZ; // Z coordinate of North-East corner.
	float SouthWestZ; // Z coordinate of South-West corner.

	connectionData_t connectionData[4]; // Connection data in NESW (North, East, South, West) order.

	unsigned char hidingSpotCount; // Amount of hiding spots.
	hidingSpot_t hidingSpots[hidingSpotCount]; // Hiding spot data.

	/* Approach spots were removed in NAV version 15.
	unsigned char approachSpotCount; // Amount of approach spots
	approachSpot_t approachSpotData[approachSpotCount]; // Approach spot data.
	*/

	unsigned int encounterPathCount; // Amount of encounter paths.
	encounterPath_t encounterPaths[encounterPathCount]; // Encounter path data.
	unsigned short PlaceID; // ID of place.

	// Ladder data stored in order of vertical direction (up then down).
	struct ladderIDSequence_t {
		unsigned int ladderCount; // Amount of ladder Ids.
		unsigned int ladderIDs[ladderCount]; // Ladder IDs
	} ladderIDSequence[2];
	float EarliestOccupyTimes[2]; // Earliest occupy times for teams.
	float LightIntensity[4]; // Light Intensities for each corner.

	unsigned int areaBindCount; // Amount of area-binds stored.
	nav_area_bind_t areaBindSequence[areaBindCount]; // Sequence of area-binds stored.

	unsigned int InheritVisibilityFromAreaID; // Inherit visibility from area.
	void* customData; // Game-specific data.
}

Approach Spot

Todo: Describe variables.
struct approachSpot_t {
	uint approachHereId; 
	uint approachPrevId;
	byte approachType;
	uint approachNextId;
	byte approachHow;
}

Area-bind

Area-binds are a structure type used in nav areas to determine the visibility between the parent area and another navigation area, based on area ID.

struct nav_area_bind_t {
  unsigned int target_area_id; // Area ID of area.
  unsigned char AttributeBitField; // Attribute flag field that determines the visibility type.
};

Area-binds were added in NAV version 16.

Connection

struct connectionData_t {
	unsigned int count; // Amount of connections.
	unsigned int AreaIDs[count]; // List of area IDs that each connection points to.
};

Hiding Spot

Hiding spots are data structures used to determine points in a nav mesh that bots can hide at.

enum Attribute : unsigned char // Hiding Spot attribute values.
{
	IN_COVER = 0x01, // In a corner with good hard cover nearby
	GOOD_SNIPER_SPOT = 0x02, // Had at least one decent sniping corridor
	IDEAL_SNIPER_SPOT = 0x04, // Can see either very far, or a large area, or both
	EXPOSED	= 0x08 // Spot in the open, usually on a ledge or cliff
};

struct hidingSpot_t {
	unsigned int ID; // Identifier of hide spot. Added in NAV version 2.
	float position[3]; // Position of the hiding spot. Added in NAV version 1.
	unsigned char Attributes; // Attribute field. Added in NAV version 2. Defaults to IN_COVER for version 1
};
Game Used For
Team Fortress 2 Team Fortress 2 Determines where Spy bots can lurk for targets.
Counter-Strike: Source Counter-Strike: Source Determines where bots can take cover and shoot at.
Counter-Strike: Global Offensive Counter-Strike: Global Offensive Determines where bots can take cover and shoot at.

Encounter Path

Encounter paths are structures used to determine routes to take to get to certain areas.

struct encounterPath_t {
	unsigned int EntryAreaID; // ID of the Area entered from.
	unsigned byte EntryDirection; // Direction of entry.
	unsigned int DestAreaID; // ID of the Area destination.
	unsigned byte DestDirection; // Direction towards the destination area.

	unsigned char encounterSpotCount; // Amount of encounter spots.
	encounterSpot_t encounterSpots[encounterSpotCount]; // Encounter spots.
};
Warning.pngWarning:Encounter paths are only used in Counter-Strike: Source Counter-Strike: Source and Counter-Strike: Global Offensive Counter-Strike: Global Offensive.

Encounter Spot

Encounter Spots (better termed waypoints) are data structures used in encounter paths to determine the order of area IDs in a route.

struct encounterSpot_t {
	unsigned int AreaID; // The Area ID to go to.
	unsigned char ParametricDistance; // Parametric distance in bytes.
};
Warning.pngWarning:Encounter spots are only used in Counter-Strike: Source Counter-Strike: Source and Counter-Strike: Global Offensive Counter-Strike: Global Offensive.

Ladder

A navigation mesh ladder.

struct nav_ladder_t {
	unsigned int ID; // Identifier of the navigation ladder.
	float width; // extent of ladder

	float top[3]; // top endpoint of ladder
	float bottom[3]; // bottom endpoint of ladder
	float length; // ladder length

	unsigned int direction; // Direction of the ladder (NavDirType)

	unsigned char bDangling; // if version 6, dangling status

	unsigned int topForwardArea; // area ID
	unsigned int topLeftArea; // area ID
	unsigned int topRightArea; // area ID
	unsigned int topBehindArea; // area ID
	unsigned int bottomArea; // area ID
}

Custom Data

Some games store custom data in areas.

Custom Area Data
Subversion Data Label
2 unsigned int Team Fortress 2 Team Fortress 2 specific attributes.
1 char[14] Counter-Strike: Global Offensive Counter-Strike: Global Offensive unknown data.

Versions Used By Games

Game Version Subversion
Team Fortress 2 Team Fortress 2 16 2
Garry's Mod Garry's Mod 16 0
Left 4 Dead 2 Left 4 Dead 2 16 14
Left 4 Dead Left 4 Dead 15 13
Counter-Strike: Source Counter-Strike: Source 9 n/a
Counter-Strike: Condition Zero Counter-Strike: Condition Zero 5 n/a

See also

NAV processors