/ue-serialization-savegames
Use when implementing save/load systems, player progress persistence, or data serialization in Unreal Engine. Triggers on: save game, USaveGame, FArchive, serialization, SaveGameToSlot, config, persist data, save file, load game. See references/save-system-architecture.md for
$ npx -y skills add quodsoler/unreal-engine-skills --skill ue-serialization-savegames --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/ue-serialization-savegames
Context preview
The summary Claude sees to decide when to auto-load this skill.
Use when implementing save/load systems, player progress persistence, or data serialization in Unreal Engine. Triggers on: save game, USaveGame, FArchive, serialization, SaveGameToSlot, config, persist data, save file, load game. See references/save-system-architecture.md for
SKILL.md
ue-serialization-savegames.SKILL.mdname: ue-serialization-savegames
description: "Use when implementing save/load systems, player progress persistence, or data serialization in Unreal Engine. Triggers on: save game, USaveGame, FArchive, serialization, SaveGameToSlot, config, persist data, save file, load game. See references/save-system-architecture.md for full slot management and multi-user patterns."
metadata:
version: 1.0.0
UE Serialization & Save Games
You are an expert in Unreal Engine's serialization and save game systems. You implement save/load pipelines using `USaveGame`, `FArchive`, config files, and versioning so player progress persists correctly across sessions and game updates.
---
Step 1: Read Project Context
Read `.agents/ue-project-context.md` before giving any recommendations. You need:
- Engine version (UE 5.0+ has `ULocalPlayerSaveGame`; earlier versions differ)
- Module names (the save system lives in a specific module)
- Target platforms (console vs. PC save paths and user indices differ)
- Whether multiplayer is in scope (server-authoritative vs. client-local saves)
If the file does not exist, ask the user to run `/ue-project-context` first.
---
Step 2: Gather Requirements
Ask before writing code: 1. **Save complexity**: Simple key/value data, or complex world state with hundreds of objects? 2. **Data types**: Primitives, nested structs, asset references (soft vs. hard)? 3. **Versioning needs**: Live game with future patches? Old saves must keep working? 4. **Multiple save slots**: How many? Does each player/user get their own? 5. **Async requirement**: Can save/load stall the game thread, or must it be background?
---
Step 3: USaveGame Subclass
`USaveGame` is an abstract `UObject` from `GameFramework/SaveGame.h`. Subclass it and mark fields with `UPROPERTY(SaveGame)` for automatic tagged serialization by `UGameplayStatics`.
// MyGameSaveGame.h
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/SaveGame.h"
#include "MyGameSaveGame.generated.h"
USTRUCT(BlueprintType)
struct FInventoryItemData
{
GENERATED_BODY() // Required — missing GENERATED_BODY() breaks struct serialization silently
UPROPERTY(SaveGame) FName ItemID;
UPROPERTY(SaveGame) int32 Quantity = 0;
UPROPERTY(SaveGame) bool bIsEquipped = false;
};
UCLASS(BlueprintType)
class MYGAME_API UMyGameSaveGame : public USaveGame
{
GENERATED_BODY()
public:
UPROPERTY(SaveGame) int32 SaveVersion = 0; // Always include a version field
UPROPERTY(SaveGame) float PlayerHealth = 100.f;
UPROPERTY(SaveGame) int32 PlayerLevel = 1;
UPROPERTY(SaveGame) FVector LastCheckpointLocation = FVector::ZeroVector;
UPROPERTY(SaveGame) FString PlayerDisplayName;
UPROPERTY(SaveGame) float TotalPlayTimeSeconds = 0.f;
UPROPERTY(SaveGame) TArray<FInventoryItemData> InventoryItems;
UPROPERTY(SaveGame) TMap<FName, int32> AbilityLevels;
// TSet<FName> is also supported in UPROPERTY(SaveGame) fields and serializes/deserializes automatically.
// Asset references: FSoftObjectPath stores a string path — safe across saves
// Never use raw UObject* or hard TObjectPtr<> to content assets in save data
UPROPERTY(SaveGame) FSoftObjectPath LastEquippedWeaponPath;
};Saving and Loading
#include "Kismet/GameplayStatics.h"
static const FString SlotName = TEXT("MainSave");
static constexpr int32 UserIdx = 0; // Always 0 on PC; use GetPlatformUserIndex() on console
// Create the object first, populate its fields, then save
UMySaveGame* SaveGame = Cast<UMySaveGame>(UGameplayStatics::CreateSaveGameObject(UMySaveGame::StaticClass()));
SaveGame->PlayerHealth = 75.f;
// Then pass SaveGame to SaveGameToSlot / AsyncSaveGameToSlot below
// Sync save (blocks game thread — avoid in gameplay)
bool bSaved = UGameplayStatics::SaveGameToSlot(SaveData, SlotName, UserIdx);
// Async save (preferred — does not block)
FAsyncSaveGameToSlotDelegate OnSaved;
OnSaved.BindUObject(this, &USaveManager::OnAsyncSaveComplete);
UGameplayStatics::AsyncSaveGameToSlot(SaveData, SlotName, UserIdx, OnSaved);
// Load
if (UGameplayStatics::DoesSaveGameExist(SlotName, UserIdx))
{
UMyGameSaveGame* Save = Cast<UMyGameSaveGame>(
UGameplayStatics::LoadGameFromSlot(SlotName, UserIdx));
}
// Async load
FAsyncLoadGameFromSlotDelegate OnLoaded;
OnLoaded.BindUObject(this, &USaveManager::OnAsyncLoadComplete);
UGameplayStatics::AsyncLoadGameFromSlot(SlotName, UserIdx, OnLoaded);
// Delete
UGameplayStatics::DeleteGameInSlot(SlotName, UserIdx);---
Step 4: ULocalPlayerSaveGame (UE 5.0+)
`ULocalPlayerSaveGame` ties a save to a specific local player, tracks versioning via `GetLatestDataVersion()`, and provides `HandlePostLoad()` for migrations.
UCLASS()
class MYGAME_API UMyLocalPlayerSave : public ULocalPlayerSaveGame
{
GENERATED_BODY()
public:
virtual int32 GetLatestDataVersion() const override { return 3; }
virtual void HandlePostLoad() override;
UPROPERTY(SaveGame) TMap<FName, int32> UnlockedAbilities;
};
void UMyLocalPlayerSave::HandlePostLoad()
{
Super::HandlePostLoad();
const int32 Ver = GetSavedDataVersion(); // version when last saved
if (Ver < 2) { UnlockedAbilities.Add(TEXT("Dash"), 1); }
// Ver < 3 migrations go here
}// Load or create (sync)
UMyLocalPlayerSave* Save = ULocalPlayerSaveGame::LoadOrCreateSaveGameForLocalPlayer(
UMyLocalPlayerSave::StaticClass(), PlayerController, TEXT("PlayerSlot0"));
// Load or create (async)
ULocalPlayerSaveGame::AsyncLoadOrCreateSaveGameForLocalPlayer(
UMyLocalPlayerSave::StaticClass(), PlayerController, TEXT("PlayerSlot0"),
FOnLocalPlayerSaveGameLoadedNative::CreateUObject(this, &AMyPC::OnSaveLoaded));
// Save back
Save->AsyncSaveGameToSlotForLocalPlayer(); // async (preferred)
Save->SaveGameToSlotForLocalPlayer(); // sync---
Step 5: FArchive and Custom Serialization
`FArchive` (from `Serialization/Archive.h`) is the ba
Read more
name: ue-serialization-savegames description: "Use when implementing save/load systems, player progress persistence, or data serialization in Unreal Engine. Triggers on: save game, USaveGame, FArchive, serialization, SaveGameToSlot, config, persist data, save file, load game. See references/save-system-architecture.md for full slot management and multi-user patterns." metadata: version: 1.0.0
UE Serialization & Save Games
You are an expert in Unreal Engine's serialization and save game systems. You implement save/load pipelines using `USaveGame`, `FArchive`, config files, and versioning so player progress persists correctly across sessions and game updates.
---
Step 1: Read Project Context
Read `.agents/ue-project-context.md` before giving any recommendations. You need:
- Engine version (UE 5.0+ has `ULocalPlayerSaveGame`; earlier versions differ)
- Module names (the save system lives in a specific module)
- Target platforms (console vs. PC save paths and user indices differ)
- Whether multiplayer is in scope (server-authoritative vs. client-local saves)
If the file does not exist, ask the user to run `/ue-project-context` first.
---
Step 2: Gather Requirements
Ask before writing code: 1. **Save complexity**: Simple key/value data, or complex world state with hundreds of objects? 2. **Data types**: Primitives, nested structs, asset references (soft vs. hard)? 3. **Versioning needs**: Live game with future patches? Old saves must keep working? 4. **Multiple save slots**: How many? Does each player/user get their own? 5. **Async requirement**: Can save/load stall the game thread, or must it be background?
---
Step 3: USaveGame Subclass
`USaveGame` is an abstract `UObject` from `GameFramework/SaveGame.h`. Subclass it and mark fields with `UPROPERTY(SaveGame)` for automatic tagged serialization by `UGameplayStatics`.
// MyGameSaveGame.h
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/SaveGame.h"
#include "MyGameSaveGame.generated.h"
USTRUCT(BlueprintType)
struct FInventoryItemData
{
GENERATED_BODY() // Required — missing GENERATED_BODY() breaks struct serialization silently
UPROPERTY(SaveGame) FName ItemID;
UPROPERTY(SaveGame) int32 Quantity = 0;
UPROPERTY(SaveGame) bool bIsEquipped = false;
};
UCLASS(BlueprintType)
class MYGAME_API UMyGameSaveGame : public USaveGame
{
GENERATED_BODY()
public:
UPROPERTY(SaveGame) int32 SaveVersion = 0; // Always include a version field
UPROPERTY(SaveGame) float PlayerHealth = 100.f;
UPROPERTY(SaveGame) int32 PlayerLevel = 1;
UPROPERTY(SaveGame) FVector LastCheckpointLocation = FVector::ZeroVector;
UPROPERTY(SaveGame) FString PlayerDisplayName;
UPROPERTY(SaveGame) float TotalPlayTimeSeconds = 0.f;
UPROPERTY(SaveGame) TArray<FInventoryItemData> InventoryItems;
UPROPERTY(SaveGame) TMap<FName, int32> AbilityLevels;
// TSet<FName> is also supported in UPROPERTY(SaveGame) fields and serializes/deserializes automatically.
// Asset references: FSoftObjectPath stores a string path — safe across saves
// Never use raw UObject* or hard TObjectPtr<> to content assets in save data
UPROPERTY(SaveGame) FSoftObjectPath LastEquippedWeaponPath;
};Saving and Loading
#include "Kismet/GameplayStatics.h"
static const FString SlotName = TEXT("MainSave");
static constexpr int32 UserIdx = 0; // Always 0 on PC; use GetPlatformUserIndex() on console
// Create the object first, populate its fields, then save
UMySaveGame* SaveGame = Cast<UMySaveGame>(UGameplayStatics::CreateSaveGameObject(UMySaveGame::StaticClass()));
SaveGame->PlayerHealth = 75.f;
// Then pass SaveGame to SaveGameToSlot / AsyncSaveGameToSlot below
// Sync save (blocks game thread — avoid in gameplay)
bool bSaved = UGameplayStatics::SaveGameToSlot(SaveData, SlotName, UserIdx);
// Async save (preferred — does not block)
FAsyncSaveGameToSlotDelegate OnSaved;
OnSaved.BindUObject(this, &USaveManager::OnAsyncSaveComplete);
UGameplayStatics::AsyncSaveGameToSlot(SaveData, SlotName, UserIdx, OnSaved);
// Load
if (UGameplayStatics::DoesSaveGameExist(SlotName, UserIdx))
{
UMyGameSaveGame* Save = Cast<UMyGameSaveGame>(
UGameplayStatics::LoadGameFromSlot(SlotName, UserIdx));
}
// Async load
FAsyncLoadGameFromSlotDelegate OnLoaded;
OnLoaded.BindUObject(this, &USaveManager::OnAsyncLoadComplete);
UGameplayStatics::AsyncLoadGameFromSlot(SlotName, UserIdx, OnLoaded);
// Delete
UGameplayStatics::DeleteGameInSlot(SlotName, UserIdx);---
Step 4: ULocalPlayerSaveGame (UE 5.0+)
`ULocalPlayerSaveGame` ties a save to a specific local player, tracks versioning via `GetLatestDataVersion()`, and provides `HandlePostLoad()` for migrations.
UCLASS()
class MYGAME_API UMyLocalPlayerSave : public ULocalPlayerSaveGame
{
GENERATED_BODY()
public:
virtual int32 GetLatestDataVersion() const override { return 3; }
virtual void HandlePostLoad() override;
UPROPERTY(SaveGame) TMap<FName, int32> UnlockedAbilities;
};
void UMyLocalPlayerSave::HandlePostLoad()
{
Super::HandlePostLoad();
const int32 Ver = GetSavedDataVersion(); // version when last saved
if (Ver < 2) { UnlockedAbilities.Add(TEXT("Dash"), 1); }
// Ver < 3 migrations go here
}// Load or create (sync)
UMyLocalPlayerSave* Save = ULocalPlayerSaveGame::LoadOrCreateSaveGameForLocalPlayer(
UMyLocalPlayerSave::StaticClass(), PlayerController, TEXT("PlayerSlot0"));
// Load or create (async)
ULocalPlayerSaveGame::AsyncLoadOrCreateSaveGameForLocalPlayer(
UMyLocalPlayerSave::StaticClass(), PlayerController, TEXT("PlayerSlot0"),
FOnLocalPlayerSaveGameLoadedNative::CreateUObject(this, &AMyPC::OnSaveLoaded));
// Save back
Save->AsyncSaveGameToSlotForLocalPlayer(); // async (preferred)
Save->SaveGameToSlotForLocalPlayer(); // sync---
Step 5: FArchive and Custom Serialization
`FArchive` (from `Serialization/Archive.h`) is the ba
A collection of 27 AI agent skills for Unreal Engine C++ development. Built for game developers who want AI coding agents to help write correct, production-quality UE5 C++ code.
Other skills on unreal-engine-skills.
- /ue-actor-component-architecture
Use this skill when working with Actor and component design in Unreal Engine. Triggers on: Actor, component, BeginPlay, Tick, SpawnActor, lifecycle, CreateDefaultSubobject, composition, EndPlay, PostInitializeComponents, UActorComponent, USceneComponent, UINTERFACE, attachment,
Open skill - /ue-ai-navigation
Use this skill when implementing AI, AIController, behavior tree, blackboard, AI perception, NavMesh, EQS, navigation, pathfinding, State Tree, or Smart Objects in Unreal Engine. See references/behavior-tree-patterns.md for BT patterns and references/eqs-reference.md for EQS
Open skill - /ue-animation-system
Use this skill when working with Unreal Engine animation: AnimInstance, montage playback, blend space, state machine, anim notify, IK, AnimGraph, skeletal mesh, or linked anim graphs. See references/anim-notify-reference.md for notify patterns and references/locomotion-setup.md
Open skill - /ue-async-threading
Use this skill when working with Unreal Engine async operations, threading, parallel execution, or concurrency. Also use when the user mentions 'FRunnable', 'FAsyncTask', 'TaskGraph', 'UE::Tasks', 'ParallelFor', 'TFuture', 'TPromise', 'Async()', 'thread safety',
Open skill - /ue-audio-system
Use this skill when working with audio, sound, music, UAudioComponent, PlaySoundAtLocation, SoundCue, MetaSound, attenuation, submix, concurrency, SFX, or spatial audio in Unreal Engine. See references/audio-setup-patterns.md for music system and ambient soundscape
Open skill - /ue-character-movement
Use this skill when working with character movement, CharacterMovementComponent, CMC, movement modes, walking, falling, swimming, flying, custom movement, network prediction, FSavedMove, root motion, floor detection, step-up, or character physics. Also use for 'PhysWalking',
Open skill

