Saving What I Want in Blueprint

Hi !

I’m a bit newby in making games and got a question about saving in Unreal using Blueprint. I looked at tutorials etc and i understand how the system works. But I have a question because tutorials show how to but not a real impemented system.

Let’s say I have a little 10minutes game with 3 levels. The game is very scripted so if I save I must to know many things that happened in the game.

There are some value I always want to save, for exemple : levelName playerPostion playerHealth … So I can makes variable in the save Blueprint.

But, If I have many thing that changes in every levels. In the first Level i have like 10 interactions with element in the environment and I must know which one I used. In the second I got 20 interactions etcetc.

My question is, what is a proper way to saves to elements?

I found 3 options and I don’t know if there is a better way to do this, or which one is the most common.

1° (the bad) Make a Big Save File that got over 100 variables for each interaction in every levels and set those variables while the player progress.

2° (the IDK) Make 1 default save with the persistent information (playerPos,CurrentLevel…) and then many little save file for each level.

3° (the IDK if Its Possible) Make 1 file, without any variable, and then build it while I play, and removing useless information. When Istart the game I load and check what was saved, if the value isn’t in the save file, I set it to default. But I don’t know how to “create from nothing” a variable and store it in blueprint.

Is there a better solution?

How do you save your games?

I am also interested to see people’s answers to this.

Here’s a tutorial I found helpful for this though:

It sounds like you could use the same basic method, a ForEachLoop for each of the actors you have in the level, but with boolean flags for whether the interaction you’re saving took place.

When you say ‘interactions with element’, how are you currently storing them? And can you give a detailed example?

Well it’s a short game very scripted. Basically each level is a puzzle and I would like to be able to save at every moment.

To load back at the exact same situation I was, i need to know for exemple, hw many times i pressed a button how many time I passed trought a door, where the NPC was, did I got spotted by him… Stuff like that. Also there is many little cinematic that i need to remember if they were played.

There is 5 level, without instance (basically you load all the level when you start) because it take place in little rooms.

Hi Crocsx343,

For saving, check out our documentation on saving via blueprints, this should get you the information you need:

hi Adam,

I already read many documentation, I know how to save.

My question here is about the best practice on how to do it.