Agent Types

Overview

In general, different AI characters have different dimensions – radii and heights – and different walkability properties.

With that in mind, every navigation agent type (in general, every AI character type) needs its own navigation mesh, which is configured in the Scripts/AI/Navigation.xml file.

Example

<Navigation version="2" >
  <AgentTypes>
    
    <AgentType name="MediumSizedCharacters" voxelSize="0.125, 0.125, 0.125" radius="4" height="16" climbableHeight="3" maxWaterDepth="8" >
      <SmartObjectUserClasses>
        <class name="Human" />
        <class name="Grunt" />
        <class name="Stalker" />
      </SmartObjectUserClasses>
    </AgentType>
    
    <AgentType name="LargeSizedCharacters" voxelSize="0.15, 0.15, 0.15" radius="6" height="20" climbableHeight="6" maxWaterDepth="10" >
      <SmartObjectUserClasses>
        <class name="Heavy" />
      </SmartObjectUserClasses>
    </AgentType>
    
    <AgentType name="Pinger" voxelSize="0.25, 0.25, 0.25" radius="8" height="16" climbableHeight="6" maxWaterDepth="6" >
    </AgentType>
    
  </AgentTypes>
</Navigation>

Every agent type has:

  • A unique name.
  • Size and walkability properties:
    • voxelSize: the size of the generated voxels in meters. must be a float value >= 0.025
    • radius: agent radius in voxels; must be an integer value >= 1
    • height: agent height in voxels; must be an integer value >= 1
    • climbableHeight: Maximum climbable height in voxels (it can be considered as some maximum slope value); must be an integer value >= 0
    • maxWaterDepth: Maximum walkable water depth in voxels; must be an integer value >= 0

Meters and Voxels

  1. When navigation mesh is generated, the navigation areas are split in small volumes, so-called tiles.
  2. The tiles have a fixed size of 8 m x 8 m x 8 m.
  3. The tiles must consist of an integer number of voxels (e.g. 0.1 m x 0.1 m x 0.1 m is a valid voxel size). Otherwise, voxel size will be adjusted internally to the closest valid value (e.g. 0.101 m x 0.101 m x 0.101 m would be adjusted to 0.125 m x 0.125 m x 0.125 m).
  4. The smaller the voxel size, the more accurate (and more expensive) the generated mesh will be. Minimum voxel size is 0.025 m x 0.025 m x 0.025 m (a smaller size will make the mesh generation fail).

Smart Object User Classes

See Off-mesh Navigation.

Note attribute version of tag Navigation in the first line. Whenever this file is updated, this attribute should be updated as well. This will force the users to re-export their maps.

Assignment of a Navigation Agent Type to an AI Character

Navigation agent type can be assigned to an AI character using the property NavigationType, as on the following image: