Weapon Modifications Reference

Purpose

This document describes the data structures and runtime behavior of weapon modifications. It covers modification assets, runtime instances, socket attachment data, supported stat changes, and weapon-part compatibility rules.

Overview

Weapon modifications are separate assets that can be attached to firearms to change their visuals and gameplay stats. At runtime, each weapon stores an array of active modifications in its dynamic data (S_DynamicWeapon_2Modifications). Each modification has:

  • a reference to the modification data asset,
  • information about which weapon socket is used,
  • transform relative to that socket,
  • a reference to the spawned mesh component,
  • information about rotation constraints (if any),
  • contribution to the weapon’s realtime stats.

Final weapon stats, including all modification effects, are stored in RealTimeWeaponStats.

Runtime Structures

S_DynamicWeapon_2 (Weapon Runtime Data)

Fields relevant to modifications:

  • Modifications — array of S_Modif_DynamicInfo.
  • RealTimeWeaponStatsS_RealTimeWeaponStats, final weapon stats after applying all modifications and buffs.

S_Modif_DynamicInfo

S_Modif_DynamicInfo represents a single runtime modification instance attached to a weapon.

Fields:

  • Modification DataBP_Modif_W_Data_Master
    Reference to the modification data asset that defines type, visuals, and stat changes.

  • Sockets ContainerF_ModifSocketsContainer
    Data about sockets on the weapon that this modification can use.

  • Transform From SocketTransform
    Transform applied on top of the chosen socket. Controls position, rotation, and scale of the modification mesh relative to the weapon.

  • Used Socket Indexint
    Index of the socket within Sockets Data chosen for this modification instance.

  • Static Mesh ReferenceSceneComponent
    Reference to the spawned component that represents the modification mesh on the weapon.

F_ModifSocketsContainer

F_ModifSocketsContainer describes the possible sockets for this modification and how it can be rotated.

Fields:

  • Sockets Data — array of DataTableRowHandle
    Each row handle points to socket configuration in a data table. This allows a modification to support multiple sockets or positions on the weapon.

  • CanBeRotatedE_RotAxis
    Defines allowed rotation axes for the modification.

Modification Data Assets

BP_Modif_W_Data_Master

BP_Modif_W_Data_Master is the base data asset for weapon modifications. Concrete modification types should inherit from this master asset.

Responsibilities include:

  • defining modification type (scope, silencer, clip, grip, flashlight, etc.),
  • specifying allowed weapon parts and sockets,
  • defining visual assets (static mesh, materials),
  • defining stat changes (rate of fire, damage, accuracy, etc.),
  • configuring audio/FX overrides where applicable (for example, silencer shot sound).

Each modification asset must be compatible with specific weapon parts as defined in the weapon data (Weapon Parts And Allowed Quantity Of Modifications).

Weapon Part Compatibility

Weapon Parts And Allowed Quantity Of Modifications

Weapon compatibility with modifications is defined by splitting the weapon into logical parts. Each part:

  • declares which modification types are allowed,
  • defines how many modifications can be installed on that part.

Common weapon parts:

  • Bracket_Right
  • Bracket_Left
  • Bracket_Upper
  • Silencer
  • Clip
  • Grip
  • Bracket_Lower

Examples:

  • Two different sights can be installed at the same time:

    • one on Bracket_Upper,
    • one on Bracket_Right.
  • Only silencer-type modifications can be installed on Silencer.

  • Only clip-type modifications can be installed on Clip.

  • Bracket_Lower can be limited to flashlight-type modifications.

This system allows multiple modifications of similar types while maintaining clear constraints per weapon part.

Instance Modifications

Instance Modifications define the default modifications a weapon starts with. When a weapon is first created or spawned, it can already have pre-installed modifications defined by its data.

These default modifications are represented as S_Modif_DynamicInfo entries in the weapon’s Modifications array and are processed by the same stat calculation logic as user-installed modifications.

UI Integration

Inventory and Weapon Panel

Weapon modifications are managed through the inventory UI.

  • Double-clicking a weapon icon opens the weapon details panel.
  • The weapon panel provides:
    • full weapon information,
    • a list of currently installed modifications,
    • a list of compatible modifications available in the inventory,
    • controls for installing, replacing, or removing modifications,
    • controls for changing the weapon skin.

When modifications or skins change, the weapon icon in the inventory is updated to reflect the new appearance.

Stat Modification Rules

Modifications can affect several weapon stats. All modification values are aggregated and applied to the base weapon stats to produce RealTimeWeaponStats.

Supported stat changes:

  • Rate Of Fire
    Unit: rounds per minute.
    Calculation rule: flat additive. All modification values are added to the base rate of fire.

  • Damage
    Unit: percent relative to base damage.
    Base weapon damage is treated as 100%. For example, a modification that adds +30% damage results in 130% of the base value.
    Calculation rule:
    FinalDamage = DefaultDamage + (DefaultDamage / 100) * Sum(DamageModValues)

  • Critical Damage
    Unit: percent relative to base critical damage.
    Calculation rule:
    FinalCritDamage = DefaultCritDamage + (DefaultCritDamage / 100) * Sum(CritDamageModValues)

  • Critical Damage Chance
    Unit: percentage points.
    Modifications can increase the critical hit chance. The aggregation rule (for example, sum with clamping) is defined by game design.

  • Range at which the bullet does not lose its killing power
    Unit: meters.
    Calculation rule: flat additive. All modification values are added to the base range.

  • Number of Bullets
    Unit: bullets per magazine/clip.
    Calculation rule: override using the maximum value among selected modifications. The modification with the highest “number of bullets” value defines the final magazine size.

  • Accuracy
    Unit: percent relative to base accuracy.
    Calculation rule:
    FinalAccuracy = DefaultAccuracy + Sum(AccuracyModValues)

All aggregated values are written into RealTimeWeaponStats and then used by the firearm system during shooting, damage calculation, and other gameplay logic.

Visual and Audio Overrides

Certain modification types can override weapon audiovisual behavior.

Examples:

  • A silencer modification can provide:
    • its own shot sound,
    • its own muzzle flash,
    • its own tracer settings.

These overrides replace or modify the default weapon effects when the modification is installed.

Other modification types (such as scopes or flashlights) may:

  • add or change meshes attached via sockets,
  • add UI elements (for example, custom crosshair or aim widgets),
  • change camera parameters (for example, scope zoom values and sensitivity).

Runtime Behavior Summary

  1. The weapon defines which parts it has and how many modifications each part can accept.
  2. Each modification asset defines its type, allowed parts/sockets, meshes, stat changes, and optional audiovisual overrides.
  3. At runtime, the weapon stores active modifications in the Modifications array (S_Modif_DynamicInfo).
  4. For each modification, the system:
    • selects a socket from Sockets Data,
    • applies Transform From Socket,
    • spawns a mesh component and stores it in Static Mesh Reference,
    • applies stat changes to build RealTimeWeaponStats.
  5. The UI allows the player to inspect and change modifications, and the inventory icon updates to match the current modification and skin configuration.
  • docs/systems/firearms/firearms-system.md — how weapon modifications affect firing, recoil, zoom, and damage.
  • docs/systems/inventory-equipment/inventory-and-equipment.md — modifications as inventory items and equipped attachments.
  • docs/systems/customization/character-customization.md — visual aspects of weapon skins and attachments.
  • docs/reference/reference-data-tables.md — item and modification entries in DT_ItemData and related tables.