Skip to content

Technical Debt

This document records known cleanup, refactor, and temporary implementation topics for Andromeda.

Keep descriptive walkthroughs focused on how the current code works. Put forward-looking cleanup notes here so temporary choices are visible without mixing plans into architecture explanations.

Enum Display Text Helpers

There are currently enum-to-display-text helper functions in more than one .cpp file.

Examples:

EAndromedaPackageCategory -> FText
EAndromedaHandlingSize    -> FText
EAndromedaHazardRating    -> FText

This caused a compile issue under Unreal unity builds. In a normal C++ build, functions in anonymous namespaces are private to their translation unit. Unreal unity builds can merge multiple .cpp files into one generated translation unit for faster compilation. If two merged files both define an anonymous-namespace function with the same name, the compiler can see two definitions in the same generated unit.

The current fix was to make the scan-widget helper names more specific:

GetScanWidgetPackageCategoryText
GetScanWidgetHandlingSizeText

That is build-safe, but it is not the desired long-term design.

Preferred refactor:

Create a small shared display-text helper under Source/Andromeda/Salvage.
Centralize enum display text conversion.
Use stable LOCTEXT keys for localization.
Update scan UI and salvage processing result text to use it.
Remove duplicated local helpers.

Possible shape:

namespace AndromedaSalvageText
{
    FText GetPackageCategoryText(EAndromedaPackageCategory Category);
    FText GetHandlingSizeText(EAndromedaHandlingSize Size);
    FText GetHazardRatingText(EAndromedaHazardRating HazardRating);
}

This should be done deliberately as a refactor, not mixed into unrelated gameplay work.

Prototype Debug Messages

Pickup and tagging currently use on-screen debug messages.

That is acceptable for early verification, but eventually:

player-facing feedback should be UI/audio
developer diagnostics should be logs
temporary on-screen debug should be removed or gated

Known current examples:

AAndromedaSalvageItem::Interact_Implementation
AAndromedaTaggingBench::UsePlacedItem

Drop Placement

Contextual drop currently places the item in front of the player at a fixed distance.

It does not yet:

sweep for blocking geometry
project to the floor
avoid clipping into walls
choose a clear nearby spot
play placement animation

This is acceptable for the vertical slice, but should be revisited once the room layout is more stable.

Package Presentation

Packaging is currently a state flag:

bPackageAssigned = true;

The item does not yet visually become a package, spawn a package actor, receive a label, or move into a package container. This is enough for the first loop, but the eventual game should make packaging physical and visible.

Likely future direction:

item placed at tagging bench
-> package category/size selected or confirmed
-> visual package/label appears
-> packaged item can be carried to warehouse

Save And Progression

The current item state is runtime-only.

Longer term, a shift/save system will need to persist:

which items spawned
which items were scanned
which packages were assigned
which warehouse outcomes occurred
credits/reputation/story flags

Do not prematurely build a full save system yet, but keep gameplay state ownership clear so it can be saved later.