Skip to content

Save Game support

Krzysiek Justyński edited this page Aug 15, 2022 · 11 revisions

Flow Graph simply plugs into Unreal's SaveGame system. If you haven't used it yet, read "Saving and Loading Your Game" docs.

You control which properties are included in SaveGame by marking C++ properties with the SaveGame specifier. Or by ticking the SaveGame checkbox in the blueprint editor.

What to look for?

  • FlowSave.h. Active graphs are serialized to the UFlowSaveGame object which simply extends the engine's USaveGame. That allows you to easily integrate Flow Graph into your SaveGame setup.
  • UFlowSubsystem keeps a registry of all active Flow Graphs at the given moment. That's why it also contains methods providing SaveGame support. You need to call methods like OnGameSaved, and OnGameLoaded. These are accessible from blueprints.
  • UFlowNode class provides overridable events OnSave and OnLoad, so you can custom SaveGame logic to any node, i.e. restore Timer with "RemainingTime" value read from SaveGame. Check UFlowNode_Timer class for reference.
  • UFlowAsset and UFlowComponent exposes similar OnSave and OnLoad events, so you should be able to customize SaveGame logic in every plugin's class that's involved in SaveGame operations.

You can find a quick example of integrating Flow into your SaveGame setup in the FlowSolo demo project. Here's simple C++ classes related to this.

Clone this wiki locally