Getting Started with the Navigation Lab: Running Queries

The Navigation Lab exposes several of the spatial queries provided by the toolbox layer of the Gameware Navigation runtime API. You can run these queries any time you have a NavMesh loaded into the Navigation Lab. (For an introduction to using the Navigation Lab that shows how to run samples and how to load and create NavMeshes, see Getting Started with the Navigation Lab).

The available query types are listed in the Queries panel, to the left of the 3D view.

To get started:

  1. Click the DiskCollision query. This query determines whether or not a disc of a specified size fits at a given position in the NavMesh without colliding with any NavMesh boder.
  2. Move the mouse cursor over the NavMesh. As it moves, it should be followed by a disk and a triangle. The triangle indicates the NavMesh triangle you are currently pointing at (i.e. the beginning triangle for the query). If the circle is rendered in green, the disk fits at the selected location; if the circle is rendered in red, the disk intersects at least one outside border of the NavMesh.
  3. Open the panel on the right of the 3D view for the selected query. Here, you will see a summary of the purpose of the query, along with any configuration parameters that it accepts. For instance, you can change the Radius value to use a larger or smaller disk for the query.

    Note the Perform query in setting. This setting does not come from the API of the queries; it determines whether the query is performed by the Navigation Lab or the LabGame. You can run the query in the Navigation Lab within the set of data currently loaded into the 3D view. While you are connected to the LabGame, you can also send the query configuration to the LabGame and execute the query in the game.

  4. Back in the Queries panel, switch to the Astar query. This is the same query used by Bots at runtime to find paths from place to place in the world.
  5. Right-click anywhere in the NavMesh, and select Set marker A from the contextual menu. This sets the starting point for the path computation query. As you move your mouse cursor around the terrain, the query automatically re-calculates a new path to the location pointed to by the cursor.

    (Note that the output of this query is not necessarily the exact path a Bot would follow between the starting point and the destination. Bots can deviate from their paths to follow shortcuts that cut off the occasional jagged corners, and to avoid other dynamically moving objects that cross their paths.)

  6. To cancel the currently running query, click the Stop running query button at the top of the Queries panel.

You can play around with the other queries in the list.