Skip to content
This repository has been archived by the owner on Sep 3, 2022. It is now read-only.

5.02.3 AIMesh & AIMesh NavGrid

Lizardy edited this page Dec 17, 2021 · 4 revisions

Introduction

This page is the third page in the 5.02 Creating Custom Maps section of the wiki.

This page details all of the functionality of the .aimesh files as well as .aimesh_ngrid files.

AIMesh

Each AIMesh file is a complex of "cells" which have 3 vertices, with each vertex being linked to another vertex by index. Effectively, the end product is a mesh file with vertices and faces used in navigation by the client.

This file is integral to every map as it allows the client to more easily calculate the proper path to a destination, which then gets sent to the GameServer when the player right clicks a location.

Without this file, some users may experience FPS drops as their client attempts to calculate a path on the fly using the .aimesh_ngrid file.

However, this file is not required to run the Client or GameServer.

AIMesh NavGrid

Each AIMesh NavGrid file is a collection of cells, height samples, and hint nodes.

Main Features:

  • Major Version
  • Minor Version
  • Minimum Position
  • Maximum Position
    • These positions are not indices of the navgrid, rather they are positions on the map.
  • Cell Size
    • Usually 50.
  • Cell Count X
  • Cell Count Z
    • A 1:1 aspect ratio is not required.

Each cell has these features separated by the navgrid's Major Version:

  • Version 3 and above:
    • Center Height
      • This details how high the center of the cell goes. This is mostly unused as it can be inaccurate for certain cell pathing flags such as base gates.
    • Session ID
      • This details the ID of the pathfinding session. This is almost always -1 as a session is never active at the time of baking the navgrid.
    • Arrival Cost
      • Unused by this version, all cells have a 0 for this field.
    • Open
      • Unused by this version, all cells have False for this field.
    • Heuristic
      • Unused by this version, all cells have a 0 for this field.
    • Actor List
      • Unused by this version, all cells have a 0 for this field.
    • X & Z
      • This details the coordinates of the cell on the navigation grid. The values start at 0 and end at the cellCountX/cellCountZ of the grid.
    • Added Cost
      • TODO
    • Good Cell Hint
      • TODO
    • Added Cost Count
      • TODO
    • Good Cell Session ID
      • TODO
    • Height Hint
      • TODO
    • Arrival Direction
      • TODO
    • Vision Pathing Flags
      • This details the functionality of the cell in vision and pathfinding calculations.
      • These are the possible flags
        • Walkable (no blocking)
        • Brush (blocks vision from outside)
        • Wall (blocks vision and pathing)
        • StructureWall (blocks vision and pathing)
        • Unobserved8
        • Unobserved16
        • Unobserved32
        • TransparentWall (blocks pathing)
        • Unknown128
        • AlwaysVisible (no blocking, inherent vision)
        • Unknown512
        • BlueTeamOnly (blocks purple team vision)
        • RedTeamOnly (blocks blue team vision)
        • NeutralZoneVisibility (blocks blue and purple team vision)
    • Hint Node 1
      • TODO
    • Hint Node 2
      • TODO
  • Version 7 and above:
    • All of the version 3 features except Good Cell Hint, Added Cost, and Added Cost Count.
    • Arrival Cost
      • This details the cumulative cost required by the pathfinder in order to path onto the given cell.
      • Cells which cannot be pathed on (Walls, See through walls, etc) have a cost of 0.
      • Otherwise, the cost is calculated as such:
        • TODO

Height samples have these features:

  • CountX
  • CountZ
  • OffsetX
  • OffsetZ
  • Array of samples (values are simple floats), max index is CountX * CountZ