Interaction and Items System

This document covers the core interaction pipeline and item actors in RPG Engine v6.
Doors, world puzzles, and vendor trading are documented separately.

Core Interaction Flow

BP_InteractComponent

BP_InteractComponent on BP_RPG_Character controls all world interaction:

  • Maintains a reference to the current interact target:
    • FoundActor_temp (Actor)
    • FoundComponent_temp (component)
  • Runs camera-based traces on a timer to detect interactable actors.
  • Uses the IA_Interact input action to trigger interaction on the current target.
  • Blocks interaction traces if the character has any tag from Forbidden Tags For Interacting (e.g. ladder/climb states).

InteractArea and camera traces

InteractArea is a capsule collision on the character:

  • Overlaps: WorldStatic, WorldDynamic, Pawn, Vehicle.
  • When an overlap begins:
    • A timer starts calling FindAnyInteractItemTrace at a rate defined by InteractTraceTimerRate.
  • When an overlap ends:
    • Check Overlapping Actors runs a SphereTraceMultiForObjects on the same channels.
    • If no objects are found, the timer is paused.
    • If objects remain, camera traces continue.

FindAnyInteractItemTrace:

  • Performs a LineTrace from the camera forward.
  • Uses InteractDistance (default 500) as length.
  • If the hit actor implements BPI_Interactables or BPI_MulticlassData, it becomes the current target.

Interaction widget

The interaction prompt uses WB_InteractInfo:

  • Stored as WB_InteractInfo on the component/character.
  • Initialized via BPI Initialize With Item Data Asset on the widget.
  • Shows the current item name/action text and input hint based on item data and BP_II_Master.InputActions.

Interaction Interfaces

Interactable actors are discovered by interfaces rather than by explicit class checks.

BPI_Interactables

Key points:

  • Implemented by most world item actors and special interaction actors.
  • Used for:
    • Custom prompt text (GetItemCustomInteractText).
    • Wardrobe point logic.
    • Telekinesis start/stop/can-throw and impulse data.
    • Damage widget locations and root meshes.
    • Destroying actors on the server after interaction.

Example method names:

  • ButtonReleased
  • InteractMessage
  • GetItemCustomInteractText
  • WardrobePoint
  • DestroyActor(Server)
  • TelekinesisStartMessage / TelekinesisStop / TelekinesisCanThrow
  • GetRootSkeletalMeshComponent
  • GetDamageWidgetLocation
  • and others.

BPI_MulticlassData

Key points:

  • Provides higher-level contextual data:
    • Actor type and indicator widget (GetActorType, GetObjectWidget).
    • Whether interaction is allowed (CanInteract).
    • Item data (GetItemData).
  • Drives previews and skins:
    • Mannequin equipment/skins and bags.
    • Weapon preview and modification preview.
    • Weapon skin preview updates on the mannequin.
  • Misc gameplay data:
    • Minimap display (DisplayedOnMinimap).
    • Temperature zone data.
    • Damage indicators and health.
    • Links back to mediator and main body component.

Any actor that implements BPI_Interactables or BPI_MulticlassData can become an interaction target.

BP_Inter_* Item Actor Hierarchy

World item actors are organized around BP_Inter_Master and its children.

BP_Inter_Master

Base world interactable item actor:

  • Implements BPI_Interactables and BPI_MulticlassData.
  • Main parameters:
    • Data AssetBP_ItemData (master item DataAsset).
    • Custom Interact Text — overrides default prompt text; if empty, default text comes from BP_II_Master.InputActions.

Meshes:

  • For pure BP_Inter_Master children, the StaticMesh is assigned manually in the Blueprint.
  • For BP_Inter_AutoInit children, mesh is taken from the Clarification-type DataAsset.

On pickup, BP_Inter_Master-derived actors are either destroyed or have their quantity reduced (see partial pickup below).

BP_Inter_AutoInit

Automatic initialization from item data:

  • Inherits from BP_Inter_Master.
  • Reads StaticMesh from the Clarification-type DataAsset (via BP_ItemData).
  • Has:
    • Quantity (int) — number of units contained.
    • Level Design Mode (bool):
      • Must be set to true after placing the actor in the level so initialization runs correctly.

Main children:

  • BP_Inter_Ammo
  • BP_Inter_Master_Quest
  • BP_Inter_Grenade
  • BP_Inter_Items_With_Skin
  • BP_Inter_WeapModif
  • BP_Inter_Buildable
  • BP_Inter_Ammo_Counter
  • BP_Int_Buff_Master

BP_Inter_Items_With_Skin and clothing/weapons

BP_Inter_Items_With_Skin:

  • Extends BP_Inter_AutoInit.
  • Adds:
    • SkinBP_DA_Skins DataAsset for visual customization.

Children:

  • BP_Inter_Master_Cloth:
    • Health (float).
    • UseCustomHealth (bool) — if true, uses this custom health value.
  • BP_Inter_Master_Weapon:
    • No extra parameters; uses weapon item data.

Firearms: BP_Inter_Master_FireWeapon

Child of BP_Inter_Master_Weapon with extra world-firearm parameters:

  • AMMO DataBP_ItemData of ammo type preloaded in the weapon.
  • AMMO Quantity — number of rounds in the world weapon.
  • UseInstancedModifications (bool) — initialize modifications from Clarification-type DataAsset.
  • Modifications User Setup — array of S_Modif_Static; designer-defined mods for this instance.
  • Modifications Final Engine — array of S_Modif_Static; final mod list, auto-populated.

Ammo and buff actors

  • BP_Inter_Ammo — standard ammo pickups, with Quantity determining how many units they contain.
  • BP_Inter_Ammo_Counter — child of BP_Inter_Ammo with extra Percent StaticMesh to visually show fill amount.
  • BP_Int_Buff_Master — world buff pickup; on pickup, applies to the buff/inventory system as the corresponding item.

BP_ItemData and registration

BP_ItemData is the master item DataAsset:

  • Holds references to:
    • General Info DataAsset.
    • Inventory-type DataAsset (grid size, stacking, InteractActorClass, etc.).
    • Clarification-type DataAsset (gameplay parameters, mesh, skins, effects).
  • All world item actors reference a BP_ItemData via their Data Asset variable.

All items are registered in DTItemData:

  • Each row corresponds to one item and points to its BP_ItemData.
  • Global top-level item categories include:
    • Ammo, Bag, Buff, Building, Cloth, CustomInteraction, Door, Grenade, Modification, Quest, Resource, Skin, Usable, Vehicle, Weapon, Other.

Loot and Inventory Integration

Normal pickup flow

For regular loot, classes such as:

  • BP_Inter_Ammo
  • BP_Inter_Master_Quest
  • BP_Inter_Grenade
  • BP_Inter_Items_With_Skin
  • BP_Inter_WeapModif
  • BP_Inter_Buildable
  • BP_Inter_Ammo_Counter
  • BP_Int_Buff_Master
  • BP_Inter_Master_Cloth
  • BP_Inter_Master_Weapon
  • BP_Inter_Master_FireWeapon

are used as interactable world actors.

Pickup logic:

  • Triggered via IA_Interact and BP_InteractComponent.
  • If the inventory can accept the item:
    • The request is forwarded to BP_EquipmentComponent, which calculates how many units can be added.
  • Three possible outcomes:
    1. Full pickup:
      • There is enough inventory space for the entire Quantity.
      • BP_EquipmentComponent adds the full amount.
      • The world actor is destroyed.
    2. Partial pickup:
      • Inventory has space for only part of the stack (e.g. 25 free slots, actor has 50 rounds).
      • BP_EquipmentComponent adds as many units as can fit (25).
      • The actor’s Quantity is decreased by that amount (from 50 to 25).
      • The world actor remains with reduced quantity.
    3. No space:
      • Nothing is added.
      • The actor remains in the world.
      • A “not enough inventory space” message is shown.

Inventory layout, stacking, and item categories are handled by BP_EquipmentComponent and DataAssets such as DAGSEquipment / DAGSInventory.

Usable Items

Usable items are items that can be applied to the character (e.g. eaten, drunk, used as a consumable).

Usage paths:

  1. From the world:
    • Approach a usable world actor (derived from BP_Inter_Master / BP_Inter_AutoInit).
    • Press IA_Interact / Use.
    • The world actor triggers its Use behavior.
  2. From inventory:
    • Right-click the item and choose Use.
    • One unit is removed from inventory.
    • The configured gameplay effect is applied (health, energy, hunger, thirst, buffs, etc.).

World usage is integrated into the state system:

  • Activates CharacterStates.UnusualSkills.Use.
  • In ActivateStateSolver, the system calls Client_UseFunctional to execute the item’s effect on the local character.

Effect details (stat changes, buff triggers, etc.) are configured in item DataAssets and described in inventory/stats documentation.

TelekFind (Fast Loot Gathering)

TelekFind is an UnusualSkill for quickly grabbing loot around the character.

Behavior:

  • Activated by holding the interaction key (IA_Interact) for a short time (~0.25 seconds).
  • Uses the same InteractArea collision as normal interaction to find nearby actors.
  • Processes only actors implementing BPI_Interactables.

For each found actor:

  • Attempts to add its item content via BP_EquipmentComponent (using the same partial/full logic as normal pickup).
  • If at least some amount fits:
    • That amount is added to inventory.
    • The actor’s Quantity is reduced by the added amount.
    • If quantity reaches zero, the actor is destroyed.
  • Items for which zero units can be accepted remain unchanged in the world.

TelekFind does not introduce its own weight or count limits; the only limiting factor is available inventory space.

NPC-Independent World Stations (brief)

Some world stations are built on the same interaction pipeline but are documented in their own system files. Here they are only referenced.

Wardrobe point

  • Actor: BP_EquipmentPoint.
  • Interaction:
    • BP_InteractComponent calls wardrobe-related interface functions.
    • PlayerController opens WBP_Wardrobe_Placeholder_InGame.
  • Affects:
    • Appearance (BPCharacterSkinComponent).
    • Equipment (BP_EquipmentComponent).

Wash (hygiene)

  • Actor: BP_Inter_WashM (child of BP_Inter_Master).
  • Interaction:
    • Adjusts the player’s Hygiene stat.
    • Plays wash AnimMontage on the shower’s SkeletalMesh.

Detailed behavior is described in customization and stats docs; interaction-wise these stations are just specialized BP_Inter_* actors.

Save System Integration (high level)

Interactable actors that must persist across sessions implement BPI_SaveSystem.

  • On load, all BPI_SaveSystem actors are removed.
  • The save subsystem then spawns only the actors recorded in save data (S_SaveContainer).
  • For generic interactable actors:
    • Class and transform are stored in FSaveCommonData.
    • Additional runtime data goes into FInteractActorSaveData.DynamicWorldData.
  • Doors, AI, vehicles, buildings and cameras have their own save structs, but their detailed behavior is covered in dedicated system docs.

This ensures that world items, interactables, and special actors (doors, NPCs, vehicles, etc.) can be restored consistently along with inventory and stats.

Interaction and items connect to:

  • docs/systems/interaction/interaction-and-items.md
  • docs/systems/interaction/doors-and-interactables.md
  • docs/systems/interaction/trading-and-vendors.md