User Guide (Version 1.21)

Using Flow Graph to Spawn AI Agents

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.

You can use the following AI flow graph nodes to spawn AI agents. An archetype entity is based on a regular entity and specifies individual parameter values for that entity. If the value of an archetype entity parameter is changed, all instances of that archetype entity in the level are updated automatically.

  • Entity:SpawnArchetype

  • Entity:Spawn

To access Flow Graph nodes

  1. In the Rollup Bar , click AI, TagPoint, and then enter a name.

  2. In the current level, click to place the tag point.

  3. Right-click the tag point, click Create Flow Graph, and enter a name.

  4. In Lumberyard Editor, click Tools, Other, Flow Graph.

  5. In Flow Graph, under Flow Graphs, select the new flow graph just created.

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

    1. Game:Start

    2. Entity:SpawnArchetype

    3. Entity:EntityPos

  7. Drag node outputs to node inputs to create the following links:

    1. Game:Start output links to Entity:SpawnArchetype Spawn

    2. Entity:EntityPos pos links to Entity:SpawnArchetype Pos

    3. Entity:EntityPos rotate links to Entity:SpawnArchetype Rotate

    4. Entity:EntityPos scale links to Entity:SpawnArchetype Scale

  8. For Entity:SpawnArchetype, click Archetype and make a selection from the menu.

  9. For Entity:EntityPos, right-click Choose Entity, click Assign graph, entity, <Graph Entity>, and enter the name of the tag point created in step 6.