Differentiating Saving Variable Locations

Quick question, where should I save; level data (data on the level), Character Score Data (i.e. gold), and Character items/stats? Is it wise to put them into different save files?

Can someone clear this up for me, thank you.

Hello De Ocean Pirate!

Is up to you, but I think is better to save a game in a single file to keep things tidy.

I suppose you need to save and load all that objects at the same time so why don’t use a single file?
But if you need to save them in a separate file you can do it.

Thanks, it is because I am having trouble, I load my level but not the character data.

Can you explain better and show some code? I wish to help

I posted a topic ages ago looking for a solution;
( Loading Level, and then the Save Data - Blueprint - Epic Developer Community Forums )

I was trying to continue my game from where it left off, by loading the character info, then the level, and then the spawn point, but as soon as it loads the level it forgets to load the character info, rather frustrating, it will do 1 function but not both. It was also the reason why I stopped working on my project.

Don’t give up!

I took a look at it, I think you should tidy up your code and my suggestion is to use functions for smaller and simple tasks. And avoid things like failed or does save exist in functions, those have to do a simple task and always successfully… In my opinion, but not only mine.

Live complex logic for event graphs.

Also… One important feature of functions is that it’s reusable.
If you have a logic that is not copied in many parts of your code you don’t have to use functions.

1 Like

Cheers I tidied up most of my functions and placed them in the correct blueprints for firing. What about saving actual level data? Would I just have to call and save all actors? What if the levels have been in the past?

Hello! Sorry I haven’t replied you before…

There are many ways you can do that, the first thing to keep in mind is the type of game you are creating. What do you mean for level in the past? Do you mean that you can return to finished levels?
Save all actors can be fine, or you can make a struct whit all the data needed for each actor and load that data before start playing.

The best thing is to plan an architecture of the save-load and start level relationship.

1 Like

probably your blueprint that loads the other 2 files was an actor. Actors are destroyed when a level unloads (which normally happens when you load another level). Objects such as gameinstance still live because they are not tied to the game world or levels.

This is why Input all my saveobject loading logic in my gameinstance object. I put saving logic anywhere else it is needed because saving doesnt matter so mich when or where you do it but loading always matters what order you do it.

1 Like