View Format: Multi-Page Single Page
All Docs Documentation Version: Base (Free) Influence System Modifier System

Attribute Data Wizard Guide

Complete guide to the 4-step attribute generation wizard that creates type-safe, feature-rich attribute systems with modern three-tier architecture.

What the Wizard Generates

The wizard creates a complete attribute system with modern architecture:

Three-Tier Value System

Each attribute has baseValue, formulaBonus, modifierBonus, and calculated totalValue for clean separation of concerns.

Type-Safe Interface

Generated components implement ISimpleAttributeDataSource for consistent integration across your project.

Automatic Regeneration

Coroutine-based regeneration system for Vital attributes with configurable delays and rates.

Ultimate Ready

Built-in support for Simple Attribute Forge Ultimate's Influence System through formulaBonus separation, and Modifier System through modifierBonus.

Step 1: Data Info

Configure the basic information and naming conventions for your attribute system.

Required Fields

Data Name

The display name for your attribute system (e.g., "Character Attributes")

  • Used in ScriptableObject asset name
  • Appears in inspector headers
  • Should be descriptive and clear

Description

Brief description of the system's purpose

  • Helps with project organization
  • Useful for team collaboration
  • Exported with JSON data

Class Name Prefix

Prefix for all generated classes (e.g., "Character")

  • Creates: CharacterAttributes.cs
  • Creates: CharacterAttributesEnum.cs
  • Creates: CharacterAttributeData.cs

Namespace (Optional)

C# namespace for generated code (e.g., "Game.Attributes")

  • Prevents naming conflicts
  • Organizes code structure
  • Follow your project conventions
Naming Best Practices:

Step 2: Attributes Configuration

Define your attributes with their behaviors, types, and properties.

Behavior Types

Basic

Use for: Strength, Intelligence, Dexterity

  • Simple values without current/max split
  • No regeneration capability
  • Perfect for core stats
  • Access via: attribute.totalValue

Vital

Use for: Health, Mana, Stamina

  • Has current and max values
  • Supports automatic regeneration
  • Current clamped to 0-max range
  • Access via: attribute.currentValue

Percentage

Use for: Critical Chance, Resistance

  • Values typically 0-100
  • Perfect for rates and chances
  • No special behaviors
  • Use with: Random.Range(0f, 100f) < critChance.totalValue

Resource

Use for: Gold, Experience, Level

  • Automatically forced to integers
  • Perfect for countable items
  • No regeneration capability
  • Access via: attribute.GetIntValue()

Essential Properties

// Every attribute has these core properties: Name: "Health" // Display name Code: "HP" // Short abbreviation for UI Base Value: 100.0 // Starting value Min Value: 0.0 // Minimum boundary Max Value: 100.0 // Maximum boundary Force Integer: false // Round to whole numbers Behavior Type: Vital // Determines available features

Regeneration Settings (Vitals Only)

Can Regenerate: true // Enable auto-recovery Regeneration Rate: 5.0 // Points per second Regeneration Delay: 3.0 // Seconds before regen starts
Pro Tip: The three-tier value system means you don't need to worry about bonuses during setup. The baseValue you set becomes the foundation, and formula/modifier bonuses are added automatically.

Step 3: Code Settings

Configure where and how the code files are generated.

Output Directories

Script Output Path

Where .cs files are generated

  • Default: Assets/Generated/[SystemName]/
  • Must be within Assets folder
  • Creates subdirectories if needed

Asset Output Path

Where .asset files are created

  • Usually same as script path
  • Can be different for organization
  • Must be within Assets folder

Generated File Preview

Assets/Generated/CharacterAttributes/ ├── CharacterAttributesEnum.cs // Type-safe identifiers ├── CharacterAttributes.cs // MonoBehaviour component ├── CharacterAttributeData.cs // ScriptableObject definition └── CharacterAttributeData.asset // Data asset

Code Preview

The wizard shows exactly what will be generated before creating files:

// Generated enum public enum CharacterAttributesEnum { Health = 0, Mana = 1, Strength = 2, // ... other attributes } // Generated component (implements ISimpleAttributeDataSource) public class CharacterAttributes : MonoBehaviour, ISimpleAttributeDataSource { [Header("Vital Attributes")] public SimpleRuntimeAttribute health; public SimpleRuntimeAttribute mana; [Header("Basic Attributes")] public SimpleRuntimeAttribute strength; // Three-tier value system built-in // Automatic regeneration management // Type-safe attribute access // Component-wide events }
File Overwrite Warning: The wizard will overwrite existing files with the same names. Make sure to backup any custom changes before regenerating.

Step 4: Generate Files

Create all the files and integrate them into your project.

Generation Process

1 Code Generation: Creates .cs files with modern architecture
2 Asset Creation: Generates ScriptableObject assets
3 Auto-Compilation: Unity compiles the new code
4 Ready to Use: Components available in Add Component menu

What You Get

Type-Safe Access

// Direct property access var health = attributes.health; // Enum-based lookup var attr = attributes.GetRuntimeAttribute("Health");

Three-Tier Values

// Always use totalValue for gameplay float damage = strength.totalValue * weapon; // Base value for permanent changes strength.baseValue += levelUpBonus;

Automatic Events

// Individual attribute events health.OnValueChanged += UpdateUI; health.OnReachedZero += HandleDeath; // Component-wide events attributes.OnAnyAttributeChanged += LogChange;

Built-in Regeneration

// Just deal damage - system handles regeneration health.ModifyValue(-damage); // Automatic coroutine management // No manual Update() calls needed

Advanced Features

JSON Import/Export

Share attribute configurations between projects or team members:

// Export creates comprehensive JSON with: { "dataName": "Character Attributes", "attributes": [...], "behaviorTypeRules": [...], "validationRules": [...], "_metadata": { "exportedOn": "2024-01-01 12:00:00", "version": "1.0" } }

Validation System

The wizard automatically validates and fixes common configuration issues:

Ultimate Integration

Generated components are ready for Simple Attribute Forge Ultimate:

Best Practices

Attribute Naming

  • Use clear, descriptive names
  • Keep codes short (HP, STR, INT)
  • Be consistent with your game's terminology
  • Avoid abbreviations in full names

Value Ranges

  • Set realistic min/max bounds
  • Consider future growth/balance changes
  • Use round numbers for player clarity
  • Test with extreme values

Regeneration Tuning

  • Balance rate with gameplay pacing
  • Use delays to prevent spam healing
  • Consider different rates per attribute
  • Test in actual game scenarios

Organization

  • Use consistent naming across projects
  • Keep generated files together
  • Use namespaces for large projects
  • Document custom modifications

Integration Example

// After generation, use in your game: public class Player : MonoBehaviour { private CharacterAttributes attributes; void Start() { attributes = GetComponent<CharacterAttributes>(); // Setup events attributes.health.OnReachedZero += Die; attributes.OnAnyAttributeChanged += UpdateUI; Debug.Log($"Player has {attributes.health.totalValue} HP"); } public void TakeDamage(float amount) { // Use the three-tier system correctly attributes.health.ModifyValue(-amount); // Regeneration starts automatically after delay } public void LevelUp() { // Permanent stat increases attributes.strength.baseValue += 2; attributes.health.baseValue += 20; // Ready for Pro formula integration } }
You're Ready! With the wizard-generated system, you have a complete, modern attribute system that follows best practices and integrates seamlessly with both basic gameplay and the advanced features in Simple Attribute Forge Ultimate.