Overview
WCGASAttributeRegistry is a Game Instance Subsystem that serves as the central runtime registry for all attribute definitions in the Wonderscape GAS Ally plugin. It automatically initializes at game start, loads all attribute definitions from Project Settings, assigns them to pool slots (Attribute_00 through Attribute_149), and provides fast lookup capabilities for the attribute system.
Purpose
The Attribute Registry serves as the bridge between designer-created WCGASAttributeDefinition Data Assets and the runtime WCGASAttributePool that lives on Ability System Components. It provides:
- Centralized Management: Single source of truth for all registered attributes
- Automatic Initialization: Loads and validates all attribute definitions at game start
- Slot Assignment: Maps each attribute definition to a specific pool slot (0-149) using stable GUIDs
- Fast Lookups: Provides multiple lookup methods (by tag, name, slot, GUID)
- Validation: Ensures no duplicate names, tags, or GUIDs exist in the system
- Clamping Logic: Calculates clamped values using attribute definitions' rules
How It Works
Initialization Flow
- Game Start: When the GameInstance initializes, the registry automatically loads
- Load Settings: Reads the
Attribute Definitions array from Project Settings > Plugins > WC GAS Ally
- Validation: Each attribute definition is validated for uniqueness (name, tag, GUID)
- Slot Assignment: Valid attributes are assigned pool slots (0-149) based on their order in the settings array
- Registration: Attributes are added to internal lookup maps for fast queries
Slot Assignment