Stat/Attribute Manager
Last updated
Was this helpful?
Last updated
Was this helpful?
The Stat Manager (AC_StatManager) is responsible for managing all stats and attributes in the project, both for player and AI. It works similarly to the Action Manager by instantiating each stat as a UObject at runtime, based on either a provided map or a data table. This component is designed to be data-oriented and event-driven, ensuring real-time responsiveness and integration with other systems.
It is added to the Base Character class by default (B_Base_Character).
Stat Initialization:
At startup, the AC_StatManager:
Loads stats from the provided data table or Stats[] map.
Creates an instance of each stat as a UObject for modular and extensible management.
The player's class asset provides base values for the attributes.
Stat Tracking:
Maintains a centralized map of stat instances, allowing quick retrieval through Gameplay Tags.
Stat Modification:
Provides methods to:
Increment or decrement a stat by a given value (e.g., apply damage, buffs).
Query the current or base value of a stat.
Level up the player.
Event Dispatching:
Changes to stat values automatically trigger event dispatchers, which are typically listened to by:
UI Widgets (e.g., updating health bars, stamina meters).
Other Components (e.g., triggering status effects or activating abilities).
The Stats/Attributes a character will have depends on what the Stat Manager is provided. Stats can be provided through a data table or through the Stats[] map in AC_StatManager:
Player level is handled automatically through attribute increase from the Campfire. However, you can also manually increase/decrease level using the Stat Manager.