Armor System (AS) Plugin
1. Overview
The Armor System (AS) plugin provides a data-driven framework for equippable armor pieces that protect characters from damage. It manages:
- Durability — Per-piece durability that degrades on impact and can be repaired.
- Quality Tiers — Discrete quality levels (e.g. Shoddy, Common, Fine, Masterwork, Legendary) that modify base stats.
- Material Properties — Each material (
UMaterialTypeDataAsset) defines penetration resistance, ricochet chance, spall generation, density, and brittleness. - Damage Interaction — Integrates with the central Damage System (
FDamageContext) to calculate mitigation. - Limb Coverage — Defines which limbs are protected via
FGameplayTagcoverage sets. - GAS Integration — Grants
UGameplayEffects&FGameplayTagcontainers when equipped. - Data-Driven — All archetypes, materials, and quality modifiers are defined in
UDataAssetclasses.
This plugin depends on the Damage System (DS) for shared types and the damage routing pipeline, and complements the Limb Health System (LHS) and Projectile System (PDS).
Class Diagram
2. Core Features
- Equippable Armor — Characters can equip/unequip armor to named slots (e.g., Head, Chest, Arms, Legs).
- Durability Management — Manages durability per armor instance.
CurrentDurabilityandMaxDurabilitytracked per piece.- Server-authoritative repair and break-on-zero logic.
- Quality Tiers — Leverages quality levels to modify armor properties.
- Uses
EItemInstanceQualityfromItemSystemTypes.h(DS). - Quality mappings adjust durability, weight, resistance, and passive effects.
- Uses
- Material-Based Interactions — Armor mitigation logic is influenced by material properties.
UMaterialTypeDataAssetdefines material factors (penetration, ricochet, spall).- Interacts with projectile data (
ERoundType,EProjectileTypefromDamageSystemTypes.h).
- Limb Coverage — Armor pieces define which body limbs they protect.
CoverageTagsin each archetype identify protected limbs via LHS tags (e.g.,Tag.Limb.Head).
- GAS Integration — Seamlessly integrates with the Gameplay Ability System.
- Grants passive effects (
UGameplayEffectclasses) and tags while equipped. - Effects are removed upon unequip.
- Grants passive effects (
- Data-Driven Design — Core armor properties are defined in Data Assets.
UArmorArchetypeDataAssetfor base stats, visuals, coverage, quality modifiers.UMaterialTypeDataAssetfor intrinsic material definitions.
3. Key C++ Classes & Data Assets
| Class / Asset | Type | Responsibility |
|---|---|---|
UArmorSystemComponent | UActorComponent | Manages equipped pieces, handles equip/unequip RPCs, processes ProcessDamageInteraction(FDamageContext&). |
FArmorPieceInstance | struct (ArmorSystemTypes.h) | Runtime data: archetype reference, quality, current/max durability, socket name, mesh component pointer. |
FEquippedArmorSlotInfo | struct (ArmorSystemTypes.h) | Helper struct: slot tag + FArmorPieceInstance, used in replication array. |
UArmorArchetypeDataAsset | UPrimaryDataAsset | Defines base stats (durability, thickness, weight), visuals, coverage tags, material, and quality mappings. |
UMaterialTypeDataAsset | UDataAsset | Defines material factors: PenetrationResistanceFactor, RicochetChanceMultiplier, SpallGenerationFactor, DensityKgm3, BrittlenessFactor. |
ArmorSystemTypes.h | Header | Declares FArmorPieceInstance, FEquippedArmorSlotInfo, any AS-specific enums/structs. |
Module Files:
IArmorSystemModule.h— public module interfaceArmorSystemModule.cpp— module startup/shutdownArmorSystem.Build.cs— declares dependencies (includes"DamageSystem")
4. Directory Structure
ArmorSystem/ ← Plugin root
└── Source/
└── ArmorSystem/ ← Module root
├── ArmorSystem.Build.cs
├── Public/
│ ├── IArmorSystemModule.h
│ ├── ArmorSystemTypes.h
│ ├── MaterialTypeDataAsset.h
│ ├── ArmorArchetypeDataAsset.h
│ └── ArmorSystemComponent.h
└── Private/
├── ArmorSystemModule.cpp
├── MaterialTypeDataAsset.cpp
├── ArmorArchetypeDataAsset.cpp
└── ArmorSystemComponent.cpp
Note:
ItemSystemTypes.h,DamageSystemTypes.h, andMyGameGameplayEffectContext.hare now owned by the DamageSystem plugin.
5. Integration Points
5.1 Damage System (DS)
-
Shared Types
ItemSystemTypes.hforEItemInstanceQuality,FStatModifier, etc.DamageSystemTypes.hforERoundType,EProjectileTypeFDamageContextstruct
-
Damage Routing
-
UDamageRouterComponentinvokesCPPArmorComponent->ProcessDamageInteraction(FDamageContext& Context, FGameplayTag HitLimbTag, FName HitBoneName); -
AS updates
Context.CurrentDamageToApply,Context.bArmorWasHit,Context.bArmorPenetrated,Context.DamageAbsorbedByArmor, etc.
-
5.2 Limb Health System (LHS)
- CoverageTags in
UArmorArchetypeDataAssetmust match LHS limb tags (e.g.,Tag.Limb.Chest) so that AS correctly identifies which limb a given hit affects.
5.3 Projectile System (PDS)
FDamageContextfields populated by PDS (mass, caliber, round type, behavior type) feed into AS’s mitigation calculations using material factors.
6. Setup & Usage Notes
-
Add Component
CPP// In your Character UPROPERTY(VisibleAnywhere) UArmorSystemComponent* ArmorComponent; -
Module Dependency
-
In
ArmorSystem.Build.cs:CSHARPPublicDependencyModuleNames.AddRange(new string[]{ "Core", "CoreUObject", "Engine", "GameplayTags", "GameplayAbilities", "DamageSystem" }); -
In
ArmorSystem.uplugin, add"DamageSystem"under"Plugins".
-
-
Data Asset Creation
-
Material Assets (
UMaterialTypeDataAsset): define material factors. -
Archetype Assets (
UArmorArchetypeDataAsset):- Assign
MaterialTypeDataAssetClass - Set
BaseMaxDurability,BaseArmorThicknessCm,BaseWeightKg - Configure
CoverageTags(FGameplayTagContainer of LHS limb tags) - Populate
QualityStatModifiers(using mappings fromItemSystemTypes.h)
- Assign
-
-
Equipping Logic
-
Implement inventory/equipment UI or code to call on server:
CPPArmorComponent->Server_EquipArmor(ArchetypeData, DesiredQuality, SlotTag); -
On unequip:
CPPArmorComponent->Server_UnequipArmor(SlotTag);
-
-
ProcessDamageInteraction
-
Override or extend to incorporate full ballistic logic:
CPPvoid UArmorSystemComponent::ProcessDamageInteraction( FDamageContext& Context, FGameplayTag HitLimbTag, FName HitBoneName ); -
Use
Context.ProjectileMassKg,Context.ProjectileCaliberMm,Context.ProjectileRoundTypewith material factors to compute:- Penetration chance
- Ricochet probability
- Spall energy
-
Update
Context.CurrentDamageToApplyand reduceCurrentDurability.
-