All Docs Documentation Version: Base (Free) Influence System Ultimate
Simple Attribute Forge Ultimate

Orchestrator Setup

Configuring and optimizing the generated orchestrator component

Initial Setup Process

Adding Orchestrator to GameObject

1 Locate Your GameObject

Find the GameObject that contains your attribute system component (e.g., CharacterAttributes).

2 Add Orchestrator Component
  1. Select the GameObject
  2. Click Add Component
  3. Search for your generated orchestrator (e.g., "CharacterInfluence")
  4. Add the component
3 Configure References
Required Configuration: • Attribute System: Assign your attribute component (CharacterAttributes) • Formulas: Should auto-populate with generated formula assets
Auto-Detection: The orchestrator automatically finds and assigns formula assets from the generated folder.

Inspector Configuration

System Configuration Section

Attribute System: Reference to your ISimpleAttributeDataSource component Formulas: List of FormulaAsset ScriptableObjects

Update Configuration Section

Update Mode

  • Smart: Event-driven updates (recommended)
  • Interval: Fixed-time recalculation
  • Manual: Only when explicitly called

Recalculation Mode

  • Auto: Recalculate when baseValue changes
  • Manual: Only on explicit method calls
Performance Options: • Interval Update Rate: Seconds between updates (Interval mode only) • Enable Caching: Cache attribute references for performance • Debug Mode: Enable detailed calculation logging

Formula Management

The Formulas list shows all assigned formula assets:

Formula List Display: StrengthDamage (Order: 0, Enabled) LevelHealth (Order: 0, Enabled) IntelligenceMana (Order: 1, Enabled) MissingFormula (Missing asset reference) Each formula shows: • Execution order • Enabled/disabled status • Validation state

Performance Tuning

Update Mode Selection

Smart Mode (Recommended)

Best for: Real-time games, action RPGs

  • Automatic recalculation when attributes change
  • Zero overhead when values are stable
  • Immediate response to value changes

Interval Mode

Best for: High-frequency changes, performance-critical scenarios

  • Fixed-time recalculation intervals
  • Predictable performance cost
  • Batches multiple changes together

Manual Mode

Best for: Turn-based games, explicit control

  • Only recalculates when explicitly called
  • Maximum performance (no automatic updates)
  • Perfect for turn-based mechanics

Caching Configuration

Enable Caching: true • Caches attribute references for faster lookup • Reduces GetComponent calls during calculations • Automatically refreshes when attribute system changes • Small memory cost for significant performance gain Recommended: Enable for systems with 5+ formulas

Performance Monitoring

Debug Mode Features: • Calculation timing logs • Formula execution order tracking • Dependency resolution monitoring • Performance bottleneck identification Enable temporarily to profile your formula system performance.

Integration Patterns

Standard Integration

// Most common setup GameObject: Player ├── CharacterAttributes (Base System) │ ├── health, mana, strength, etc. │ └── Implements ISimpleAttributeDataSource └── CharacterInfluence (Pro System) ├── attributeSystem → CharacterAttributes └── formulas → Auto-assigned formula assets

Multiple Character Types

// Different orchestrators for different entity types PlayerCharacter: ├── PlayerAttributes + PlayerInfluence EnemyCharacter: ├── EnemyAttributes + EnemyInfluence NPCCharacter: ├── NPCAttributes + NPCInfluence Each type can have specialized formula sets.

Shared Formula Systems

// Multiple GameObjects using same formula assets GameManager: ├── GlobalInfluence (manages shared formulas) └── References: List of all attribute systems Characters reference global formulas for consistency.

Runtime Configuration

Dynamic Mode Switching

public class GameStateManager : MonoBehaviour { private CharacterInfluence orchestrator; void Start() { orchestrator = GetComponent<CharacterInfluence>(); } void EnterCombat() { // Switch to Smart mode for responsive combat orchestrator.updateMode = UpdateMode.Smart; orchestrator.recalculationMode = RecalculationMode.Auto; } void EnterTownPhase() { // Switch to Manual mode for non-critical periods orchestrator.updateMode = UpdateMode.Manual; orchestrator.recalculationMode = RecalculationMode.Manual; } }

Runtime Formula Management

public class DynamicFormulas : MonoBehaviour { private CharacterInfluence orchestrator; void ApplyTemporaryEffect() { // Create temporary formula for buff/debuff var tempFormula = ScriptableObject.CreateInstance<FormulaAsset>(); tempFormula.formulaName = "TempBuff"; tempFormula.targetAttribute = "Damage"; // ... configure formula ... orchestrator.AddFormula(tempFormula); // Remove after duration StartCoroutine(RemoveFormulaAfter("TempBuff", 30f)); } IEnumerator RemoveFormulaAfter(string formulaName, float duration) { yield return new WaitForSeconds(duration); orchestrator.RemoveFormula(formulaName); } }

Advanced Configuration

Execution Order Management

Control formula calculation sequence for complex dependencies:

Execution Order Examples: Order 0: Base stat calculations (STR → Damage, INT → Mana) Order 1: Combined calculations (Physical + Magical → Total) Order 2: Final modifiers (Difficulty scaling, global effects) Lower numbers execute first, higher numbers execute later.

Validation Settings

Validation Configuration: • Strict Mode: Halt execution on any validation error • Warning Mode: Log warnings but continue execution • Silent Mode: Ignore validation issues (not recommended) Development: Use Strict Mode Production: Use Warning Mode

Memory Management

Memory Optimization: • Formula asset preloading • Attribute reference caching • Calculation result pooling • Garbage collection minimization Automatically handled by the orchestrator.

Debugging & Monitoring

Debug Mode Output

// Enable detailed logging orchestrator.debugMode = true; // Console output: [Orchestrator] Recalculating all formulas... [Formula] StrengthDamage: STR(25) → Damage +50 [Formula] LevelHealth: Level(10) → Health +200 [Validation] All formulas calculated successfully [Performance] Total calculation time: 0.2ms

Performance Monitoring

// Monitor calculation frequency void Update() { if (debugMode) { calculationsThisFrame++; if (Time.frameCount % 60 == 0) // Log every second { Debug.Log($"Calculations per second: {calculationsThisFrame}"); calculationsThisFrame = 0; } } }

Formula State Inspection

// Runtime inspection methods Debug.Log(orchestrator.GetFormulaNames()); // List all formulas Debug.Log(orchestrator.HasFormula("StrengthDamage")); // Check existence Debug.Log(orchestrator.GetFormula("LevelHealth")); // Get formula asset // Test individual formulas var testValues = new Dictionary<string, float> {{"Strength", 30}}; float result = orchestrator.TestFormula("StrengthDamage", testValues);

Integration Best Practices

Component Order

Recommended Order:
  1. Attribute System Component (CharacterAttributes)
  2. Orchestrator Component (CharacterInfluence)
  3. Other game logic components

Initialization Sequence

// Proper initialization in your game scripts void Awake() { // Get components in correct order attributes = GetComponent<CharacterAttributes>(); orchestrator = GetComponent<CharacterInfluence>(); } void Start() { // Orchestrator is fully initialized here // Safe to access calculated values InitializeUI(); SetupEventListeners(); }

Event Handling

void SetupEventListeners() { // Listen for attribute changes attributes.strength.OnBaseValueChanged += OnStrengthChanged; attributes.level.OnBaseValueChanged += OnLevelChanged; // Listen for total value changes (includes formula results) attributes.health.OnValueChanged += UpdateHealthUI; } void OnStrengthChanged(SimpleRuntimeAttribute attr, float oldValue, float newValue) { // Formulas automatically recalculate in Smart mode Debug.Log($"Strength changed: {oldValue} → {newValue}"); // health.formulaBonus will update automatically }

Common Setup Issues

Reference Assignment Problems

Attribute System Not Assigned:
Missing Formula Assets:

Runtime Calculation Issues

Formulas Not Executing:
  1. Verify Update Mode is set correctly
  2. Check that formula assets are enabled
  3. Ensure attribute system reference is valid
  4. Look for validation errors in console

Performance Issues

High CPU Usage:

Advanced Features

Custom Validation Rules

// Override validation in generated orchestrator protected override bool ValidateFormula(FormulaAsset formula) { // Add custom validation logic if (formula.targetAttribute == "CriticalChance") { // Ensure crit chance doesn't exceed 100% return formula.Calculate(this) <= 100f; } return base.ValidateFormula(formula); }

Event Customization

// Custom events in your orchestrator public class CharacterInfluence : MonoBehaviour { // Custom events for formula system public UnityEvent OnSystemInitialized; public UnityEvent<string> OnFormulaRecalculated; public UnityEvent<float> OnMajorStatChange; void NotifyMajorChange(string attributeName, float change) { if (Mathf.Abs(change) > significantChangeThreshold) { OnMajorStatChange?.Invoke(change); } } }

Multi-System Coordination

// Coordinating multiple influence systems public class SystemCoordinator : MonoBehaviour { [SerializeField] private CharacterInfluence playerInfluence; [SerializeField] private EquipmentInfluence equipmentInfluence; [SerializeField] private EnvironmentInfluence environmentInfluence; void RecalculateAllSystems() { // Coordinate recalculation order equipmentInfluence.RecalculateAll(); // Equipment first environmentInfluence.RecalculateAll(); // Environment second playerInfluence.RecalculateAll(); // Character last } }

Optimization Strategies

For Real-Time Games

For Turn-Based Games

For Mobile Platforms

Mobile Optimization Settings: • Update Mode: Interval (0.1-0.2 seconds) • Recalculation Mode: Manual • Enable Caching: true • Debug Mode: false (production builds) Reduces battery drain and improves performance on lower-end devices.

Testing Your Setup

Basic Functionality Test

  1. Enter Play Mode
  2. Inspect Attributes: Check that formulaBonus values are calculated
  3. Modify Base Values: Change baseValue in inspector
  4. Verify Updates: Watch formulaBonus recalculate automatically

Performance Test

// Test performance with rapid changes void TestPerformance() { var stopwatch = System.Diagnostics.Stopwatch.StartNew(); for (int i = 0; i < 1000; i++) { attributes.strength.baseValue = Random.Range(10, 50); // Formulas should recalculate automatically } stopwatch.Stop(); Debug.Log($"1000 calculations took: {stopwatch.ElapsedMilliseconds}ms"); }

Integration Test

// Verify integration with gameplay systems void TestGameplayIntegration() { // Test damage calculation float damage = attributes.strength.totalValue; // Should include formula bonus // Test UI updates healthBar.fillAmount = attributes.health.currentValue / attributes.health.totalValue; // Test level up attributes.level.baseValue += 1; // Health should increase automatically via formula }