Save and Load
The simulator persists desktop layout, installed programs, filesystem changes, and per-program settings through Unreal’s save-game system. The entry point is UOperatingSystemSaveGame and per-program Save Method on UOperatingSystemBaseProgram.
flowchart TB
subgraph row1[" "]
direction LR
Prog["UOperatingSystemBaseProgram"] --> Method["EOperatingSystemProgramSaveMethod"] --> Settings["UOperatingSystemProgramSettings"]
end
subgraph row2[" "]
direction LR
Device["UOperatingSystemBaseDevice"] --> SG["UOperatingSystemSaveGame"] --> Disk["Unreal SaveGame slot"]
end
Settings --> SG
Program save methods
Section titled “Program save methods”EOperatingSystemProgramSaveMethod | When data is written |
|---|---|
| SaveOnOperatingSystemShutdown | OS shutdown/restart (not manual program close) |
| SaveOnExit | Program closed or OS shutdown |
| SaveManually | Only when you call Save Settings |
| DoNotSave | Never |
Set Save Method and a Settings Class (subclass of UOperatingSystemProgramSettings) on your program Blueprint or C++ defaults.
Program settings object
Section titled “Program settings object”- Create a Blueprint or C++ class derived from Operating System Program Settings.
- Add variables you want persisted (window position, user prefs, etc.).
- Assign as Settings Class on the program.
- Enable Remember Last Window Position on the program to auto-store window geometry when save method allows it.
Access at runtime:
Get Program Settings (cast to your settings class) → read/write properties→ Save Settings (when using SaveManually)OS-level save
Section titled “OS-level save”The device actor and UOperatingSystemBaseDevice coordinate full OS snapshots — installed programs, directories, user manager data (FOperatingSystemUserManagerSaveData), and partition contents.
Battery events on portable devices can trigger saves when Battery Save State Flags are set — see Portable device.
C++ example — custom settings
Section titled “C++ example — custom settings”UCLASS()class UMyProgramSettings : public UOperatingSystemProgramSettings{ GENERATED_BODY()
public: UPROPERTY(SaveGame) int32 HighScore = 0;};UCLASS()class UMyProgram : public UOperatingSystemBaseProgram{ GENERATED_BODY()
public: UMyProgram() { SaveMethod = EOperatingSystemProgramSaveMethod::SaveOnExit; SettingsClass = UMyProgramSettings::StaticClass(); }};Blueprint tips
Section titled “Blueprint tips”- Use Save Game checkbox on variables in your Settings Class Blueprint.
- Call Save Settings from a button in your program widget when using SaveManually.
- Test with PIE → stop → PIE again on the same map slot to verify reload.
Packaging
Section titled “Packaging”Save games work in packaged builds. If custom terminal commands or program assets fail to load in a build, see Packaging.