Every formula in the Ultimate system follows this exact 7-step pipeline, ensuring consistent and predictable calculations across all attribute relationships.
Pipeline Flow Visualization
Step 1: Starting Point (Zero or TargetBase)
↓
Step 2: Flat Bonuses (Add/Subtract)
↓
Step 3: Additive Percentages
↓
Step 4: Subtractive Percentages
↓
Step 5: Multipliers
↓
Step 6: Post-Flat Bonuses
↓
Step 7: Apply Mode (Override/Add/Subtract)
Step 1: Starting Point
Determines the initial value for all subsequent calculations.
Start Modes
public enum StartMode
{
Zero, // Begin calculation from 0
TargetBase // Begin from target attribute's baseValue
}
When to Use Each Mode
Zero Mode
Use for: Creating new calculated values
Damage calculations based on STR
Spell power based on INT
Movement speed based on AGI
TargetBase Mode
Use for: Modifying existing values
Level-based health scaling
Equipment bonuses to existing stats
Percentage modifications
Practical Examples
Zero Mode: STR 15 → Damage calculation starts at 0, adds STR bonuses
TargetBase Mode: Health 100 → Level scaling starts at 100, adds level bonuses
Step 2: Flat Bonuses
Add or subtract flat values based on source attributes.
public class FormulaRow
{
public string source; // Source attribute (e.g., "Strength")
public MathOperation operation; // Add or Subtract
public float value; // Multiplier (e.g., 2.0 for "2 per point")
}
Static multiplication factors that compound with each other.
Formula Structure
multiplierTotal = factor1 × factor2 × factor3...
Configuration
public class MultiplierRow
{
public string label; // Description (e.g., "Equipment Bonus")
public float factor; // Multiplication value (e.g., 1.2 for 20% increase)
}
Common Multiplier Sources
Equipment Sets: Wearing full armor set provides ×1.15 defense
Class Bonuses: Warrior class gets ×1.25 melee damage
Legendary Effects: Rare items provide ×1.5 effectiveness
Difficulty Scaling: Hard mode ×0.8 player health
Compounding Example
Multiple Multipliers
Equipment Bonus: ×1.2
Class Specialization: ×1.15
Legendary Item: ×1.3
Total Multiplier: 1.2 × 1.15 × 1.3 = 1.794 (79.4% increase)
Step 6: Post-Flat Bonuses
Final flat adjustments applied after all percentage and multiplier calculations.
Formula Structure
postFlatTotal = Σ(amount × additive_flag)
Configuration
public class PostFlatRow
{
public string label; // Description
public float amount; // Flat value
public bool isAdditive; // true = add, false = subtract
}
Ideal Use Cases
Base Values: Every character has 50 base health
Set Bonuses: Armor set adds flat +25 defense after all calculations
Minimum Guarantees: Ensure weapons deal at least 10 damage
Multiple formulas can target the same attribute - their results are summed:
Health Total Formula Bonus:
• LevelHealth formula: +80
• ConstitutionHealth formula: +30
• SetBonusHealth formula: +50
• Total formulaBonus: 160
Final Health: baseValue(100) + formulaBonus(160) = 260
Execution Order
Use execution order to create formula dependencies:
Order 0: Calculate base damage (STR → Damage)
Order 1: Calculate spell power (INT → SpellPower)
Order 2: Calculate total DPS (Damage + SpellPower → DPS)
Testing the Pipeline
Wizard Test Preview
The Influence Wizard includes a live test panel that shows pipeline calculations in real-time:
Set test values for all source attributes
Select a formula to test
View step-by-step breakdown in the preview panel
Modify values to test edge cases
Runtime Testing
// Test specific formula with custom values
var testValues = new Dictionary<string, float>
{
{"Strength", 20},
{"Intelligence", 15},
{"Level", 10}
};
float result = orchestrator.TestFormula("MyFormula", testValues);
Debug.Log($"Formula result: {result}");