Menu
Lumberyard
User Guide (Version 1.13)

Tutorial: Basic AI Navigation

This topic references tools and features that are legacy. If you want to use legacy tools in Lumberyard Editor, disable the CryEntity Removal gem using the Project Configurator or the command line. To learn more about legacy features, see the Amazon Lumberyard Legacy Reference.

This tutorial covers basic AI agent navigation through a level. A tagpoint is used to obtain the destination location within the navigation area.

The position coordinates for the TagPoint are dynamic, meaning you can move the TagPoint around and the AI updates its new destination coordinates accordingly.

To make an AI agent navigate

  1. In the Rollup Bar, on the Objects tab, click AI, NavigationArea.

  2. In the level, click to define boundary nodes for the navigation area, then double-click to complete.

  3. In the Rollup Bar, click AI, TagPoint, then click to place it in the level.

  4. In the Rollup Bar, click Entity, AI, select your asset, and then click to place it in the level.

  5. In the Rollup Bar, click Entity, Default, FlowgraphEntity, then click to place it in the level.

  6. In the level, right-click the flow graph entity, click Create Flow Graph, and name it.

  7. In the Flow Graph editor, under Flow Graphs, select the flow graph entity.

  8. Right-click anywhere in the graph, click Add Node, and create the following nodes:

    1. Game:Start

    2. AISequence:Start

    3. AISequence:Move

    4. AISequence:End

    5. Entity:EntityPos

  9. Click and drag to create links between the outputs and inputs of the nodes as follows:

    1. Game:Start output to AISequence:Start Start

    2. AISequence:Start Link to AISequence:Move Start

    3. AISequence:Move Done to AISequence:End End

    4. Entity:EntityPos pos to AISequence:Move Position

  10. For each of the three AISequence nodes, do the following:

    1. Select the entity in the entity tree to assign it.

    2. Right-click the top bar of the node.

    3. click Assign Selected Entity, Choose Entity.

    4. Enter the name of the AI agent selected.

  11. For the Entity:EntityPos node, do the following:

    1. Select the tagpoint in the entity tree.

    2. Right-click the entity top bar of the node.

    3. Click Assign Selected Entity, Choose Entity.

    4. Enter the name of the tagpoint.

  12. Press Ctrl+G to test the AI agent navigation to the tagpoint.