Skip to content

Salvage Data Model

The salvage data model separates authored item facts from runtime item state.

The authored data lives in:

UAndromedaSalvageItemData

The runtime actor is:

AAndromedaSalvageItem

The shared structs and enums live in:

AndromedaSalvageTypes.h

Enums

The current gameplay enums include:

EAndromedaHazardRating
EAndromedaSalvageProcessingAction
EAndromedaSalvageProcessingState
EAndromedaPackageCategory
EAndromedaHandlingSize

They are UENUM(BlueprintType) because the editor and Blueprints need to expose them in Data Assets and class defaults.

The difference between action and state is important:

Action = what the player/system tries to do.
State  = what happened to the item afterward.

Example:

Action: Sell
State: Sold

AssignPackage is an action but not a final processing state. Packaging is an intermediate handling step.

Structs

FAndromedaScanProfile contains scanner-facing information:

hazard rating
radiation summary
mass summary
serial summary
hidden scan note

FAndromedaPackageRequirement describes how an item should be packaged:

category: Normal / Quarantine / Freezer / Radiation
minimum size: XS / S / M / L / XL / XXL
required vs recommended
handling note

FAndromedaProcessingRule describes a final action result:

action
allowed?
payout
result title
result description

FAndromedaScanResult and FAndromedaProcessingResult are runtime result structs used by UI.

Data Asset

UAndromedaSalvageItemData is a UPrimaryDataAsset. It gives each salvage item authored metadata without requiring a new C++ class per item.

For example, DA_DamagedReactorCoil can define:

Item Name
Manifest Claim
Legal Requirement
Scan Profile
Package Requirement
Processing Rules

Changing those values changes scan output and processing behavior without changing C++.

Runtime Item State

AAndromedaSalvageItem stores runtime state:

ProcessingState
bPackageAssigned
bScanned
CachedScanResult
HeldBy
CurrentStation

These are not authored facts. They are what happened to this item instance during play.

ScanItem

The scanner calls:

PlacedItem->ScanItem();

ScanItem builds a scan result from the Data Asset, caches it, and marks the item scanned if the result is valid:

BuildScanResult
-> CachedScanResult
-> bScanned = CachedScanResult.bValidResult

The cached scan result matters because the design wants the information panel to be available for that item after scanning.

AssignRequiredPackage

Packaging is not allowed until after scanning.

AssignRequiredPackage rejects:

item has no data
item is already processed
item has not been scanned

If the item is already packaged, it returns an accepted "already assigned" result. If not, it sets:

bPackageAssigned = true;

The result text includes package category and size.

ProcessSalvage

Final processing happens in warehouse zones, not in the scanner.

ProcessSalvage(Action) looks for a matching processing rule in the Data Asset. If a valid allowed rule is found, it:

builds processing result
applies processing state
disables item interaction
fires OnProcessed

Disabling interaction prevents the item from re-entering the active handling loop after it has been sold, quarantined, or otherwise finalized.