Object Management Subsystem ‐ Technical Specification - wwestlake/Steamforge GitHub Wiki
The Object Management Subsystem is a centralized system responsible for managing all game objects (excluding NPCs). It provides functionality to spawn, track, save, and load objects in the game world and inventories. This system is implemented as a UGameInstanceSubsystem
and extended in Blueprints.
Defines a blueprint or template for instantiating an object.
struct FObjectDescriptor {
FName DescriptorID;
FText DisplayName;
FText Description;
TSubclassOf<AActor> ActorClass;
UStaticMesh* Mesh;
UTexture2D* Icon;
FGameplayTagContainer Tags;
};
An in-world or inventory instance of an object.
struct FObjectEntity {
FGuid InstanceID;
FName DescriptorID;
FTransform Transform;
EObjectState State; // Placed, Inventory, Dropped
};
enum class EObjectState : uint8 {
Placed,
Inventory,
Dropped
};
A component that allows an actor to hold items.
struct FInventorySlot {
FName DescriptorID;
int32 Quantity;
};
class UInventoryComponent : public UActorComponent {
TArray<FInventorySlot> InventorySlots;
};
Simulates loot drops from destructible objects.
struct FLootSlot {
FName DescriptorID;
float DropChance;
int32 MinCount;
int32 MaxCount;
};
class ULootGeneratorComponent : public UActorComponent {
TArray<FLootSlot> LootTable;
};
Defines metadata and result for each recipe.
Column | Type | Description |
---|---|---|
RecipeID | FName | Unique identifier for the recipe |
DisplayName | FText | Name shown in UI |
Description | FText | UI description |
CraftingStationTag | GameplayTag | Tag required to craft (e.g. Campfire) |
CategoryTags | GameplayTagContainer | UI category filters |
OutputItemDescriptorID | FName | ID of resulting item descriptor |
OutputQuantity | int32 | Number of items produced |
Links ingredients to recipes.
Column | Type | Description |
---|---|---|
RecipeID | FName | Links to recipe in definition table |
ObjectDescriptorID | FName | Required item descriptor ID |
Quantity | int32 | Quantity of the item required |
- Load all
ObjectDescriptors
at game start. - Spawn
ObjectEntity
instances in the world or into inventories. - Track object state and location.
- Handle save/load functionality.
- Maintain items and quantities.
- Accept items from drops.
- Communicate with Object Management System on item acquisition and removal.
- Drop items on destruction.
- Communicate drops to Object Management System.
- Check inventory for ingredients.
- Consume ingredients.
- Create output item and notify Object Management System.
This specification defines the baseline for implementing an extensible and modular object and inventory system integrated with the world state.