ARPG Item and Inventory system

System overview

The goal of the project is to make a reusable system that can spawn items and manage them in an inventory. Items have to be generated from data tables to be fully customizable, with GAS (Gameplay Ability System) attributes that can be applied to the player. The Architecture is composed of:

  • Inventory component, managing items owned by the player
  • Equipment component managing item equipped with attributes that are applied to the player
  • Inventory widgets
  • Inventory manager that links Inventory/Equipment component with the Inventory UI. It listens to events from the UI to update components and then refresh widgets

This architecture allow the separation of the logic located in components from the visuals. Items are represented with the following structures:

  • Item base, which contains all the data needed to generate an item, like his name, type and possibles attributes that can be rolled.
  • Item instance, which is the generated item with rolled attributes
  • Inventory entry contains item instance data needed for the inventory, like their quantity
  • World Item that are actor representing an item in the world with their location

Inventory UI

To generate an item, there is a subsystem that load a data table containing possible item bases. It picks an item base and then generates a random number of rolled attributes based on attributes templates present in the item base. To roll an attribute value, the generator picks a random value between a minimum and maximum value stored in the attribute template. Finally, it spawns the item in the world and create its widget.

Possible Item Bases Data Table

ARPG Combat Framework

Attributes and abilities implementation

The foundation of an ARPG combat system is characters with attributes defining combat behavior (health, damage, mana, etc.) and abilities using these attributes. The next steps to make a complete ARPG should be to implement non player character AI, an item/inventory system and procedural map generation for replayability.

The main focus is to have attributes and abilities that can be easily added and modified, since ARPG can contain hundreds or more of them. Attributes are grouped into data tables and applied through tags possessed by abilities.

Attribute system:

Attributes are associated with tags that define conditions under which attributes are applied. They are grouped in data tables based on their mechanics. Damage modifiers are grouped by how they affect the final damage calculation

  • Added damage
  • Additive damage multiplier
  • Multiplicative damage multiplier

Additive damage modifier data table

It replicates Path of Exile damage modifier system. It allows to apply these modifiers by adding them to their corresponding data table without implementing them. Modifier with specific mechanics (e.g. projectile count, attack speed) are stored in their own data table to be easily accessible, where new ones will require an implementation

Ability system:

Abilities can be created by deriving blueprint from the C++ base ability class, which will implement the core behavior of an ability (Shooting projectiles for projectile abilities). Abilities possess tags to specify which attributes should be applied (e.g. a fire projectile ability has fire and projectile tag so fire and projectile damage will be applied) that makes them easily customable.