Creating the ultimate save system - Unreal Engine 5

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] welcome back in this tutorial we are going to be creating a very powerful save game system making use of good programming practices if you are one of those people who have looked at save game tutorials and don't quite understand or can't go from that part to how you can make a usable system for your project or game then this is the video for you if you follow along to the end you will have a very powerful save game system that can be applied to almost any project the system will be super easy to maintain as well as to interact with the save game system will be incredibly scalable and flexible I will first go through how to make the system while adapting it to my existing Bare Bones project then I will show how you can extend and build upon this system further lastly I go through the simple communication flows that we have and make use of in this to bring it all together you do not want to miss this let's check it out so here we are inside of the project that I will be using as sort of our foundation for our system it doesn't have a whole lot of functionality in it uh we have our main menu here where we can for example enter a level inside of this level we can see that it's numbered one on the floor because this is level one and we have a portal here which leads us to level two when in level two we can move to level three and from level three we can move back to level one so we have these uh different Maps available to us and uh in addition to that we also have the in-game menu we can bring up uh this is some debug data it's going to be of interest later but not for now uh in here we have resume save game and quit so I was thinking we can create this system by starting um at the execution flow of where where the logic would begin which in this case will be the save game and see how we reason our way forward from there and onwards basically so uh let's open up our in-game menu our in-game menu is a very simple widget here and I have they have a little bit of code here I have a quit button which quits and we have a resume button which removes the widget from the parent and then we have a save game button here which uh we're going to be hooking in our logic to so the requirement here uh is what's going to be dictating how our game is going to be working and by that means how our save is going to be working that is how most software development Works um so our specific needs will sort of tailor our solution to it so the idea here is that we have this game and it we want to have a system that's flexible and it's scalable and it's easy to use and just very manageable overall while being modular so uh we want to have like certain points where different parts of code will say that we should save the game now for some reason the this could be something like uh we pressing the the menu and saving out to quit the game uh it could be something like traveling to a different level it could be something like going up to a save point something like that something that can trigger a situation saying now we want to save the game so that's where we will be like starting off our logic from so um in our in-game menu this is what we want to do over here so we excuse me so we want to uh have a a save function now that's easily reachable uh from many different places so inside the Unreal Engine architecture we have something called a game instance now the game instance is a class that exists throughout the lifespan of your gaming session so it persists even if you travel between levels and such so it's a fairly uh key and core part of the classes that are available in the framework and allows us to actually make some communication with the save game fairly easy and and that's where we will be starting now you will not be having the same project as I have uh but that doesn't really matter if you follow along you'll be able to recreate this system just fine and you'll be able to hook it in to basically any kind of system you want regardless of how you want to save the information it all depends on how you want to make use of it but I'll be going through a bunch of different examples and such but anyway uh in this project I have a save folder inside of that we're going to be creating this first first class we're going to be having a game instance so we'll select one of that game instance so the game instance here is our own class of the game instance that we want to have some communication with our save game so let's start off with also creating a save game class for us so type in save game and we can call that just bore save game game now the save game class we can leave blank for now basically uh we just want to have it available inside of our game instance so we'll create a variable make it of the type BP game BP save uh game we can call this the save game reference like so so this is the the class that we want to communicate with uh and we want to do this in this manner because of a few different reasons um the game instance is easily obtainable from many different locations which suits our needs and requirements and it can also uh persist the save game uh object throughout level Transitions and such um so inside of the game instance we want to add some uh basic functionality to be able to manipulate towards this save game uh so we are going to be creating a custom event to begin with which will be our event which we save the game with we calling it save game so uh this will be our um our saving event and we're going to making it in the event graph because this might be something that we're doing asynchronously so we'll take that in as a parameter as well so we add a Boolean called async and this will be uh deciding if we will be doing a save that's asynchronous or not um so we'll take a branch from here and we'll just hook that up and then on the true we will be saying that we want to take our save game reference and we want to do an async save game to slots and hook that up to true and then once we go to false we want to do a save game to slot we'll promote the slot name to something called maybe uh save game slot name something like that descriptive we'll compile and we'll give it some default name just so we have something assigned here so slot one is what I'm going to be making use of for now we're going to be making sure that we have this parameter sent in over here as well so now we have the two different U cases here where someone is calling on this event wanting to save asynchronous or synchronous asynchronous meaning that it will not run on the game thread so uh it will not uh stop the game it will continue to play the game so you might want to have something like a widget playing that uh shows that it's working until it's completed we will not be adding that here but it's it's easy to add if you wanted to um the synchronous save game might be something that you're um using in in situations where for example you want to leave to another level there's no point in making it on a synchronous call because that that's the point where you just want to make sure that you're saving the game as quickly as possible so you can uh crash that level and start up the new level essentially so these are the two cases that we have and once we are done here we essentially want to possibly notify someone that we are done with our saves so we'll create a event dispatcher we'll call this uh actually let's call it game saved so game saved we will be adding a variable form and it will be of the type BP save game because there might be situations where whoever is listening to this call is interested in the save game data as well and we we will be making use of this later as well so dragging this out we do a call we'll go back to this and actually name it to something better so we call it um save game ref again and compile and refresh this node so it gets its name updated and we hook up the completed to this so we're going to say that we're completed on the completed event is when we're actually saying that we're done with our saving and the save game reference here is going to be this reference over here we're going to do the same thing over here and we're going to be calling it like so so at this point we have a function that we can say save game choose asynchronous or not and it will tell us when it's done after it has actually done the save um this actually this is wrong this should be in the save game object if we do it like this maybe I don't want to have that let async uh save slot so we'll get rid of the world context there make it a little bit cleaner like so and hook it up to the completed all right so now we have the situation where we could theoretically save the game to a file on the hard drive right but we're missing one step we we can save the f but we haven't actually updated any information so what we want to go ahead and do is something like creating a uh blueprint interface so we'll call this bpor persistence and we'll add a function called here request save so in this one we'll also say that we're going to send a a sync paramet so this will be uh the method that whoever wants to save is going to be calling upon and it's going to be specifying if it wants it to be asynchronous or not um in our uh game instance we want to implement this interface so BPI interface persistence sorry I did not name this properly so we're going to rename it quickly like so so that allows us to have the interface event here which is called request save so request save is a request from something but it doesn't necessarily mean that we will be saving that you can put logic here to actually uh decide not to save if there's like I don't know maybe the character is in combat or something like that it's completely up to you if you want to add validations to this um what we want to do at this point is we want to start communicating with uh I'm going to skip any kind of validations like what I just mentioned I'm just going to start communicating towards my save game now so what I want to do is I want to say to the save game I want it to have all the information updated uh for this save game and how we're going to be doing that is a little bit clean here in my opinion we're going to be uh creating a list of objects um which are of relevance for the game save so uh to do that first we will be creating another interface and we'll be calling it BPI unor savable so this will be something that's related to everything that is a savable object in the world so on the request save we're going to be saying uh get all actors with interface now this is something that that I don't normally make use of but a save is not something that you do very often uh so this is fairly fine BPI savable is what we want to have as that interface and now we get a result of actors this result of actors is something that we want to pass to our save game object our save game object can't get this information itself so the the game instance is getting it for us but we want to create a method in inside of uh the save game which then makes use of this information so we'll go to our save game I don't have it open it seems so here we go create a function we can call this uh save all data like so and we can say that it wants to take in uh an array of objects like so we can call these um savable objects so going back to our game instance again now we can go to our save game reference here and we can say save all data and we'll hook that up and send in the information which just gathered about all the the objects that are tagged as savable through the use of this interface now um once we are done with this we will consider ourselves having updated the save game object over here with the most um the latest information so at this point we can actually go ahead and say we want to save the game so we'll be calling save the game over here and we'll be hooking up the as synchronous flag like so so now we just need to do the logic of how do we actually update this information then right so we go to our save all data function inside of save all data we're going to be going ahead and doing this pretty simple we're going to be doing a for each Loop and then we're going to be saying we want to call in all of these and we want to say save data we don't have such a method right now if we go into our savable interface we can create one called um save data and as an input it will be taking a BP save game so what we're doing here is essentially sending let's name it something better uh save game ref so we're saying to all of these different objects that are holding some kind of information that's relevant for our save game to get a copy or a reference to the save game object so that they can fill in their information for for us so we're essentially just handing out a a map to different parts where we tell them come over here fill in your data and once you're done uh we're happy essentially so in our save game we're going to be calling this save uh save data and the save game reference that it wants to have here is of course the object itself that's working through this process and then once we're done with that we actually return and we're done so it's not more complicated than that actually like so so how do all of these things come together now well if we go to our in-game menu here now that had the save game button uh what we want to do here is we want to cost to our BP game instance and the reason for this is because we want to have access to uh the event dispatcher that we we created earlier so we want to bind to game saved like so and this is the event that we want to hook it up to although this is not H sorry like so we want to add an event because we actually have a parameter here so we get the save game reference here that we defined we'll call this um saving completed like so and then we say that we just want to close down the the the menu in this case the the UI that we have essentially uh you could have other logic here of course it all depends on what you're going for uh but this essentially says that since we're running this um that's all that it's going to be doing uh in addition to this we also want to uh tell it that we want to save um so we call the quest save there we go and we want to specify if it's asynchronous or not and since this is being done from a menu you may not want it to be uh cutting off all of the performance so you might want to have this as as synchronous so now we have the first functionality of actually saving information when we press the save button it's going to be saying okay call the game uh instance and we bind our event to say that okay once it tells us that the game is saved uh we will be running this code and after that we execute the actual uh request to save the game in the request to save the game we get all the actors with this interface which currently is none because we haven't set that up yet uh and then we say save all data uh on the save game object this in turn will call to all of those and say this is me I'm this save game object reference fill any data that you wants to have and once that is done uh we are back here and we can actually save down the file to the hard drive which will now be updated with the latest information so how does this look then well if we take something like our third person character over here I have created a variable called gold so this gold value is something that we want to save uh to this file let's say uh what we do is we want to implement the interface that says it is savable because this allows this interface to show up in our um get all actors method inside of this we have one method here we implement it and this is our key part where we actually fill any information here so our save game currently do not have any variables to store any data inside of it so we will be adding that so let's add something like uh gold and let's have it of the integer so it matches the other thing how you want to structure your data here if you want to have a bunch of it in in structures to have it organized in certain ways like Player information etc etc and arrays and such it's completely up to you I'm just keeping this simple so that you can follow along that it's very easy to expand upon this um in this case we have now a gold variable inside of our save game so if we go to our uh third person character we can say uh Set Go and we can say that the gold that it's going to be setting the value to is the gold that we currently have on our character and that's all it does so so this is the the population part so when the the save game sends out these pings to all of these um actors that have the interface that are savable they will be filling in their data uh sort of like they have been given a I don't know a a sheet to fill in a for form to fill in and uh then they're done essentially so that that's all that they're going to be doing there however saveable also means that we want to be loading something so let's add a load function since we're already here and this is very relevant to this and again we're going to be sending in a save game ref of the same BP sa game type going back to our third person character adding the load event here we're essentially going to be doing the same thing but in Reverse so from here we're going to be getting gold and we're going to be setting our gold to be that value so in one part we're saving it to the save game file from when we're loading it or reading it and setting it to our character okay so far so good now you can't save uh to the hard drive if you actually don't have the save game created yet so for me in this example I have a main menu where I have a button which says new game this makes for a pretty logical place for me to say something like okay well at this point we're starting a completely fresh run so we're going to be creating a new save game so that we're going to be tracking all our data in that save game uh so when we shut down that's where we have it so in this button currently all we're doing is we're opening our level one now we want add some functionality to actually uh create a game so um we're going to be casting to our BP game instance and then we want to have a function there which allows us to create our sa game object so going to our game instance we're going to be let's go up a little bit I guess and do a custom event and let's call this uh create save game inside of this we want to say we want to create save game object of the type BP save game now that we've created it we can promote it to a variable and we have that variable over here so we'll set it like so so in this case when I press main menu start on your game then it's going to create this save game object so we don't have null reference when we're trying to do something like saving to it later on okay we are starting to get some pieces to come together here now however we don't actually make use of anything we're saving right now so let's actually start working on actually loading up information as well because if we go and save the data that's not going to be helping us a lot uh for displaying it so let's add some functionality for that so inside our game instance we'll be add adding a further information here now uh one of the things we want to have is probably a point where you want to have a request for load information the same as we had one for Save information so inside of our uh let's see here save folder we have the BPI persistence we have a request save let's add a request load as well now the request load will be something that's sent from a specific actor or object or something uh so it says that I want to have my load sorry my save game information so I can load it into my variables so what we will be sending as a parameter here is actually going to be an object so an object reference and we can call this the requester so inside of our game instance we have now request load so our request load will will be handling whatever object is telling us that it wants to have its information we will more or less just be sending this further down into our save game and let it handle it so we'll create something like uh loading requested and have it as an object of single variable requester inside our game instance we'll just be calling using our save game reference loading requested so so it's up to the save game to deal with whatever is going to be needed to be done there uh inside of save game we're not going to be doing much we're just going taking this and saying uh load load game nope load what did we call it it's part of the saveable load data uh let's see game instance there no save game load data so this will be the information also here we'll be sending in our reference to ourselves like so and from that so now we're essentially getting a ping from a object saying that it wants to have its information so we're sending a reference to of ourselves to them so they can unpack it essentially so that's what's happening in our third person character it gets the uh this event that it's that it can pick its gold from and set its variable to but now you get the problem of well when do we request data since in Unreal Engine you have different classet that are going to be constructed at different points in time also other reasons might cause uh objects to be called at different points in time so what you do here is you have a event which requests for the loading of the data when it makes sense in this case we can say that when our character is being constructed so the begin play it is logical that that is the point when we want to make sure that it has its information so if we say uh get game instance and we say uh request load and the requester in this case is of course going to be a reference to ourselves like so this will be saying to the game instance that we want to have load information the game instance will then be saying okay save that send that to the save game save game will be saying okay well here's a refence reference of me and then you come back to the third person character with this interface call here which you can then get this information so you don't get this problem of like having to wait for certain objects to be done or or something of that nature each object will be responsible for itself for requesting a load and a save depending on what this functionality is going to be so in this case we have very few things that can actually say that we should be saving things but everything that's relevant for uh holding information will be requesting a load sending a load request to the game instance so now we need to actually read this information from uh the database actually I'm not super happy about this name let's change the loading request let's change it to load data for requester maybe that feels a little bit better uh anyway so in our game instance we need to add information so we can actually read a save game file from the hard drive so we'll get ourselves some space up here maybe uh we'll create a custom event uh we can call this one uh load game like so and in my case I have a main menu here where I have let me demonstrate I have a new game and a continue uh in this case you may not want to have the continue to be clickable if you don't have a active save game available uh in my case I don't have any such validation so I have to go in and make sure that I actually check that first so does save game exist is something I need to do to make sure that I don't try to reference a object that doesn't exist right now and it will be making use of the same save game slot that we have defined earlier based on this we will be taking one of two uh directions here one is that we do not have a save game slot in that that case we don't want to do anything because the continue button will be what calls this essentially so uh at that point we're doing nothing uh when it comes to the the true part however we do want to do something and we what we want to do is we want to make the determination if this is going to be on a synchronous or synchronous load just like we had for the save so let's add a parameter here of the type Boolean and call it async and let's do another branch and then check against this async like so so now that we know if we're going to do an as synchronous load or not we can call those specific values so get our save game reference so the the top one here is sync load uh am I hold on am I am I thinking am I remembering wrong load I syc slot like load game from slot I must have typed something wrong I don't know anyway so we going here so here we're doing a sync and down here we want to do a a load game from slot that's not a synchronous for the same reasons that we had before uh some of the time you may want to stop the game and and have it like focus on what it's supposed to be doing sometimes you might not uh this gives you the flexibility to do so uh it's probably because I used this one to hook up uh anyway so the save game slot here we're using are the same like so now we have our two different parts here um what we want to do now is when we do a load we get a base version of the same game and that is not what we we have here so we can't save it like a reference uh so we will be having to cast this to our BP save game we'll do that up here as well on the completed and then we set that this is the game that we're currently working with so we have all the information saved for later if we need it right in addition to this just like we did for the save game we may want to inform anyone who is interested uh to be notified that we have actually loaded the game so let's create an advent dispatcher called game loaded and we'll add a parameter of the type PP save game again because again they might be interested in the information that's in the save game save game ref and compile and let's call that on both of these situations so one we have done the synchronous one and the synchronous one we both let people know that we're done save game reference over here is going to be this one which we just saved over here could have just hooked it up like so of course okay so now we theoretically have the ability to load in a file as well let's see if we can make all of this come together now going way back to our main menu again we're actually going to be adding the create save game that we created earlier we didn't actually make use of that so now we have that one here and we can actually continue to open our level afterwards now we have created a game instance but we're not making use of it so we need to make sure that we actually make use of it so we go to Project settings and maps and modes and you replace the game instance with the one that you have created in our case BP game instance so now that we have our game instance here we're actually ready to like play around with this a little bit so to be able to save we have our save game in game menu that we created a button for and have some code for uh to load we need to have a continue button in the main menu that I created so inside of the main menu we have the continue button like before we need to have a uh game instance we can cost this to our BP game instance and we can call on that and say load game uh if we need to which we will be doing later we will be listening to our event as well so we know when to load the information uh actually let's do that at once so we'll do a uh bind uh game loaded like so let's try to do this a little bit better like so so so there's nothing more than this essentially so we add our event as well over here uh saying the game uh loaded load completed game game load complete that's fine on me that's a fine name and then we can say open a level let's not do let's do an uh open level by object reference we don't care about which level for now so we'll just do level one like so okay and this one I've chosen to asynchronous well not synchronous not asynchronous uh shouldn't make much of a difference in this case but you have the option at least so let's demonstrate this a little bit quickly now then so we have our main menu here uh we run it like so H we Press On new game we will be creating a new game we can go to our third person character over here we can see that the gold here I have made it instance editable so we can see how much it has so we have zero gold at this point and if we transition to a different level you can see we still have S gold and if we were to restart it would remain so I have however put in a debug key here so if I press that debug key we can see that it goes from 0 to 4 to2 so now we have 4 to2 here but nothing has been saved but if we go to the save game menu now we have run the save game code if we were to close this now and run again and press continue we should theoretically be loading up 42 gold so we can see that they actually saved it and loaded it up properly so that's a good first start I forgot to demonstrate um if we run again and press continue character we can see 42 gold we can also see that if we we change levels and go to our character we can still see that it has 42 and the reason for this is like what we talked about earlier um the third person character on its creation will be calling the if I can find it there the request for load which will be getting the save game data and it will unpack it and set its gold to be its value so every time it does a level transition it actually updates its information uh automatically by this means I'll be going through a more detailed summary and some flows so you can get a better understanding for how the system works um in a bit but before that I want to First spend some time showing how easy it is to expand upon this system so let's say we want to add some uh save game data so let's say our third person character here doesn't only have gold it also has uh silver so we add a variable to our character so now we have silver here okay uh then we need to be able to save that to our save game so we go to our save game we have a variable there call it silver okay now we have that what do we need to do else well we need to make sure that it's populated okay so we go to our third person character make sure that our population events are making use of this so we take the save game reference set silver and we hook that up if we are able to and silver okay I should really get electronic notes anyway so so now we're setting silver let's read out silver as well so we get silver from the save game we set our characters value to be that value like so and that's all that's all you need to do to add like one more parameter to your save game it doesn't require any more than this it's it's so flexible and easy to do it because there's so few places that are actually being changed because everything else is so Dynamic um to display that this works we can do a test we can do something like setting our silver on our character let's say that we want to have this and we want to have 999 silver silver so we go and start a test run we do a new game we go and click our character we see that we have let's make it in editable so we can actually see it as well there we go like so okay so uh new game character money broke all right let's fix that debug key bam 999 silver let's do something Fancy with it let's uh save let's quit let's play let's continue third person character 999 silver so that's how easy it is to to do something like that so but that's the the easy version uh what's the hard version what's what's the the most complex situation well it depends a little bit on what you're actually going to be saving but let's say that we have in addition to this information on our character we also have have a component called attributes in the case of our um game instance getting information for our save game let's see if I can find it here for you we get all the actors with interface that only gets actors acting components are not going to be found so to find something like a component on a specific actor we have to in this case like the third person character the third person character needs to implement the interface and then it needs to funnel it forward to our attributes so if we do something like um uh let's see here we'll do um we'll get first of all we can do this we can we can go into our attributes can see that we have a value here called Health it's 42 by default um if we go back to our third person character on the event when it gets an information to say that we need to save data we need to inform the the blueprint component as well right so the blueprint component we need to make sure that it has the interface so we add the interface make it savable like so it gets this functions and inside of the third person character we then say uh save data like so and the save game reference is the same one that we have over here so we're just funneling It Forward essentially but we might have multiple components we may not want to do this for all of them so what we could do is we could get components by interface and we can say that we want only want to get ones that are savable for example and we can and this is the case if you might have a lot of components of course which you may not but I'm just showing it so you you have the reference of of what you want to do so we Loop through that like so a loop body over there or [Music] element let's remove this one and say uh save data is what I'm trying to remember there we go like so so now we get a possible wider range of of components that all needs to have this information and only the ones that are interested are going to be getting this call right so we going to our bpc attributes we get these two methods we need to fill in and it's the same thing as before we need to make sure that our save game has the information so we add health it is of the type float we save we go back we say we want to uh get health in the load and we want to set our health to be whatever that is and we want to set Health in the save and set that to whatever we do have currently in our uh component right so in our third person character we can also add some de bugging for this we can say that we want to get this and we want to set Health to be I don't know 1 2 3 four so this would symbolize uh these being changed changed during runtime so let's test this out we go to our main menu we play we do new game we go to our third person character we find our attributes we find our health it it's 42 that's not correct that's the default value that should have been overwritten all right uh again uh we need to make sure that we tell the system also when we want to have information loaded so when we are created uh get instance uh get game instance we want to tell it that now is the time we want to load information so we'll do a load request so and the requester is going to be as always self and then once the save game gets the information about this it will send the data to us and we'll get this event and we'll set the health so let's see if that works uh we press play new game third person character attributes it's at zero excellent I press two it's get set to 1 2 3 4 excellent so now if we go and press save game and we quit and we play and we continue and we check our character and attributes and we can see that our health is maintained so that's the worst case that's the steps that you need to do if you want to add something like a completely different class that has information that's relevant for the save game so it's essentially just a few more steps you need to add the interface you need to add the methods uh for the load request the save data and load data and needs to add the information that's relevant for all of them which is the in the case here it was the the health and we add it to both this and to the save game and then everything else works it's it's so flexible for you anyway um this is the system in a nutshell now let's dive into actually explaining it a little bit more in detail so if you had trouble following along I made some charts for you to do if you at this Point understand everything then of course you can just stop watching you're pretty much done at this point but for those that want a little bit more in-depth explanation of how it works I'll take care of that now so there's one final thing I want to uh fix as well and show you why it's happening if we play and demonstrate we can see here we have a new game we go and we can go to our character we see that we currently have zero gold if we by debugging add 75 gold and assume that this is what we accumulated during this level and then leave to another level in this case we can go check our character and see that it has been uh erased the reason for this is that uh we're not actually saving when we're leaving the level we need to have another save game event when that happens and in this case I have a blueprint that lets us move to this different level and here's that uh we have a component that does uh an overlap check we check if it's the player character in this case that he is overlapping with the component and then we're moving to a different level now we need to expand upon this a little bit first off we need to take a game instance and we're going to cast it to our game instance that we created the reason for this is that we need access to the the the the binds the events that we created the event dispatchers so we will be binding here on save game or game saved rather uh doing it like so we can add an event over here so now we have an event that we can call Save completed or something of that nature and then we can say that we want to open our level once we're actually done with the saving uh and from the game instance we can also call request save we would like to do that through the request save through the interface like so and in this case we want to do syn synchronously because we we just want to save all the data and move on because we're leaving the level once it is saved completely then we can say that we won't open a level because then we have all data that's going to be relevant so let's try this again and see what happens so we play a new game we have Ser gold we give ourselves 75 gold we move out here we check we have 75 gold now this also have acted like a normal save like if we had gone to our menu uh which means that if we start playing this and do a continue we will actually having this gold as well so yeah that that's the little detail I want to make sure that you're understanding as well okay so here we have the the basic examples that I used in this case in my case I have a start new game button in that case I call the game instance and I say that I want to create the blueprint the blueprint for save game and then it opens the first level that's that's the whole flow for the new game uh part the continue part calls the game instance and says it wants to open a level from a specific save we didn't go through that in this case but we uh do the loading from the file in this case on the game instance so so that's the two basic menu flows now saving pretty simple in this case we have an object uh it could be like the menu it could be something like traveling levels it could be something like a save point they at some point want to tell the game instance that they are requesting a save the game instance itself it finds all the actors with the interface that are savable it then calls the save game class or the object with that information that it found it in turn will go through all of those different objects that it got and say you should be updating me with the information that you have that is of relevance because they have the interface so they are marked as someone that has information that we wanted to save to the save game file then after that is done it calls the same uh the game instance and it says save the the the file the save game to the hard drive and then it's done so this is the whole flow for saving it's not more complex than that it's very simple um when it comes to the Loading it's fairly similar uh an object that wants to know its save game data will be reporting at some point that it wants that information uh since objects are created at different points in time a begin play might be a usable and good place to have that information so that it gets updated at creation uh so on begin play it will call the game instance and say I want to load my information it will say to the save game object that someone has requested some information the save game will say to that object well here I am read any information that you want for me and that's all so so those are the the simple steps that this system consists of it's it's very simple it's it's very scalable it's very easy to maintain should be a very powerful tool and system for you to make use of anyway I hope that this was valuable and useful for you keep on learning take care a big thank you to all of you who like comment subscribe and share my videos or through other means support this channel you are what makes this channel grow and become a resource for other people to learn from
Info
Channel: LeafBranchGames
Views: 4,718
Rating: undefined out of 5
Keywords: learning hub, unreal engine, tutorial, unreal engine 5, blueprints, game design, game dev, unreal engine 5 tutorial, unreal engine 5 beginner tutorial, ue5 beginner tutorial, building user interfaces for unreal, engine ui design, user interface, design ui, design tutorial, building user interfaces, unreal engine user interface, Leafbranchgames, Good habits, Best practice, How to build menus and UI for Unreal engine 5, the right way, UE4, UE5, be a better game dev, tips, tricks
Id: 7gfA-QO5pA8
Channel Id: undefined
Length: 51min 30sec (3090 seconds)
Published: Tue Feb 20 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.