Stats Component

Stats such as health, stamina, strength, and attack speed play a crucial role in defining the gameplay dynamics and player experience in video games. These attributes not only influence the player’s ability to interact with the game world but also dictate the complexity and depth of the game’s strategy. Collectively, stats create a framework for progression and challenge, making them essential for maintaining engagement and offering players a sense of growth and accomplishment as they navigate through the game. The Stats Component is a new addition to AAMS in version 2.0 and is a fully working stat system that can be used in any game.

Overview of the Stats Component #

The Stats Component in AAMS v2.0 introduces a robust system for managing game statistics like Health, Stamina, and Breath, crucial for gameplay dynamics in any action-adventure or parkour game. This component is designed to seamlessly integrate with AAMS, allowing developers to easily incorporate complex stat-driven mechanics into their games.

Key Features of the Stats Component: #

  • Stat Types and Settings: The system includes base and maximum values for each stat, ensuring that enhancements like health potions do not exceed predefined limits. These values can be dynamically adjusted during gameplay using the Set Base Stat Value and Set Max Stat Value functions.
  • Modifying Stats: Stats can be modified through several functions:
    • Set Stat aligns the stat to a specific value within allowed ranges.
    • Remove Stat Value decreases a stat.
    • Add Stat Values increases a stat.
    • Take Damage specializes in reducing health and incorporates additional event triggers for gameplay effects.
  • Stat Regeneration: Stats like Stamina can automatically regenerate after a cooldown period, customizable in the Stat settings. This process can be manually triggered or halted as needed through Start Regen and Stop Regen functions.
  • Stat Draining: Functions are available for actively reducing stats during actions like sprinting or underwater swimming, with options to halt draining and initiate regeneration. Key functions include Stat Drain and Stop Stat Drain.
  • Retrieving Stat Values: Functions to retrieve current, maximum, or base stat values are crucial for gameplay logic, like verifying the ability to perform actions dependent on stat thresholds. Functions include Get Current Stat Value, Get Max Stat Value, and Get Base Stat Value.
  • Stat Alerts: Alerts can be triggered when stats drop below critical levels, invoking UI changes or gameplay modifications to notify the player and adapt the game flow. This is managed by On Stat Alert event dispatchers.
  • Stat Needed Events: These are triggered when a player attempts an action without sufficient stats, providing feedback directly via UI elements or other in-game effects, facilitated by the On Stat Needed event dispatcher.

Setting Up the Stat Component: #

  1. Integration: Add the Stat Component to your character’s blueprint and configure initial stat settings including base and maximum values.
  2. Configure Initial Stat Settings:
    • Access the Stat Component’s details panel and add stats using the plus sign. Set Base Value and Max Value for each stat and configure alerts as needed.
  3. HUD Integration: Create a HUD widget at game start to visually represent stats, ensuring players are always informed of their status.
  4. Event Dispatchers Setup: Utilize event dispatchers within the Stat Component to handle diverse scenarios like death, stat depletion, or reaching maximum values, allowing for tailored responses like animations or game state changes.

Practical Use: #

This system not only facilitates detailed stat tracking and adjustments but also enhances interaction with the game world, making gameplay more immersive and responsive to player actions.

Integrating HUD and Stat Widgets #

The visualization of stats within the game’s HUD is crucial for providing players with immediate feedback on their character’s status. Here’s how to set up and manage stat widgets effectively in AAMS.

Using the WB_PlayerHealth Widget #

  • Widget Composition: The WB_PlayerHealth widget incorporates two WB_StatBar widgets, one each for Health and Stamina.
  • Configuration: These bars are configured to display the appropriate stat by setting the Stat Type dropdown within each WB_StatBar widget.
  • Dynamic Updates:
    • Current and Max Values: Text values for current and maximum stats are dynamically updated using the Get Current Stat Value and Get Max Stat Value functions from the player’s Stat Component.
    • Stat Changes: The Current Stat Value in the WB_StatBar widget is refreshed through the OnStatChanged event dispatcher, ensuring the display is always accurate and up-to-date.

Setting Up a Stat Bar #

To incorporate a stat bar within any HUD widget in your game, follow these straightforward steps:

  1. Add the WB_StatBar Widget: Place the WB_StatBar widget into the desired HUD widget where you want the stat to be displayed.
  2. Configure Stat Type:
    • Stat Selection: Use the Stat Type dropdown to select the specific stat (e.g., Health, Stamina) that this bar will represent.
  3. Customize Appearance:
    • Fill Color: Choose a color that represents the stat value filling up the bar.
    • Background Color: Select a background color for the stat bar to enhance visibility and contrast.

These elements are critical for creating a responsive and informative HUD that keeps players well-informed about their character’s health and stamina levels in real-time, enhancing gameplay immersion and decision-making.