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

Troubleshooting Guide

Common issues, solutions, and debugging techniques for the Ultimate system

Quick Solutions Checklist

Formulas Not Working?

Wizard Issues?

Performance Problems?

Formula Calculation Issues

Formulas Not Executing

Symptoms:

  • formulaBonus always shows 0
  • totalValue equals baseValue only
  • No automatic recalculation when values change

Step-by-Step Diagnosis:

1 Verify Orchestrator Setup
// Check these in Inspector: Orchestrator component added to GameObject Attribute System field assigned Formulas list shows formula assets (not empty) Update Mode set to Smart or Interval Recalculation Mode set to Auto
2 Test Interface Implementation
// Add this test script temporarily: public class InterfaceTest : MonoBehaviour { void Start() { var component = GetComponent(); if (component is ISimpleAttributeDataSource dataSource) { Debug.Log(" ISimpleAttributeDataSource implemented"); Debug.Log($" Attributes found: {dataSource.GetAllAttributes().Count()}"); } else { Debug.LogError(" ISimpleAttributeDataSource NOT implemented"); Debug.LogError(" → Regenerate attributes with latest base wizard"); } } }
3 Force Manual Recalculation
// Test manual calculation: [ContextMenu("Force Recalculate")] void ForceRecalculate() { var orchestrator = GetComponent(); // Your generated orchestrator orchestrator.SendMessage("RecalculateAll"); // Check results var health = attributes.GetAttribute("Health"); Debug.Log($"Health: base={health.baseValue}, formula={health.formulaBonus}, total={health.totalValue}"); }
Incorrect Calculation Results

Symptoms:

  • Formula results don't match expected values
  • Math doesn't add up correctly
  • Breakpoints not activating when they should

Debugging Calculation Errors:

1 Enable Debug Mode
// In orchestrator inspector or code: orchestrator.debugMode = true; // Console output shows detailed calculation steps: [CharacterInfluence] Calculating StrengthDamage... [Pipeline] Step 1 Start: 0 [Pipeline] Step 2 Flat: STR(25) × 2.0 = 50 [Pipeline] Step 3 Add%: WeaponSkill(30) × 1.5% = 4.5% → ×1.045 [Pipeline] Step 4 Sub%: None [Pipeline] Step 5 Mul: Class ×1.2 [Pipeline] Step 6 PostFlat: BaseWeapon +15 [Pipeline] Result: 15 + ((0 + 50) × 1.045 × 1.2) = 15 + 62.7 = 77.7
2 Use Test Preview Panel
// In Influence Wizard: 1. Select the problematic formula 2. Set test values to match your runtime scenario 3. Compare Test Preview calculation with actual result 4. Look for differences in the step-by-step breakdown
3 Verify Breakpoint Conditions
// Check breakpoint activation: var strength = attributes.GetAttribute("Strength"); var level = attributes.GetAttribute("Level"); Debug.Log($"STR: {strength.totalValue}, Level: {level.totalValue}"); Debug.Log($"Breakpoint condition: STR ≥ 30? {strength.totalValue >= 30}"); Debug.Log($"Additional condition: Level ≥ 20? {level.totalValue >= 20}");

Influence Wizard Issues

Wizard Won't Open

Symptoms:

  • Menu item doesn't appear or is grayed out
  • Clicking menu item does nothing
  • Console errors when trying to open

Solutions:

  • Check Unity Console for compilation errors
  • Verify Simple Attribute Forge base system is installed
  • Ensure Unity is in Edit mode (not Play mode)
  • Try Window → General → Console to clear persistent errors
  • Restart Unity if wizard state is corrupted
No Attributes Appear in Setup

Symptoms:

  • Setup tab shows "No attributes found"
  • AttributeData field is assigned but attributes don't load
  • Available Attributes section is empty

Solutions:

Diagnostic Steps: 1. Verify AttributeData asset exists and is not corrupted 2. Check that base system was generated successfully 3. Look for AttributeData in Assets/Generated/AttributeData/ 4. Try regenerating base system if asset is missing 5. Ensure AttributeData contains actual attribute definitions
Test Preview Not Working

Symptoms:

  • Test panel shows "No calculation result"
  • Changing test values doesn't update results
  • Step-by-step breakdown is empty

Solutions:

  • Ensure a formula is selected in the formula list
  • Check that formula has at least one pipeline step configured
  • Verify test values are within reasonable ranges
  • Look for validation errors in formula configuration
  • Try refreshing test panel with Ctrl+R

Generation Issues

Generation Fails

Symptoms:

  • Click Generate but no files are created
  • Console shows file writing errors
  • Partial files generated but incomplete

Solutions:

File Permission Checks: 1. Ensure output directories are writable 2. Close any external editors that might lock files 3. Check that Unity has write permissions to project folder 4. Verify output paths don't contain invalid characters 5. Try generating to a different output directory
Compilation Errors After Generation

Symptoms:

  • Red compilation errors in Unity Console
  • Generated code doesn't compile
  • Missing namespace or class references

Solutions:

Common Compilation Issues: System Name Conflicts: • Ensure system name is valid C# identifier • Avoid reserved keywords (class, interface, etc.) • Check for naming conflicts with existing classes Namespace Issues: • Verify namespace is valid if specified • Check for conflicts with Unity or system namespaces • Try empty namespace if having issues Missing Dependencies: • Ensure base Simple Attribute Forge is properly installed • Check that all required packages are imported • Verify Unity version compatibility

Runtime Issues

Performance Problems

Symptoms:

  • Frame rate drops when using formulas
  • Unity becomes unresponsive during calculation
  • High CPU usage from formula system

Performance Optimization:

1 Adjust Update Mode
Performance Tuning by Game Type: Real-time Action Games: • Update Mode: Smart (event-driven) • Recalculation Mode: Auto • Enable Caching: true • Minimize formula complexity Turn-based Games: • Update Mode: Manual • Recalculation Mode: Manual • Batch all changes, then RecalculateAll() • Complex formulas acceptable High-frequency Systems: • Update Mode: Interval (0.1-0.2 seconds) • Enable Caching: true • Reduce breakpoint complexity
2 Profile Formula System
// Performance monitoring script: public class FormulaProfiler : MonoBehaviour { private float calculationTime; private int calculationsThisFrame; void Update() { if (debugMode && Time.frameCount % 60 == 0) { Debug.Log($"Formulas per second: {calculationsThisFrame}"); Debug.Log($"Average calculation time: {calculationTime:F2}ms"); calculationsThisFrame = 0; calculationTime = 0; } } }
3 Optimize Formula Design
  • Limit breakpoints per formula (3-5 maximum)
  • Combine multiple small formulas into larger ones
  • Use execution order to minimize dependency recalculations
  • Cache attribute references in your own scripts
Circular Dependencies

Symptoms:

  • Console warnings about convergence
  • Formula values oscillating or growing infinitely
  • Calculation iteration limits reached

Circular Dependency Solutions:

Dependency Analysis: 1. Map out formula relationships: • StrengthDamage: Strength → Damage • DamageHealth: Damage → Health (PROBLEM!) • HealthStrength: Health → Strength (CREATES LOOP!) 2. Break the cycle: • Use execution order to control sequence • Remove problematic dependencies • Use intermediate calculations • Split complex formulas into simpler ones
System Protection: The system automatically limits iterations to 10 cycles and logs convergence warnings. Values stabilize when changes are below threshold.
Self-Reference Issues

Symptoms:

  • Formula uses target attribute as source
  • Values accumulating each frame
  • Yellow warnings in wizard

Self-Reference Solutions:

Self-Reference Patterns: Valid Use Case: • Health formula uses current Health as source • For conditional scaling based on current health % • Use Manual recalculation mode to control updates Invalid Use Case: • Damage formula adds to itself every frame • Creates infinite growth in Auto mode • Should use different source attribute
Design Pattern: Self-reference is valid for conditional effects but requires careful update mode management.

Integration Issues

Missing Component References

Symptoms:

  • NullReferenceExceptions when accessing attributes
  • GetComponent calls returning null
  • Orchestrator can't find attribute system

Component Reference Solutions:

// Robust component finding: public class AttributeSystemManager : MonoBehaviour { private ISimpleAttributeDataSource attributeSystem; private MonoBehaviour orchestrator; void Awake() { // Find components reliably attributeSystem = GetComponent(); if (attributeSystem == null) { Debug.LogError("No ISimpleAttributeDataSource found on " + gameObject.name); return; } // Find orchestrator by interface or name pattern orchestrator = GetComponents() .FirstOrDefault(mb => mb.GetType().Name.Contains("Influence")); if (orchestrator == null) { Debug.LogError("No orchestrator found on " + gameObject.name); } } }
UI Update Problems

Symptoms:

  • UI shows old values after formula calculations
  • Health bars don't reflect formula bonuses
  • Text displays don't update automatically

UI Integration Solutions:

// Proper UI updating with formulas: public class AttributeUI : MonoBehaviour { void Start() { // Listen for attribute changes var health = attributes.GetAttribute("Health"); var strength = attributes.GetAttribute("Strength"); health.OnValueChanged += UpdateHealthUI; strength.OnValueChanged += UpdateStrengthUI; } void UpdateHealthUI(SimpleRuntimeAttribute attr, float oldValue, float newValue) { // Use totalValue for maximum health, currentValue for current healthBar.fillAmount = attr.currentValue / attr.totalValue; healthText.text = $"{attr.currentValue:F0}/{attr.totalValue:F0}"; // Show formula bonus separately if desired if (attr.formulaBonus > 0) { bonusText.text = $"(+{attr.formulaBonus:F0})"; } } }

Common Error Messages

Error Message Cause Solution
"No ISimpleAttributeDataSource found" Attribute component doesn't implement required interface Regenerate attributes with latest base wizard
"FormulaAsset class not found" Formula classes not generated yet Generate orchestrator first, then create formula assets
"Attribute 'X' not found" Typo in attribute name or missing attribute Check spelling, verify attribute exists in AttributeData
"Convergence threshold exceeded" Values changing too rapidly in circular dependency Use Manual mode or break dependency cycle
"Maximum iterations reached" Circular dependency loop detected Review formula dependencies and execution order
"Formula validation failed" Invalid formula configuration Check all required fields, verify attribute references

Debug Tools and Techniques

Console Debug Commands

// Add these context menu items to your orchestrator: [ContextMenu("Debug: Show All Formulas")] void DebugShowFormulas() { Debug.Log("=== Formula Debug Report ==="); foreach (var formula in formulas) { if (formula != null) { Debug.Log($" {formula.formulaName}: Enabled={formula.enabled}, Order={formula.executionOrder}"); } else { Debug.LogWarning(" Null formula asset detected"); } } } [ContextMenu("Debug: Test Single Formula")] void DebugTestFormula() { if (formulas.Count > 0 && formulas[0] != null) { float result = formulas[0].Calculate(this); Debug.Log($"Formula {formulas[0].formulaName} result: {result}"); } } [ContextMenu("Debug: Show Attribute Values")] void DebugAttributeValues() { var allAttrs = attributeSystem.GetAllAttributes(); foreach (var attr in allAttrs) { Debug.Log($"{attr.name}: base={attr.baseValue:F1}, formula={attr.formulaBonus:F1}, " + $"modifier={attr.modifierBonus:F1}, total={attr.totalValue:F1}"); } }

Performance Profiling

// Performance measurement script: public class PerformanceProfiler : MonoBehaviour { private System.Diagnostics.Stopwatch stopwatch; void Start() { stopwatch = new System.Diagnostics.Stopwatch(); } [ContextMenu("Profile Formula Performance")] void ProfileFormulas() { var orchestrator = GetComponent(); // Your orchestrator stopwatch.Restart(); // Test multiple calculations for (int i = 0; i < 100; i++) { orchestrator.SendMessage("RecalculateAll"); } stopwatch.Stop(); float avgTime = stopwatch.ElapsedMilliseconds / 100f; Debug.Log($"Average calculation time: {avgTime:F2}ms"); if (avgTime > 1.0f) { Debug.LogWarning("Performance may be too slow for real-time updates"); } } }

Validation Tools

// Comprehensive system validation: public class SystemValidator : MonoBehaviour { [ContextMenu("Validate Complete System")] void ValidateSystem() { Debug.Log("=== System Validation Report ==="); // Check components var attributes = GetComponent(); var orchestrator = GetComponent(); if (attributes == null) { Debug.LogError(" No ISimpleAttributeDataSource component"); return; } if (orchestrator == null) { Debug.LogError(" No orchestrator component"); return; } // Test attribute access try { var allAttrs = attributes.GetAllAttributes(); Debug.Log($" {allAttrs.Count()} attributes accessible"); foreach (var attr in allAttrs) { if (float.IsNaN(attr.totalValue) || float.IsInfinity(attr.totalValue)) { Debug.LogError($" {attr.name} has invalid totalValue: {attr.totalValue}"); } } } catch (System.Exception e) { Debug.LogError($" Attribute access failed: {e.Message}"); } Debug.Log("=== End Validation Report ==="); } }

Advanced Troubleshooting

Memory Issues

Memory Leaks
Memory Management Best Practices: • Avoid creating formula assets at runtime • Cache attribute references instead of repeated lookups • Use object pooling for temporary calculation objects • Profile memory usage during long play sessions Memory Leak Detection: 1. Use Unity Profiler to monitor memory usage 2. Look for growing allocations in GC.Alloc 3. Check for unclosed coroutines in regeneration systems 4. Monitor formula asset creation/destruction

Thread Safety

Multithreading Issues
Thread Safety Guidelines: • Formula calculations are NOT thread-safe • Always calculate on main Unity thread • Use Coroutines for long-running calculations • Avoid formula access from background threads Safe Multithreading Pattern: // Background thread calculates values float[] values = CalculateInBackground(); // Main thread applies results UnityMainThreadDispatcher.Instance.Enqueue(() => { ApplyCalculatedValues(values); });

Save/Load Corruption

Save Data Problems
Save/Load Troubleshooting: Common Issues: • Saving formulaBonus (should save baseValue only) • Not recalculating formulas after loading • Missing currentValue for Vitals • Incorrect value tier assignments Robust Save/Load Pattern: // Saving SaveData.SetFloat($"{attr.name}_base", attr.baseValue); if (attr.isVital) { SaveData.SetFloat($"{attr.name}_current", attr.currentValue); } // Loading attr.baseValue = SaveData.GetFloat($"{attr.name}_base"); if (attr.isVital) { attr.currentValue = SaveData.GetFloat($"{attr.name}_current"); } // IMPORTANT: Recalculate after loading all attributes orchestrator.RecalculateAll();

Diagnostic Scripts

Complete System Diagnostic

using UnityEngine; using SimpleAttributeForge; using System.Linq; public class UltimateSystemDiagnostic : MonoBehaviour { [ContextMenu("Run Complete Diagnostic")] void RunDiagnostic() { Debug.Log("=== Simple Attribute Forge Ultimate Diagnostic ==="); // Component checks CheckComponents(); // Attribute system checks CheckAttributeSystem(); // Formula system checks CheckFormulaSystem(); // Performance checks CheckPerformance(); Debug.Log("=== Diagnostic Complete ==="); } void CheckComponents() { Debug.Log("--- Component Check ---"); var attributeComp = GetComponent(); var orchestratorComp = GetComponents() .FirstOrDefault(mb => mb.GetType().Name.Contains("Influence")); Debug.Log($"Attribute Component: {(attributeComp != null ? " Found" : " Missing")}"); Debug.Log($"Orchestrator Component: {(orchestratorComp != null ? " Found" : " Missing")}"); if (orchestratorComp != null) { Debug.Log($"Orchestrator Type: {orchestratorComp.GetType().Name}"); } } void CheckAttributeSystem() { Debug.Log("--- Attribute System Check ---"); var attributes = GetComponent(); if (attributes == null) return; var allAttrs = attributes.GetAllAttributes(); Debug.Log($"Total Attributes: {allAttrs.Count()}"); foreach (var attr in allAttrs) { bool hasValidValues = !float.IsNaN(attr.totalValue) && !float.IsInfinity(attr.totalValue); Debug.Log($"{attr.name}: {(hasValidValues ? "" : "")} Values valid"); if (!hasValidValues) { Debug.LogError($" → {attr.name} has invalid values: " + $"base={attr.baseValue}, formula={attr.formulaBonus}, total={attr.totalValue}"); } } } void CheckFormulaSystem() { Debug.Log("--- Formula System Check ---"); var orchestrator = GetComponents() .FirstOrDefault(mb => mb.GetType().Name.Contains("Influence")); if (orchestrator == null) { Debug.LogError("No orchestrator found"); return; } // Use reflection to check formula assets var formulasField = orchestrator.GetType().GetField("formulas"); if (formulasField != null) { var formulas = formulasField.GetValue(orchestrator) as System.Collections.IList; Debug.Log($"Formula Assets: {formulas?.Count ?? 0}"); if (formulas != null) { for (int i = 0; i < formulas.Count; i++) { var formula = formulas[i]; Debug.Log($" Formula {i}: {(formula != null ? " Valid" : " Null")}"); } } } } void CheckPerformance() { Debug.Log("--- Performance Check ---"); var stopwatch = System.Diagnostics.Stopwatch.StartNew(); // Test calculation performance var orchestrator = GetComponents() .FirstOrDefault(mb => mb.GetType().Name.Contains("Influence")); if (orchestrator != null) { orchestrator.SendMessage("RecalculateAll"); stopwatch.Stop(); float calcTime = stopwatch.ElapsedMilliseconds; Debug.Log($"Calculation Time: {calcTime:F2}ms"); if (calcTime > 5f) { Debug.LogWarning("Calculation time may be too slow for real-time updates"); } } } }

Formula Validation Tool

using UnityEngine; using UnityEditor; public class FormulaValidationTool : EditorWindow { [MenuItem("Tools/Simple Formula Validator")] static void ShowWindow() { GetWindow("Formula Validator"); } void OnGUI() { GUILayout.Label("Formula System Validation", EditorStyles.boldLabel); if (GUILayout.Button("Validate All Formula Assets")) { ValidateAllFormulas(); } if (GUILayout.Button("Check Circular Dependencies")) { CheckCircularDependencies(); } if (GUILayout.Button("Performance Test")) { PerformanceTest(); } } void ValidateAllFormulas() { // Find all formula assets in project var formulaGuids = AssetDatabase.FindAssets("t:FormulaAsset"); Debug.Log($"Found {formulaGuids.Length} formula assets"); foreach (var guid in formulaGuids) { var path = AssetDatabase.GUIDToAssetPath(guid); var formula = AssetDatabase.LoadAssetAtPath(path); if (formula != null) { Debug.Log($" {formula.name}: Valid"); } else { Debug.LogError($" Failed to load formula at {path}"); } } } }

Getting Help

When You Need Additional Help:

Support Information

When Contacting Support, Include: • Unity version and platform • Simple Attribute Forge versions (base + Ultimate) • Console error messages (copy full text) • Screenshots of wizard configuration • Minimal reproduction steps • Project setup details (single vs multi-character, etc.)

Community Resources

Preventive Measures

Development Best Practices

System Maintenance

Regular Maintenance Tasks: • Export formula backups before Unity upgrades • Test formula calculations after package updates • Validate import/export compatibility with team • Review performance metrics periodically • Check for deprecated API usage in generated code

Error Prevention

Avoid Common Problems:
  • Always regenerate base system before adding Pro features
  • Test formulas in wizard before generating orchestrator
  • Use descriptive names for formulas and avoid special characters
  • Keep formula complexity reasonable (max 5 breakpoints per formula)
  • Document formula logic for team collaboration