Skip to main content
Flow Core Documentation
Menu

Flow Stats

Create a Calculated Stat

Build Attack Power from Strength and Weapon Power with a Reverse Polish Notation formula.

Audience
Gameplay designers and developers
Time
15 minutes
Requires
A Flow Stats Profile assigned to a FlowStats component
Modules
Flow Stats
On this page

Goal

Create an Attack Power Stat whose Formula contribution is Strength × 2 + Weapon Power, then prove that it recalculates when Strength changes.

Prerequisites

  • Complete Build Your First Flow Stats Profile.
  • Keep one FlowStats component assigned to that Profile.
  • Have a graph route available if you want to change Strength during Play Mode.

What You Will Build

Strength Base = 10
Weapon Power Base = 5
Attack Power Base = 0
Attack Power Formula Contribution = Strength × 2 + Weapon Power
Starting Attack Power Raw = 0 + (10 × 2 + 5) = 25

Steps

1. Create the source Stats

Create three Flow Core > Stats > Stat assets:

StatDefault Base Value
Strength10
Weapon Power5
Attack Power0

Add all three to the assigned Profile and validate it.

2. Author the Attack Power formula

Open Attack Power and add these Reverse Polish Notation tokens in order:

  1. Value bound to the Strength Stat.
  2. Constant 2.
  3. Operator Multiply.
  4. Value bound to the Weapon Power Stat.
  5. Operator Add.

RPN places each operator after its operands, so the stack evaluates Strength 2 Multiply first and then adds Weapon Power.

Attack Power uses five RPN tokens to multiply Strength by two and add Weapon Power.

3. Inspect the starting result

Enter Play Mode and inspect Attack Power in Live Runtime. With no modifiers, the values should be:

Formula Contribution = 25
Raw = Base 0 + Formula Contribution 25 = 25
Effective = 25

Formula contribution is additive to Base. If you set Attack Power Base to 3, the same formula produces Raw 28, not 25.

4. Change Strength at runtime

In a Flow Graph, add Stats Change Stat Base and target the same FlowStats owner. Select Strength and use Delta 1, then run that route once.

Strength becomes 11. Attack Power recalculates to 0 + (11 × 2 + 5) = 27.

Changing Strength from ten to eleven recalculates Attack Power from twenty-five to twenty-seven.

The formula runtime itself remains standalone. A FlowCoreProcess is needed here only because this verification uses a graph Instruction to trigger the change.

Verify the Result

Common Mistakes

SymptomCheck
The formula is invalidConfirm the five tokens use the exact RPN order and leave one result on the stack.
Attack Power stays at zeroAdd all referenced Stats to the same Profile and reinitialize the runtime.
The result is higher than expectedRemember that Formula contribution is added to Attack Power Base before modifiers.
Strength changes but Attack Power does notConfirm the formula references the same Strength definition and the Instruction targets the intended owner.
Asset edits do not update Play ModeExit and re-enter Play Mode, or explicitly rebuild the runtime snapshot.

What You Built

You created a dependency-aware Stat whose Formula contribution is evaluated from two other Stats. A supported runtime change to Strength now recalculates Attack Power automatically.

Next Steps

Add a reusable Regeneration Status Effect, then display calculated and mutable values through Flow Stats UI components.