Item System Software Architecture Description - wwestlake/Steamforge GitHub Wiki

📦 Item System Software Architecture Description

Purpose

To define the software architecture of the item system in Steamforge, with focus on modularity, lore/data separation, multiplayer integrity, and extensibility.


1. 🎯 Core Design Principles

  • Server Authority: All item creation, manipulation, and destruction occurs on the server.
  • Data-Driven: Items, crafting rules, categories, and visual assets are defined entirely via DataTables.
  • Blueprint-Ready: Non-programmers can use and extend the system via Blueprint scripting.
  • Lore-Neutral Core: No hardcoded item names, categories, or crafting contexts in C++.
  • Secure in Multiplayer: Clients cannot instantiate or tamper with item data directly.

2. 📐 Major Subsystems

Subsystem Role
UItemSystemComponent Root component managing item creation, validation, and routing
AItemActor Physical world representation of an item
FItemDefinitionRow Struct defining all core item data in DataTable
FCraftingRecipeRow Struct defining recipes and crafting rules
FItemInstanceData Optional struct for per-instance state (e.g. durability)
UInventoryComponent Modular component for holding items, saving/loading, stack logic
ItemCreationService Server-only logic for validating item spawn requests

3. 📋 DataTables and Structs

FItemDefinitionRow

Field Type Description
Name FName Unique ID for the item (RowName)
DisplayName FText Localized item name
Tags FGameplayTagContainer Gameplay behavior modifiers
StackSize int32 Max stack size
Weight float Unit weight
Mesh TSoftObjectPtr<UStaticMesh> Optional visual
Icon FSlateBrush Icon for UI
bIsEquippable bool If true, can be equipped

FCraftingRecipeRow

Field Type Description
Inputs TArray<FItemQuantity> Required item inputs
Outputs TArray<FItemQuantity> Items created
CraftingContext FGameplayTag Station or context required
CraftTime float Time in seconds

4. 🔒 Server Authority Model

  • Clients may request crafting or spawning via RPC.
  • Server validates:
    • Context
    • Resources
    • Crafting eligibility
  • Server then:
    • Creates instance (if applicable)
    • Updates inventory or spawns actor
    • Replicates result to client(s)

Clients never:

  • Create new items directly
  • Modify inventories
  • Alter item metadata

5. 🌍 Modding & Internationalization

  • All item names, descriptions, and categorization are stored in DataTables
  • DataTables support localization using FText
  • Community mods can:
    • Add new item rows
    • Inject new recipes
    • Define custom categories and tags

No source code changes required.


6. 🧰 Utility & Support Systems

  • UCoreUtilityLibrary for Blueprint-accessible formatting (e.g., time, weight, stack counts)
  • Debug admin tools for spawning/testing
  • Integration hooks for SaveGame serialization

7. 🔮 Future-Proofing

  • Durability and per-item state via FItemInstanceData
  • Equipment support for characters/mounts
  • Custom crafting stations with dynamic behavior
  • Scriptable loot generation
  • Secure trading system between players