Skip to main content

FlowGraph Fundamentals

Guide

Read a behavior graph as one gameplay rule: when this timing arrives, execute these actions with these targets and values

The diagram below is the FlowGraph for Poison Arrow, a card from the Demo. From left to right, On Card Played opens the path, Deal Damage applies damage, presentation nodes read the actual result, and Change Status applies Poison.

The Poison Arrow Behavior moving from its card-play entry through damage and presentation before applying Poison

Behavior is embedded in its host

FlowGraph is embedded directly in the content where the player experiences its result. You do not need to create or assign a separate graph asset.

OwnerRule expressed by BehaviorCommon starting point
CardWhat happens when the card is played or reaches another lifecycle timingOn Card Played, another Card Entry, or a Hook
StatusThe reactions, persistent rules, and pending value modifications contributed by the statusA Battle or Status Entry, or a Hook
EnemyHow the enemy chooses an Intent and what that Intent actually executesOn Enemy Behavior Start and an Intent Pattern

Logical trigger timing

Every executable path starts with the timing type required by the rule it expresses.

Starting pointUseExample
EntryReact when a documented battle or content lifecycle point is reachedApply Poison after a card is played, or trigger a status at turn start
HookModify or cancel a value before GCS commits itIncrease outgoing damage, change the number of cards drawn, or reject a card play
Intent PatternChoose and preview the action an enemy will executeSelect a Leaf Intent from a Sequence or Weighted Pattern
warning

Timing belongs to the mechanic itself. A rule that runs "at turn end" must connect to the matching turn-end Entry, not another Entry that happens near the same time.

Entry Nodes and Hook Nodes document the exact availability and timing. Battle Phases and Execution Order places them in the complete battle lifecycle.

Control flow and data flow

Control connections answer "what executes next," while data connections answer "which target or value does this step use."

ConnectionResponsibilityCommon form
Control flowOrders the execution of Action, Branch, Loop, Wait, Choice, and Intent pathsOut / In, True / False, Body / Done, or a named Case
Data flowSupplies units, cards, collections, numbers, booleans, text, and actual resultsA Source or Result Output connected to a Consumer Input

Dynamic parameter ports

Some node fields support dynamic parameters and can be switched directly to an Input Port that receives a runtime value.

Connected Input -> Pull the runtime value
Unconnected Input -> Use the value saved in the field
tip

Use fixed design values for constants such as Amount = 6. Expand a dynamic port only when the value must be calculated from current armor, missing HP, Hook input, or other live state.

FlowGraph Editor explains the Socket toggle, port layout, and connection workflow.

Lazy evaluation

Data does not broadcast or travel across the whole graph ahead of time. Only when an Action node begins execution does it pull the data it currently needs from the connected Producer.

This rule produces four direct authoring results:

  • Timing sensitivity: Get nodes read the current battle state, so reading HP after damage returns the reduced value.
  • Live calculation: Operators and Selectors calculate from the live inputs present when the Consumer pulls them.
  • Stable single evaluation: A Source Result stays stable within one evaluation cycle, while a later Action or Loop iteration can generate a new value.
  • Snapshot storage: When several later Actions need the same snapshot, store the value in a Graph or Battle Variable.

The role of runtime context

The same logic nodes can be reused across Cards, Statuses, and Enemies because runtime context injects the current actor, current target, and live battle data when a node executes.

Runtime data needValue source
Current cardThis Card or an Entry Output
Current actor or ownerSelf Unit, Active Unit, or an Entry Output
Target unit selected by the player or calculated by logicCard Selection, Source Dropdown, or a connected Selector
Live attributes such as HP, armor, energy, turn number, piles, and status stacksGet nodes that read the live battle
Attribute or status changesAction nodes executed through the Context Controller
Parameters supplied by an event or HookOutput from the matching Hook or Event Entry

Context gives Self a dynamic identity. In a card, Self is the player who plays it. In a Status, it is the unit carrying that Buff. In enemy behavior, it is the current enemy entity. Target Selection defines the Source rules and the priority of a connected Target Port.

Value transfer and data scopes

Choose a value-transfer method according to how widely a value must be shared and how long it must be retained.

Value surfaceWhen to use it
Direct connectionOnly one downstream node needs the current value
Actual resolved resultLater logic or presentation depends on the value that actually took effect after armor reduction, Hook interception, attribute limits, and target validation
Graph VariableSeveral paths in the current Graph Run need to share one snapshot
Battle VariableThe value must persist across an Entry, Card, or Turn boundary
Internal EventDifferent content owners need to exchange data without a direct asset reference
warning
  • UI feedback for damage, healing, and similar results must read the resolved Output first, such as Dealt, Changed, Drawn, or Added.
  • Never pull the raw input node directly. Armor reduction, Status Hooks, attribute limits, and target validation can change the value during resolution or prevent the action from taking effect at all.
  • Reading the input directly can make presentation such as floating text disagree with the actual health-bar change.

Separate configuration from logic

Keep data configuration separate from connection logic so nodes remain reusable. Use this division:

Keep on the content assetPut in FlowGraph
Name, description, cost, type, rarity, tags, art, Target, stacking rules, unit attributes, and Encounter RulesDamage, healing, armor, card movement, status reactions, Hooks, enemy actions, Choice, Wait, Event, and presentation requests
tip
  • Separate presentation from assets: Presentation nodes in FlowGraph only issue playback requests. The particles, audio clips, Prefabs, materials, and mixers they reference remain static presentation assets and should not be hard-coded into logic.
  • Targeting logic: The Target field on the Card asset defines the interaction used when the player drags and plays the card. Graph Source in FlowGraph defines which units an Action such as damage actually resolves as targets.

Open and connect a Behavior in FlowGraph Editor, use the Node Reference for exact ports and parameters, or start from a verified combination in Card Recipes, Status Recipes, or Enemy Recipes.