You are viewing documentation for v1.1. Switch to current version โ†’

๐Ÿงฉ Registry Subsystem

Short Description

Game Instance subsystem that initializes and cleans up the Object Variable registry across world transitions.

Long Description

The registry subsystem listens for level removal and ensures Object Variables are cleaned up safely during world teardown. It is intended to run automatically and keeps the root registry in a sane state during map changes and editor workflows.

๐Ÿš€ Features

  • Initializes the registry on game instance startup.
  • Cleans registry entries when levels are removed.
  • Central location to extend registry lifecycle hooks.

๐Ÿ“š Usage Examples

// Typically registered via subsystem auto-discovery.
// You can still retrieve it if you need to extend behavior.
UGorgeousObjectVariableRegistry_GIS* RegistrySubsystem = GameInstance->GetSubsystem<UGorgeousObjectVariableRegistry_GIS>();

Access the subsystem from Get Game Instance Subsystem when you need to inspect registry state.

Initialize

Prepares registry state when the Game Instance starts, including binding cleanup handlers.

Parameter Name Type Description
Collection FSubsystemCollectionBase& Subsystem collection used for dependency ordering.
void UGorgeousObjectVariableRegistry_GIS::Initialize(FSubsystemCollectionBase& Collection)
{
    Super::Initialize(Collection);
    // custom hooks
}

Deinitialize

Releases registry bindings and prepares for shutdown.

void UGorgeousObjectVariableRegistry_GIS::Deinitialize()
{
    Super::Deinitialize();
}

Best Practices

  • Extend this subsystem only when you need global registry lifecycle hooks.
  • Avoid heavy logic in OnLevelRemoved; keep cleanup fast.

Troubleshooting

  • If registry entries persist after map changes, confirm the subsystem is enabled in the Game Instance.
  • If cleanup runs too late, check that level removal events are firing in your world setup.