If I update my game and then load an old save, some changes made are not there. how do i update the save as well? Obviously what does not appear are bp_item that are saved. if I start a new game there are all the updates. can you help me?
I wondered this as well, there’s hardly any information about it.
If you have MySaveGame with, say, 20 variables. Later, you decide you need more variables and add them to the save game. You can still open the old save game with the new code, it’s just that the new variables won’t get set.
A serialization process occurs during the read, whereby the variable types and names are matched.
What you can’t do, is make a totally new class, MyNewSaveGame, and expect to be able to load the old save game into that. Also, if you change the type or name of a variable, it won’t work ( that variable won’t load ).
When I did it, I was a bit paranoid, and make a new save game in a new slot. That definitely works
Tnx, but how do I patch the game without losing the progress of the old save file?
When you package a game, there is no save game in the package. The save game gets created on the local machine at runtime.
So when you package a patch, it can’t touch the save game.
( Unless you use a packaging mode other than ‘shipping’ ).
I give you an example because I can’t explain to me.
My game has 6 golden chest that are also saved in the save file.
I play my game, build a house and collect all the chest.
Save the game.
If I load my game I have the house and there are no more chest in the world.
I update/patch the game by adding 3 other chests around the world (for a total of 9).
I run the updated game, but when I load the old save there is the house but there are no 3 new chests.
If the game starts from the beginning there are 9 chests.
How do I solve? Can I get the game from the beginning to each patch?
Thank you! ^^
It sounds like there isn’t an easy solution to this problem since you could technically change the format of your save file any way you’d like in the patch. This doesn’t sound like the most optimal solution but you could make a new Save Game class for each patch and then when you load the save object, check if it is an older Save Game object, create a new SaveGame object, and just move over the old properties and populate the new ones.
Ok, let’s talk about chests. Imagine you collect or open them.
Game version 1: 6 chests. I collect or open 3, 3 left. The save game knows I have opened 3.
Now I want to patch the game, and give the house 10 chests. That’s in the game update, it’s not in the save game. The save game still knows I opened 3.
See what I mean? You put the new chests in your level, they are not in the save game.
All that’s in the save game is, ‘did the player open chest X’?.
I see what you’re saying. Your keeping part of the game layout, in the save file?
Why not just actually put 9 chests in the level / game?
If I’m getting close, describe your system in more detail, then I can help more…
If I added 3 chests in the world with the patch, I would like to see them also by loading the old save. But should I also update the old save file? How?
Ok, you’re not really giving me any info, so I’ll have to make something up.
Let’s say you have an array of bools in the save game, one for each chest ( has it been opened ). 6 chests, 6 bools.
But then you add 4 more chests in a patch. And you add 4 more bools to the array in the save game. But the old save game still only has 6, right?
You need to write the code that talks to the save game so it always makes space for the right number of booleans. If you had an array, you would do it like this
It can take the array of only 6, and add the new chest in there, and then write the SG back to disk.
Does it make sense?
[ You have to write the code that talks to the modified part of the save game, so it takes into account it might be looking at an old save game ]
I am using a package from the marketplate already done with its own save system (Easy Survival RPG) I have not created the save system, I just know that any Blueprints I add to the map (chests, pigs, etc …) do not appear if I load an old save and I don’t know how to do it , I’m inexperienced with save systems, but they all update the games with patches and DLCs and then continue the game with the old saves.
Ah, then it might be a problem.
Can you give me a link to the asset ( on the market )?
You need to ask them this on Discord. This is a whole system, and you need to stay within the confines of it.
I wrote here because on their discord channel no one answers this question, already tried 2 times.
Tricky one, I’m afraid. You need to see how it’s saving, and figure out if that can handle dealing with a new save game…
Thanks anyway, you were very kind
Sorry I wasn’t much help …
So what I’m saying is you have a blueprint class you created for your saved object, yes?
We’ll call that BP_SaveGame_01
.
This stores that the player opened 3/6 chests.
Then you patch the game and add 3 more chests.
You create a new blueprint, BP_SaveGame_02
.
This stores 0/9 chests.
Then when you boot up the game, you check if it is valid to cast to the BP_SaveGame_02, if not, you cast to BP_SaveGame_01.
Now you transfer the properties from the old save into a newly created BP_SaveGame_02 so BP_SaveGame_02 has 3/9 chests.
Then when you save the new BP_SaveGame_02!
You’re creating a new SaveGame Blueprint for every patch!
It appears the OP is using a marketplace product. Tweaking the save game is not an option…