Skip to main content

Variable & Math Node

Overview

Variable Nodes and Math Nodes are data-oriented nodes used to retrieve, calculate, and transform values within the graph system. They do not control execution flow or perform gameplay actions, but instead provide data to other nodes.

These nodes act as the data layer of the graph and are commonly used to supply inputs for Branch Node, Condition Node and Action Node.


Purpose

Variable and Math Nodes are used to:

  • Read values from data sources

  • Perform calculations and value transformations

  • Provide computed results to other nodes

  • Support conditional logic and action execution

They enable dynamic, data-driven behavior without hardcoding values.


Execution Behavior

  • Variable and Math Nodes are evaluated on demand when their output values are required.

  • They do not participate in execution flow directly.

  • They do not modify backend data.

These nodes simply return values based on their inputs and configuration.


Port Connection Rules

Input Ports

Variable Nodes & Math Nodes Input ports can connect from:

Input ports provide the operands or source values used for evaluation.

Output Ports

Value Output Port can connect to:

Output ports always represent a computed or retrieved value.


Common Use Cases

Typical Variable and Math Node use cases include:

  • Reading Attribute values

  • Fetching CustomData values

  • Calculating damage or healing amounts

  • Applying multipliers or modifiers

  • Comparing values in Branch Node

These nodes are usually upstream of Condition Node,Branch Node or Action Node.


Design Philosophy

Variable and Math Nodes are designed to be:

  • Pure (no side effects)

  • Reusable across different graphs

  • Composable to build complex calculations

By keeping data retrieval and calculation separate from flow and execution, the system remains flexible and easy to reason about.


Summary

  • Variable & Math Nodes provide data

  • They do not control execution flow

  • They do not modify backend data