[Now available on Unreal Marketplace]
https://cdn1.epicgames.com/ue/item/Store_Savior_Thumb-284x246-ec959fe7a61e1054a455b6d79578fc2d.png
-Excuse me sir, do you have a moment to talk about our lord and savior?*
Hey community; I have something here under my belt for a while and was wondering if you would have any interest on it.
Iâm a bit lazy for certain boring tasks I donât like⊠Such as managing variables for save game files, pulling them in and out, configuring everything manually in Blueprint Graphs, etc.
So, to avoid boredom when managing data for my future game projects Iâve decided to dive a little into this matter and create an automated Save/Load game system, avoiding the solutions out there stating âease of useâ but then require a lot of manual labor just to save a bunch of variables and load them back into the game. That is when this little guy was born, I call it Savior!
So, please let me explain to you how automated he isâŠ
To use the SaveGame system provided by Epic, we must create a Blueprint of type SaveGame, populate that Blueprint with âmirror variablesâ for each of our gamesâ important classes, create Blueprint functions to save each of our classes to the disk, and when loading pull them back into the characters, items, enemies, etc and etcâŠ
When you create another property for your character, you must open the SaveGame Blueprint and add a mirror variable to the list again and re-work the loading of the character, again;
And when we change something again, we have to do that again⊠And again, andâŠ
Kind of unnecessary labour if you ask me. Recently someone released a tool to shrink all that process of creating SaveGame files into a single node, but every time we use that custom node, for each variable we must use another node, and another⊠And another, andâŠ; Also, the tool ignores the fact that .SAV files are locked down while you are writing data to it.
When the game has a complex character, that âsingle nodeâ becomes a lot of nodes as well, also becomes unproductive.
With that in mind, Iâve proposed to myself: â-letâs truly automate this thingy 'cause I donât wanna ever waste time with this againâ.
And at this point, thanks to a little key guidance from an Epic Gamesâ engineer, hereâs what I propose to you for adding Savior to your projects:
+
How automated is that?
Best thing is, itâs still a .sav file which supports saving and loading your game on any of the platforms already supported by UE4.
Let me show you a little of the overall process of how you save/load whole game worldâs objects, with position and rotation automatically handled for you, and how you save your Blueprint Graphsâ variables:
First - You create two custom Blueprints provided by the Plugin, one is the automation system and the other is just an custom Actor. They come with these option fields:
You can add or remove Slot spaces, as many as you wish to provide your players and give them whatever name you like;
Using the âActor Scopeâ filter you can leave âActorâ class as default or you can customize it to save only the types of Blueprints you need, like in the image above.
Then you add the âSaver Actorâ to your game level and youâre done with configuration. Your game level will be saved based on the options from the Saver Actor; That simple:
After having the Actor and Blueprint options the way you desire, every object in your level of the classes you assigned to the Scope will have their position, size and rotation automatically saved for you into the SaveGame, you donât need to do anything about it.
So, how to save variables from graphs? Letâs see, Iâve created in my Character Blueprint these variables:
I want to save to the disk the variables HP, *MP *and SP; so I **select each of them and at the âShow Advancedâ dropdown, check for it the âSaveGameâ flag:
**And thatâs it, Savior will save and load the variable for you, no need to create mirror variables or assign/read values using Blueprint nodes!
Then whenever I reopen the game with âAuto Loadâ enabled, everything is at the values that the game just saved, with ***zero C++ or Blueprint programming required:
Still, if you want to have control over everything and donât like the idea of something auto saving/loading important game data without your supervisionâŠ
You can disable Auto-Load and Auto-Save, controlling all the process yourself and still keep usage of the SaveGame tags, thereâs plenty of nodes for you to do that:
If you like it, please let me know; Cheers!
Demo .EXE:
DOWNLOAD DEMO HERE](MEGA)
Latest Demo Project:
https://www.dropbox.com/s/h46212iehbvu2oa/Savior_1.5.6_DemoProject.zip?dl=0
Quick Setup Guide Video:
Known Limitations:
- âUser Defined Structsâ, Blueprint Structs, are not Auto-Saved due to their level of complexity.
- Actors created at runtime must be re-spawned with same unique names before you call LoadGame().
FAQs:
° Which Engine versions are supported?
- I will keep Plugin updated and compatible with current UE4 major release.
° Which types can I use with the Auto-Save system?
- Close to anything supported by the default SaveGame system.
- Bools, ints, floats, vectors, transforms, enums, structs? Check âSaveGameâ box and done.
- Custom Blueprint Enum, Blueprint Array? Check âSaveGameâ box and done.
- Blueprint Structs arenât there, unfortunately; But your custom C++ Structs are supported.
° Which platforms are supported?
- Anywhere supported by UE4.
° How do I install Plugin?
- Plugins require C++ Compiler to work; You need Visual Studio or XCode Installed.
- For Blueprint-Only projects, convert to C++ project first.
- If you use file from Gumroad, copy the âPluginsâ folder from zip into your projectâs folder. Restart editor.
° How do I setup the Actor/Blueprint for Auto-Save?
- Check this video: https://youtu.be/7EkeqjsrkJA
° How do I Save/Load manually from Blueprint Graphs?
- The Plugin provides custom Functions, Blueprint Nodes and Events;
Âș How do I Save/Load manually from C++ code?
- Grab a pointer to the Saver Actor in World. Then simply call Saver->SaveGame(); or Saver->LoadGame();
° How do I save all Actors in Scene?
- Open your Savior Blueprint and, in the âClass Defaultsâ panel, drop-down the Actor Scope list and click the â+â to add new item.
- If itâs not in the list yet, add the class âActorâ; Compile and Save.
° How do I save the Level Blueprint?
- On Saver Actorâs details, check âSave Level Blueprintâ box.
° How do I save Game Mode and Game State?
- On Saver Actor details, check âSave Game Modeâ box.
° How do I save only my Character Blueprint?
- A Playerâs Character is part of the Game Mode logic; To save, check the âSave Game Modeâ box.
° How do I save runtime generated Actors?
- When spawning Actors in runtime, make sure they spawn having always the same, unique, name.
- They also must be spawned before you load or the system will ignore those Actors.
- If an Actor is saved with name âEnemy1â and next time is spawned named âEnemy2â, the system considers him a potential memory violation and wonât load his data.
° How do I overwrite old saved file while in development?
- Uncheck Auto-Load, in Saver Actor, check Auto-Save. All old data will be replaced.
- Or delete the .sav files from the SaveGame folder.
° How do I setup multiple Slot files?
- Open the âClass Defaultsâ panel of your Savior Blueprint; At the âSlotsâ list, click the â+â to add another Slot.
- From the âClass Defaultsâ panel or from your UMG widgetâs graph, set Savior.SlotID = 1;
- Make sure the Slotâs name isnât empty, type a name for it; Now game will save to Slot 1 instead of Slot 0.
- This is useful for RPGs and other progression based games where your players can have multiple save files.
° Why some Actors are saving, but arenât loading?
- You have changed its name, changed its parent class or thereâs another Actor in scene with same name.
- In this case the saved data is deprecated and you need to save again, overwriting old file.
- Keep in mind that, if you want an Actor properly loaded, itâs name must be unique; Not the Label, the real objectâs name.
° How do I Auto-Save my Graphâs Arrays?
- Blueprint Arrays are supported by Auto-Save system, they can now be dynamic sized as well.
- Simply tag it with the âSaveGameâ flag just like any other variable types in your Graph.
° How do I Auto-Save my own Structs?
- If youâre not C++ programmer, your BP Graphsâ Structs must be of types âFSaviorStructâ for Auto-Save to consider them.
- If youâre programmer, you can easily overload FArchiveâs operator in your code to add your custom Structs for Auto-Save support.
Âș How to Package my Project in Debug-Mode with Plugin included?
- To link the Plugin to your Debug build, you must add its name to the âPublicDependencyModuleNamesâ field in âPROJECTNAME.Build.csâ before packaging.
Âș How to Package my Project in Shipping-Mode with Plugin included?
- To link the Plugin to your Final build, you must add its name to the âPrivateDependencyModuleNamesâ field in âPROJECTNAME.Build.csâ before packaging;
- If youâre having issues, try in the Project Settings panel(Edit->Project SettingsâŠ) checking the âFull Rebuildâ option before packaging.
Âș How is Multiplayer profiles saved?
- Only the server saves â.savâ files locally for each Player; On Load, replicated Actors should update just fine after Server have the changes applied.
Âș How do I load a Slot using the âOpen Levelâ node?
- Demo project has a detailed example built on Blueprints of how to use âOpen Levelâ the âEpic Wayâ to load a game or start a new one.
Âș What are the license terms?
- Your license is perpetual and you can use the plugin for as many seats you need and for as many projects you make.
- I just ask you kindly please do not share source code or runtime libraries with pirates.
- You can read more about UE4 Marketplaceâs terms here: https://publish.unrealengine.com/faq
UPDATES:
1.5.5 (UE4.14+):
Marketplace Status: Updated
Gumroad Status: Updated
Âș Mobile Platforms binaries are now included, so your mobile blueprint game can use this plugin now without having to have Visual Studio installed to build C++ code.
Âș Fixed issue preventing non-root mesh/skeletal components to save their transform information; now they save transform even if set as sub-components.
Âș Added an option to try automatically respawn procedural Actors before loading the game world.
For this to work, your âProcedural Actorâ must contain a â+Procâ Actor Tag (NOT Component Tag).
This makes easier than ever for you to add to your Game, Actors generated at runtime, they will be restored to the Level from the .sav file.
If the Procedural Actor is member of a Streaming Level, Savior will try to re-assign that Streamed Level as owner of the respawned Actor for you, if possible.
Keep in mind that this system increases loading time!
[1.4.7] (UE4.12 & UE4.13):
Âș Added âSave/Load Game for Playerâ functions to load from Slot ID to specific Player ID. Mainly useful for local multiplayer games.
This works like the âSave/Load Game Modeâ functions (it affects only GameMode classes for the given Player ID, does nothing to the Level).
Âș Added âLoad Game from Fileâ and âSave Game to Fileâ functions; With these you can type in the Slotâs name directly instead of ID.
Like âSave/Load to Slotâ functions, this works like original Save/Load nodes (will try to save or load the Level with everything in it).
[1.4.6] (UE4.12 & UE4.13):
[Fixed]: Linear Velocity of saved Actors werenât properly restoring physics velocity; fixed.
[Added]:
Âș âAngular Velocityâ is now also auto-saved for Actors by default.
Âș Implemented Tag System.
[Tag System]:
Âș This version introduces a Tag system which can be used to quickly perform customized Save/Load operations without programming involved.
Sometimes you want to save the whole Game World automatically using the Actor Scope, but still control specific behaviour of specific Actors.
For example:
You have multiple instances of the same Blueprint spawned in the Level; for design reasons you suddenly decides some of them
should behave differently when the Game is saved or loaded, but in some cases thereâs no way to identify by Name which Actor it is;
To identify which Actor it is, that you need the âSerializeWorld()â function to process, some tedious programming effort would be required.
Âș To avoid a whole chunk of some serious C++ code or filling your Blueprints with unnecessary variables + spaghetti⊠Use Tags instead!
Here are the current Tags that you can add to your Actors or Components to customize the serialization system quickly for any Actor:
[1.4.5] (UE4.12 & UE4.13):
[Added]:
Âș Streamed Levels auto Save/Load support. (pre 1.4.5 sav files not supported)
Âș Streamed Levelsâ Actors auto-destroy support. (pre 1.4.5 sav files not supported)
Âș âSerializeWorld()â will now consider Streamed Levelâs Actors properly.
[Fixed]:
Âș âDeserializePlayerPawn()â wasnât checking for Character Class; Fixed.
Âș âPrioritize()â reworked; Fixed some conflicts against Streamed Level loading.
[Limitation]:
Âș Auto-Load Streams will NOT work correctly if you manually load more instances of the SAME Streamed Level already loaded.
If you absolutely need multiple Level copies, consider finding a way to set unique names for your manually loaded Maps.
Or just make sure that none of Actors from âMap Aâ match unique Actor names from âMap Bâ.
However, it is expected to work flawlessly with World Composition tool though.
[1.4.4] (UE4.12 & UE4.13):
Âș Added option to auto-save Properties from GameInstance Blueprint.
Âș Fixed some critical performance bugs, thanks to James Steiningerâs reports.
Âș Reworked âSave With Screenshotâ node, now more flexible to use and much more performant.
Âș Added option to ignore Player Pawnâs location when loading only Game Mode.
Âș âSave in Editorâ will now save to a private dedicated â.savâ file.
Âș âSave Game Modeâ now saves to a dedicated â.savâ file.
[1.4.3] (UE4.12):
Âș Added capability to save or load a Game World from .sav files in Editor without the Game running.
More info in THIS POST.
[1.4.2] (UE4.12):
[Added]:
Âș âSave Game Modeâ Blueprint Function: Saves Game progress without saving the whole Game Level.
This is very useful for saving or load complex Player data within any World Map at any time, like in Open World Games.
Note: Itâs absolutely possible for you to save the whole World, and use this to load only the GameMode from the .sav file;
Note: Itâs absolutely possible for you to save only the Game Mode, and load the game with default LoadGame() function.
The difference in âLoad (by) Game Modeâ function is: You can load GameMode from any Slot saved from any other World(Level) Map that isnât part of current World.
[Fixed]:
Âș âAuto-Loadâ with âSave-Componentâ checked could cause editor crash; fixed.
Âș A âComponent Scopeâ filter have been added to the Savior Blueprint, to increase safety when Saving/Loading Components.
Also Components must now be properly registered, else it will not be serialized.
Any Component that is a child of âUPrimitiveComponentâ, mesh components, cannot be serialized from the .sav file (crash).
Âș General Performance optimizations.
[1.4.1] (UE4.12):
Âș Fixed bugs with the âAuto-Destroyâ Blueprint node.
Âș Added convenience function âFind Saverâ to make easier for Blueprints to save the game from anywhere.
[1.4.0] (UE4.12):
Âș Ignored Actors list have been added to the saving Actor; any actors from the level directly added to this list will not be saved.
Âș Save / Load Isolated. Save or load any Actor to a separate .sav file, without saving the whole game Map.
Âș Isolated saved files support optional filename encryption. Useful for saving sensible data locally.
Âș New function to save Game with a Screenshot has been added; As well as a âLoad Slot Screenshotâ function.
[1.3.5] (UE4.12):
Âș Editor Module have been added for improved general in-editor usage for developers.
Âș The âSavior Blueprintâ, can now be created from Asset Browserâs popup menu; from there, the workflow you already know remains the same.
Âș A Settings tab have been added to âEdit -> Project Settings -> Synaptech -> Savior Settingsâ.
Âș From the new Settings tab, you can now configure various minor details for your general plugin usage, without the need to edit or recompile C++ files.
Âș Demo Project have been updated to 4.12.5 to fix incompatibilities it had with latest engine release.
The Settings tab and new Asset Browser menu will be specially useful for me, I plan to release more plugins related to the current ones released and having them
grouped under a distinct sub-menu will help me organize better the way plugins interact with each other in near future. Cheers.
New Settings Tab:
Is very simple to get default plugin settings from anywhere in your game, just use the blueprint node âGet Savior Settingsâ:
Create Actor or Template blueprints from Asset Browserâs popup menu (right mouse button click):
[1.3.2] (UE4.12):
Âș Characters Capsule Component now restores its rotation by default.
Âș Minor bug fix in LoadGameFromSlot(); Was firing wrong OnXXBegin Event.
Âș Minor bug fix in LoadGame(); OnLoadBegin Event was called twice.
Âș Minor bug fix in SaveGame(); OnSaveBegin Event was called twice.
Âș Added Custom âDoes Save File Existâ Blueprint Node which checks if file exist with Saviorâs Slot ID + Player Postfix.
Âș Reworked âSavior Structâ which supports serialization to .sav files automatically (alternative to âUser Struct Blueprintâ), you can now setup values as Arrays.
Note: Pre 1.3 â.savâ files maybe may be incompatible for loading from 1.3.2.
[1.3] (UE4.12):
Âș Removed unnecessary serialization loops based on Controller IDs.
Âș Playerâs Pawn/Character classes are properly saved, Pawns class was ignored before.
Âș Added support to Actor Components, now properly saved with owner Blueprint. âSaveGameâ tag on Componentsâ Properties are required as well.
Âș Added support to Custom C++ Components, now properly saved within owner Blueprint. âSaveGameâ tag on Componentsâ Properties are required as well.
Âș Added support to auto-save Componentsâ locations.
Known Issues:
Âș Static Mesh Components are not serializable from .sav files.
Âș UObjects (pure) are not supported by the SaveGame tag archiver. Consider using UActorComponents instead which are supported.
[1.2]:
**Âș Saver Actor .H made public by default, as requested by C++ programmers.
**- You can reference ASaver and its property easier and faster now, as well as having direct access to Saver->Savior blueprint.
**Âș All Actors now remembers when Destroyed.
**- If you want to destroy an Actor and keep it destroyed when Level loads from Disk, now all you have to do is to destroy the Actor using this new Node.