Sample graphs

The AFX package includes several sample AFX. You can use the examples to gain a better understanding of the available nodes and how to use them. You can also reuse and modify any of the example graphs.

Design patterns

The example AFX use similar design patterns. These are described in the following sections.

Single reference game objects

Where a variable component is used to create a reference that's shared by multiple graphs, that component is given its own game object.

Game object with a single variable component

This enables you to assign a meaningful name to the game object, and makes the relationships in the AFX easier to understand.

Activating and deactivating game objects

An AFX graph is active only when the game object that it's attached to is active. Therefore, you can control the activation of AFX graphs by activating and deactivating their parent game objects.

This approach removes the need to perform additional checks within a graph to determine whether or not it should run. Most example graphs are designed with the assumption that if they're active, then they should execute their task.

Modularization

Most of the example AFX graphs are intended to perform a specific, simple task. The functionality of the AFX is then created through the combination of graphs. This makes graphs reusable and easier to understand.

To enable each graph to perform a specific task, they make extensive use of references. A graph can evaluates parameters in an environment, and then set the value of a reference. Another graph can read the value of a reference, and use that to determine how it performs a task.

Last updated