Announcement

Collapse
No announcement yet.

Game Instance and Game Save and Game StateVR Game

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

    Game Instance and Game Save and Game StateVR Game

    Hey everyone, I am creating a VR game that resembles an arcade-style of scoring. Right now my points transfer from level to level using the Game Instance but what I would really like to do is have the points carry over after a completed game, so when you come back you have as many points as you had when you left and you can continue. I'd like to do this with little to almost zero menu interactions. Points are the only things I care to have carried over so I was wondering what could be the best way to execute this. I keep getting mixed signals from the internet on which one to use. Any help would be great before I start blueprinting too much and waste a lot of time. Thank you for any advice!

    #2
    Originally posted by Patrick_000 View Post
    Hey everyone, I am creating a VR game that resembles an arcade-style of scoring. Right now my points transfer from level to level using the Game Instance but what I would really like to do is have the points carry over after a completed game, so when you come back you have as many points as you had when you left and you can continue. I'd like to do this with little to almost zero menu interactions. Points are the only things I care to have carried over so I was wondering what could be the best way to execute this. I keep getting mixed signals from the internet on which one to use. Any help would be great before I start blueprinting too much and waste a lot of time. Thank you for any advice!
    Save game object is the answer.

    It's works just like the game instance, but persists between game runs.

    Comment


      #3
      ClockworkOcean Thank you!

      So as of right now, all my points are going to a game instance, are you saying I should change that to a Save Game Object? Or use both? Does Save Game Object survive between levels? Very appreciative of your reply.

      Comment


        #4
        Originally posted by Patrick_000 View Post
        ClockworkOcean Thank you!

        So as of right now, all my points are going to a game instance, are you saying I should change that to a Save Game Object? Or use both? Does Save Game Object survive between levels? Very appreciative of your reply.
        Game instance exists the whole time while the game is running, so it's a great way to preserve things between levels. But when the game stops it's gone.

        Save game looks very much like the GI, but persists between runs of the game:

        https://www.youtube.com/watch?v=_4usRrTiqak

        Comment


          #5
          ClockworkOcean Great thank you for the link. After watching, I'm still a little confused I guess. Does GSO persist level to level the same way GI does? Or could I cast my GI points to a GSO once a game is completed? Or is that unnecessary?
          Last edited by Patrick_000; 09-14-2020, 06:27 PM.

          Comment


            #6
            Originally posted by Patrick_000 View Post
            ClockworkOcean Great thank you for the link. After watching, I'm still a little confused I guess. Does GSO persist level to level the same way GI does? Or could I cast my GI points to a GSO once a game is completed? Or is that unnecessary?
            Game instance only exists while the game is running and is always available.

            Save game stays on the hard drive after the player exits the game, so is available next time they start.

            If you want things to persist between different sessions, you have to put it in the save game

            Comment


              #7
              Originally posted by ClockworkOcean View Post

              Game instance only exists while the game is running and is always available.

              Save game stays on the hard drive after the player exits the game, so is available next time they start.

              If you want things to persist between different sessions, you have to put it in the save game
              You're the best thank you!

              Comment


                #8
                ClockworkOcean

                Hey I hate to bother but I am running into a lot of difficulties here and it's making me a little more angry than I should be lol

                I basically don't know where to start. The points that are being collected are currently being casted to my game instance where I created my references. You collect the points by mowing over grass.

                I am now trying to make it a Save Game and can't figure this out. I'm providing my blueprints. Any help would tremendous. This is also very embarrassing considering I really have no idea how to turn it into Game Save lol I made it game instance no prob this is very complicated me atm

                Attached Files

                Comment


                  #9
                  Originally posted by Patrick_000 View Post
                  ClockworkOcean

                  Hey I hate to bother but I am running into a lot of difficulties here and it's making me a little more angry than I should be lol

                  I basically don't know where to start. The points that are being collected are currently being casted to my game instance where I created my references. You collect the points by mowing over grass.

                  I am now trying to make it a Save Game and can't figure this out. I'm providing my blueprints. Any help would tremendous. This is also very embarrassing considering I really have no idea how to turn it into Game Save lol I made it game instance no prob this is very complicated me atm
                  I will look at this properly tomorrow, but a quick look now tells me the same thing I usually see with save games.

                  Here's how they work

                  1) Create the save game ONCE. On begin play for example.

                  2) When you want to read: load game from slot, cast and read

                  3) When you want to write: load game from slot, cast, write, save game to slot

                  The two most common mistakes are, creating the save game every time it's used ( which mean's it's always going to be empty ), and not reading the save game before updating and saving it ( which also means it will not work properly ).

                  Comment


                    #10
                    Originally posted by ClockworkOcean View Post

                    I will look at this properly tomorrow, but a quick look now tells me the same thing I usually see with save games.

                    Here's how they work

                    1) Create the save game ONCE. On begin play for example.

                    2) When you want to read: load game from slot, cast and read

                    3) When you want to write: load game from slot, cast, write, save game to slot

                    The two most common mistakes are, creating the save game every time it's used ( which mean's it's always going to be empty ), and not reading the save game before updating and saving it ( which also means it will not work properly ).
                    You're a lifesaver! I'll dig a little deeper. and excited for your next response!

                    Comment


                      #11
                      Originally posted by Patrick_000 View Post

                      You're a lifesaver! I'll dig a little deeper. and excited for your next response!
                      This is how you use a save game:

                      Click image for larger version

Name:	using SG.JPG
Views:	42
Size:	219.2 KB
ID:	1812834

                      Comment


                        #12
                        Originally posted by ClockworkOcean View Post

                        This is how you use a save game:

                        Click image for larger version

Name:	using SG.JPG
Views:	42
Size:	219.2 KB
ID:	1812834
                        Tha's a lot more clear.
                        With that being said, I'm using multiple variables (points) on my widget, would I then be saving the number of points that appears on the widget?
                        I created all my variables in my game instance, would I then delete those and recreate them in the GSO?

                        THANK YOU. Seriously, you're a lifesaver.

                        Comment


                          #13
                          Originally posted by Patrick_000 View Post

                          Tha's a lot more clear.
                          With that being said, I'm using multiple variables (points) on my widget, would I then be saving the number of points that appears on the widget?
                          I created all my variables in my game instance, would I then delete those and recreate them in the GSO?

                          THANK YOU. Seriously, you're a lifesaver.
                          You have to write code to save everything relevant that you put in your save game ( ie stuff you want to save ).

                          You don't have to save it all of once of course, bits here and there.

                          It's easiest to do it in a macro, so you don't have to keep fiddling around with those nodes above.

                          Really depends how you want to do it, but I made a different macro for every part of my save game. So, for a given asset / blueprint I can just use one node to get and save all the settings.

                          ---

                          You *can* use the save game to pass info around, just like the game instance. Difference is with the save game, you then don't have to come back and save the information later

                          Game instance is more about enabling communication.

                          Comment


                            #14
                            Originally posted by ClockworkOcean View Post

                            You have to write code to save everything relevant that you put in your save game ( ie stuff you want to save ).

                            You don't have to save it all of once of course, bits here and there.

                            It's easiest to do it in a macro, so you don't have to keep fiddling around with those nodes above.

                            Really depends how you want to do it, but I made a different macro for every part of my save game. So, for a given asset / blueprint I can just use one node to get and save all the settings.

                            ---

                            You *can* use the save game to pass info around, just like the game instance. Difference is with the save game, you then don't have to come back and save the information later

                            Game instance is more about enabling communication.

                            Yeah idk this just isn't computing in my brain I guess.

                            What I'm hung up on is how do I tell it to save the points being counted in a function on my HUD that are being called from a game instance. I'm probably going in circles at this point.

                            Comment


                              #15
                              Originally posted by Patrick_000 View Post


                              Yeah idk this just isn't computing in my brain I guess.

                              What I'm hung up on is how do I tell it to save the points being counted in a function on my HUD that are being called from a game instance. I'm probably going in circles at this point.
                              Just use the the save chunk of code I gave you there... when you change it, save it.

                              Comment

                              Working...
                              X