Announcement

Collapse
No announcement yet.

BP Save/Load and Game Progression System

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    [TOOL] 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).


    Click image for larger version

Name:	WIP - Game Progression System (2015-07-26) 01.jpg
Views:	2
Size:	126.6 KB
ID:	1156303

    Click image for larger version

Name:	WIP - Game Progression System (2015-07-26) 02.jpg
Views:	2
Size:	135.0 KB
ID:	1156304


    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.

    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 - https://answers.unrealengine.com/que...ing-level.html). 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? 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:
    https://answers.unrealengine.com/que...er-in-a-p.html
    Last edited by Nox_A15; 03-16-2016, 06:31 AM.
    Twitter

    #2
    Looking good... when do you plan to release it?
    UE4 blog: www.michalorzelek.com/blog/ - Tutorials, free content and more!

    Comment


      #3
      Thank you. 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.
      Twitter

      Comment


        #4
        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:
        https://forums.unrealengine.com/show...l=1#post340676
        Twitter

        Comment


          #5
          Sweet! This is exactly what I'm looking for! I would defiantly buy it!
          Alex Leiva

          Architect/Visualiser, National VR lead
          C o x Architecture

          LinkedIn: https://www.linkedin.com/in/alex-leiva-88187840/

          COLORAMA - Cinematic color grading // The Vineyard Challenge Solo – Runner Up

          Comment


            #6
            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. 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).
            Last edited by Nox_A15; 03-16-2016, 06:34 AM.
            Twitter

            Comment


              #7
              very interesting to me !
              would this work with a point & click adventure ?
              www.ofpawnsandkings.de

              Comment


                #8
                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!

                Comment


                  #9
                  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.
                  Twitter

                  Comment


                    #10
                    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 !
                    www.ofpawnsandkings.de

                    Comment


                      #11
                      Hi [MENTION=5673]Nox_A15[/MENTION]

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

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

                      luny
                      lunybunny.com
                      lunybunny.com

                      Comment


                        #12
                        Hello [MENTION=32265]lunyBunny[/MENTION], thank you. 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.

                        Speaking of which, just to let you know guys ([MENTION=27931]stucki[/MENTION], [MENTION=1795]UTitanXSI[/MENTION]), 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 [MENTION=28786]aviel08[/MENTION] if you are interested in the system after such a long time, then I will send it to you as well.
                        Last edited by Nox_A15; 03-23-2016, 06:22 PM.
                        Twitter

                        Comment


                          #13
                          Hi [MENTION=5673]Nox_A15[/MENTION]

                          Thanks, [MENTION=5673]Nox_A15[/MENTION], 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!


                          luny
                          lunybunny.com
                          lunybunny.com

                          Comment


                            #14
                            Originally posted by Nox_A15 View Post
                            Hello [MENTION=32265]lunyBunny[/MENTION], thank you. 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.

                            Speaking of which, just to let you know guys ([MENTION=27931]stucki[/MENTION], [MENTION=1795]UTitanXSI[/MENTION]), 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 [MENTION=28786]aviel08[/MENTION] if you are interested in the system after such a long time, then I will send it to you as well.
                            No worries! Looking forward to testing it whenever it's ready.

                            Comment


                              #15
                              Did this ever get released?

                              Comment

                              Working...
                              X