Skip to content
Tuxedo CatSTUDIO
Menu

V1 workflow examples

Review draft. This source page has not completed website editorial and release-specific verification.

The snippets below use the current public APIs and the frozen V1 contracts.

Get the subsystem with Get Game Instance Subsystem. Call Save Game to Slot (Checkpoint_01, user 0). Branch on bool; inspect OperationResult.

Call Load Game from Slot with the same name/index. Handle false for missing, invalid, or failed restore and show the result message.

FSaveGameDirectorSaveRequest Request;
Request.Slot = FSaveGameDirectorSlotIdentifier(TEXT("Checkpoint_01"), 0);
FSaveGameDirectorOperationResult Result;
const bool bSaved = Director->SaveToSlot(Request, Result);
FSaveGameDirectorLoadRequest Request;
Request.Slot = FSaveGameDirectorSlotIdentifier(TEXT("Checkpoint_01"), 0);
FSaveGameDirectorOperationResult Result;
const bool bLoaded = Director->LoadFromSlot(Request, Result);

Call SaveToMemory(SaveRequest, MemoryData, Result), retain the USaveGameDirectorSaveGame, then LoadFromMemory(LoadRequest, MemoryData, Result). Blueprint equivalents are Save Game to Memory and Load Game from Memory.

Call SaveToSlotAsync(Request, Completion); completion receives final result on the game thread. Blueprint: Save Game to Slot Async, bind Completed and Failed.

Call LoadFromSlotAsync(Request, Completion) or Blueprint Load Game from Slot Async; inspect result in either terminal event.

In Blueprint add Save Game Director Actor Component. In C++, use CreateDefaultSubobject<USaveGameDirectorComponent>(TEXT("SaveGameDirector")) in the Actor constructor.

Set capture mode to SaveGameProperties and mark eligible reflected fields with Unreal SaveGame. The component’s capture flags also control transform and supported owned components.

Ensure the saved Actor class and stable component ID are valid, and policy permits RespawnIfMissing/automatic runtime recreation. Load through the subsystem. Core does not reconstruct arbitrary UObject graphs.

Select RecordTombstone when destruction should persist. Destroying the Actor records absence so an older present record will not respawn it.

Implement ISaveGameDirectorContributor methods: IDs, provider, schema, requirement, phase/priority, CapturePayload, ValidateRestorePayload, RestorePayload. See the complete implementation in Contributor Guide.

Implement ISaveGameDirectorContributorFactory; CreateContributor(UGameInstance&) returns a new instance. Register/unregister the persistent factory object in module Startup/Shutdown.

Return Required from GetRequirement(). A missing corresponding record fails load before Actor restoration.

Return Optional. An absent record is allowed and results in no callback with fake/empty data.

Serialize the contributor’s defined state into OutPayload; return false and set OutError when capture cannot produce a valid payload.

Implement ValidateRestorePayload(Payload, SchemaVersion, OutError) as a non-mutating parse/validation step. Core requires schema equality first.

Return BeforeActorRestore to establish global state that Actor restoration needs.

The API exposes AfterActorCreationBeforeProperties, AfterActorPropertyRestore, and FinalPostRestore. The first runs after eligible runtime Actors have been created and registered but before saved Actor properties are applied. Use AfterActorPropertyRestore for work that depends on restored Actor properties, and FinalPostRestore for final coordination. See Restore lifecycle.

Return a deterministic integer from GetRestorePriority(); lower priorities run first within phase. Equal priorities use deterministic identity ordering.

A currently registered Required contributor missing from the document yields status RequiredContributorMissing. The result identifies that contributor; no Actor restore is started.

A currently registered Optional contributor with no record is accepted silently; no payload is fabricated.

Saved/current version mismatch for a known contributor fails before validation/restore. Do not attempt coercion.

A saved Optional record with no current factory/contributor is warned and skipped.

A saved Required record with no current contributor fails restore; enable the product that owns it.

Configure interval/rotation, remove active blocker IDs when safe, then call StartAutosave(). Query IsAutosaveRunning(); submit one immediate operation with TriggerAutosaveNow().

Set Request.bAllowOverwrite. With backup setting enabled, existing slot contents are first written to <Slot>.SaveGameDirectorBackup.<UserIndex>; backup failure fails the new save.

For canonical WorldState persistence, provide the authoritative World State plugin in the host and enable the optional DirectorBridge integration, then confirm WorldState.SaveGame is Active. SaveGame Director does not bundle World State. Its core remains standalone; its contributor API, ContributorSchema policy, Required/Optional semantics, and restore lifecycle are unchanged. Payload migration remains future V1.1 work.

For sync calls check bool and result. For async check both terminal events. Inspect status/severity/messages/warnings/timing and subsystem diagnostics. SuccessWithWarnings is still success.

Bad SGDR magic, truncated bytes, bad CRC, malformed records, or unsupported future versions are rejected with structured status/errors. Keep original bytes for diagnosis.

V1 accepts only exact contributor schema equality. General contributor migration is deferred to V1.1. Change payload schema only with a product compatibility plan.