BP Save/Load and Game Progression System

Recent update information (2016-03-16) - here!

During gameplay scripting there often surface a need to remember a state of levels when traversing between them or to save and load this data to a file. Moreover, many elements of the virtual world need to change according to progression of the plot. This system was created to be a foundation which solve these issues. It is created entirely in BP.

What you can do with this system:

  • Keep state of your levels when traversing between them (supports streaming levels as well).
  • Create game based on quick save/load feature or checkpoints.
  • Decide for yourself which data in your objects is saved/loaded.
  • Script virtual worlds changing with the progression of your game using plot facts.

Additional features:

  • Support for spawned objects and destroying objects originally placed in the level.
  • Spawned objects can be attached to parents placed in the level, which allow to attach them to streaming levels or destroy them with their parents.
  • Optional plot facts validation with data table imported from CSV file for better control over your documentation (plot fact will not work without being placed in the table first).

**Original post:

                                    • -**

Hello everyone!

For some time already I work on a foundation to build a game on. It allows to script game progression and save/load its state at any moment. I would like to submit this Blueprint to the Marketplace, so I decided it’s finally time to show results of my work to you and gather some feedback when I put some finishing touches. :wink:

First short video. It’s just a quick recording of the BP in action, I will definitely create a project and a film better showing each feature later. I suggest watching in full HD to see log entries in upper-left corner of the screen (“Game Saved” / “Game Loaded”). Sometimes I load a few times in a row to show it more clearly.

What you see here is a project with two main maps. The first one includes all important content, second one (1:05) is there just to show BP remembers state of the objects when player traverse between levels.

Game progression is based on facts array - when something happens in the game, for example our hero just reached Volcano of Doom, a “fact” is placed in an array for game to know this event already occurred. It is possible to create CSV data table to validate these during gameplay (if you want to be sure designers document facts before using them in game).

There are four types of objects that need to be saved to a file:

  • Plot Objects - they have a scripted state for every plot fact that they are subscribers of (the system uses events to call them) [0:42, 0:56 - plot facts are triggered by volumes on the top of each stairs and Plot Objects change colour after being informed about activating their facts];
  • Dynamic Objects - they initially exist on the map and have their variables we would like to save and load (“Dynamic” is just a name I chose, they can be static geometry) [every white cube with a sphere inside on the film, 0:30 - as child component, 0:32 - as a BP instances];
  • Spawned Objects - they initially don’t exist on the map but we would like to preserve them in a save game file [each sphere spawned below a moving cube];
  • Player Character - our pawn.

Three latter can be a Plot Objects as well but they can’t be “blended” with each other. System also supports Streaming Levels (but they can’t be Always Loaded due to a bug (?) I described here - Event Begin Play in Always Loaded Streaming Level - World Creation - Epic Developer Community Forums). When you spawn anything in UE4 it is always spawned in Persistent Level so I created a way to attach Spawned Objects to a parent. It’s an option, as seen in the video these objects can be preserved in different ways - without a parent (1:25 - two on the left), with a parent but not saved after leaving streaming level (1:25 - two on the right), with a parent and saved after leaving streaming level (1:51) and I work now on preserving them in a save game but not between Persistent Levels (for example a mighty fireball your enemy is throwing when you are about to switch between maps - it would be funny to find it still flying towards you after some time and returning to the same place).

System also remembers which objects initially placed on the map were destroyed. For it all to work you only need to inherit a class for Dynamic Objects and Spawned Objects (and override Save/Load functions to manually get/set your variables), add some nodes to your character and Plot Objects. I still work on making it as easy to use as possible. I still need to check if new changes in the components (UE4.8) will allow for some interesting modifications to the system.

So, what do you think? :slight_smile: Sorry for such a wall of text, I will do my best and compress it into some nice features list later this week. First of all please let me know if you are interested in such system created entirely in BP. If you have any questions just let me know.

PS
Also this bug need to be fixed for player character to spawn correctly after load in a packaged project:

Looking good… when do you plan to release it?

Thank you. :slight_smile: I currently work on making a project which better shows all features of the system and make a lot of smaller fixes and changes. I hope I’ll be able to submit the BP to Epic to the end of the month. I’ll update this topic soon with better video and more transparent description.

I updated the first post with more transparent description at the beginning and added in the topic below two screenshots from the project which will present features of the system:

Sweet! This is exactly what I’m looking for! I would defiantly buy it!

Thank you for your interest aviel08 and sorry for my late response! Just to let you know, I still work on this system and plan to publish it on the Marketplace. Unfortunately it shares my free time with some other projects and I’ve found a full-time job last year, so that’s why it takes so long.

In January I remade probably most of the system’s Blueprints. It’s much more efficient now (I got rid of many unnecessary operations on arrays) and also should be much easier to use and modify than the version from July. I don’t plan to add any new features to version 1.0, so bug fixing, polishing and finishing “Museum” tutorial project are the last things to do.

Before publishing I would like to get a feedback of at least two developers interested in implementing such system. Would you like to be in such test group? Of course you would be able to keep the tested version of the system. :slight_smile: If someone is interested please let me know here or by private message (also let me know what type of game/project are you going to test the system in).

very interesting to me !
would this work with a point & click adventure ?

This looks really great, I would LOVE to be able to try it out/buy it. if I can help with any feedback let me know!

Hello stucki! Yes, definitely! I still haven’t measured the exact limitations of the system after my recent optimization changes, but it should do perfectly fine in a small/medium game. In a point & click adventure plot facts should be enough to script most of the plot, probably. These are the less performance heavy option in the system - you just set a fact in the array and every object set as subscriber of this fact will be influenced by it further on. If you want to check it out just let me know, I will do my best to prepare the project with some basic documentation for you during the weekend.

Overall the system should do just fine until you want to remember a variables of more than 200-300 objects placed in the same level (or so I remember - that’s the very old data, before my recent changes, so I need to verify it again). System is entirely based on BP, so please remember that the engine can perform only a limited number of BP operations at once and it applies to the system as well. If it will need to process too much data then it will crash in the process. I created a few parameters to help with this problem, for example you can choose if the spawned object will be saved only within current level or between levels as well. So it all depends on your game design and how you plan to use the system as well - checkpoints will need to gather less data than quick saves.

One more thing - I haven’t tested the system on anything other than PC, so it would be great to find someone with a possibility to do so.

Edit:
Thanks UTitanXSI! I will let you know as well then, probably during or after the weekend. Will keep you all updated in this topic. :slight_smile:

thx for the detailed answer !
will keep an eye of it. Once we get to the point where we need a load/save system, i will gladly come back here.
Keep up the good work !

Hi @

Very, very useful in a game. This is really essential! :smiling_face:

One question, It is able to save the game progression as a compressed binary file?

Hello @lunyBunny, thank you. :slight_smile: About your question - I have no idea to be honest. Never tried that method, but I see it requires some changes in C++ code and use of data serialization etc. (correct me if I’m wrong please). My system is “just” a BP based on a game instance class with actor/player character classes for objects. If you want for example to save a variable of your actor BP, first you must set one of my BPs as its parent. Then you can override two functions - one for saving data to game instance and second for loading them. It’s a very simple process, but it’s still BP, no code involved, so pretty high level stuff, probably not suited for very big projects where you would like to have everything as low level as possible.

But if what you are asking involves only doing something with data before saving it to the file and after loading from it, then it shouldn’t be hard to modify just functions responsible for this process. If you want to have a look yourself let me know and I will add you to the test group. :slight_smile:

Speaking of which, just to let you know guys (@stucki, @UTitanXSI), I polished some things during the last weekend but still need to write at least basic user manual before sending everything to you. I probably won’t wait for completion of the MuseumDemo project, because that’s not required for the system to work, it will be just a demo after all. I will let you know soon, thanks for your patience.

PS
Also let me know @aviel08 if you are interested in the system after such a long time, then I will send it to you as well.

Hi @

Thanks, @, You are very kind.

This save game system is really very complete. Be sure to include UMG example for loading screen also. That would be great.

Thank you for your answer!

No worries! Looking forward to testing it whenever it’s ready.

Did this ever get released?