save-and-load

Persist and restore Unreal Engine game state using USaveGame slots and actor serialization.

1|Updated Sep 6, 2026
One-click install
npx skills add https://github.com/ziyarduc/Baran-bk-game --skill save-and-load-ziyarduc
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: save-and-load
Source: https://github.com/ziyarduc/Baran-bk-game/tree/main/.agents/skills/save-and-load
Command: npx skills add https://github.com/ziyarduc/Baran-bk-game --skill save-and-load-ziyarduc

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Implementing save/load in Unreal Engine C++ involves many moving parts — USaveGame subclasses, slot APIs, async operations, actor state serialization, and version migration — and mistakes like storing live pointers or skipping version fields cause corrupt saves and crashes. ## Core Features & Use Cases - Slot-Based Save/Load: Create, save, load, and delete named save slots via UGameplayStatics, with both synchronous and async variants for gameplay-safe saving. - Actor State Serialization: Capture dynamic actor state into byte arrays using UPROPERTY(SaveGame), FMemoryWriter/FMemoryReader, and FObjectAndNameAsStringProxyArchive for multi-actor world persistence. - Versioning & Migration: Add SaveVersion fields, migrate old saves in PostLoad, and use ULocalPlayerSaveGame hooks for structured per-user versioning. - Use Case: You need to persist player progress, inventory, and opened chests across sessions in a UE5 game — define a USaveGame subclass, snapshot saveable actors into records, and restore them on load with version-safe migration. ## Quick Start Ask the AI to implement a save/load system in Unreal C++ that persists player progress and dynamic actor state to a named slot with async saving and version migration.

Frequently Asked Questions about save-and-load

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I save and load game data in Unreal Engine C++?▼

Create a USaveGame subclass with UPROPERTY members, then use UGameplayStatics::CreateSaveGameObject, SaveGameToSlot, and LoadGameFromSlot with a slot name and user index. Always null-check the loaded object before use.

How to serialize actor state into a Unreal save game?▼

Mark actor properties with UPROPERTY(SaveGame), then serialize the actor with FMemoryWriter wrapped in FObjectAndNameAsStringProxyArchive with ArIsSaveGame set to true. Store the resulting byte array inside your USaveGame object and reverse the process with FMemoryReader on load.

Does UPROPERTY(SaveGame) work on the USaveGame object itself?▼

No, the SaveGame specifier has no effect on the USaveGame object itself — all non-transient UPROPERTYs are written by SaveGameToSlot. It only gates selective actor serialization when the archive's ArIsSaveGame flag is set.

Why does LoadGameFromSlot return null in Unreal Engine?▼

LoadGameFromSlot returns null when the slot does not exist, the save file is corrupt, or the class schema mismatches. Check DoesSaveGameExist first to distinguish a missing save from a corrupt one, and always null-check before casting.

How do I migrate old save files after changing fields?▼

Add an int32 SaveVersion UPROPERTY from day one and increment it on breaking schema changes. Override PostLoad to detect older versions and migrate deprecated fields, since renamed or removed properties silently load as defaults.

Should I use synchronous or async save in Unreal Engine?▼

Use AsyncSaveGameToSlot and AsyncLoadGameFromSlot for any save triggered during active gameplay, since synchronous calls block the game thread and cause visible hitches. Synchronous calls are acceptable for menu or startup flows.