But all I see is the usual, Vector, int etc… not ‘game related data’ like an Actor or something. Can someone please explain why and if this is any different to using standard .sav files? They contain the same data anyways. I think I am misunderstanding it’s usage.
I basically have a procedural mesh that I was wondering if I could save it and load it, instead of creating it every time I need it. That’s what I thought write out literally any game-related data you want implied I could do.
Because otherwise I’d just save the vertex array and other arrays to a standard .sav file and load from that. But that seems the same as what’s been done in the link.
Save objects (.sav files) are the generic way to store data between levels and application launches. They are simple to implement and for the most part, they handle all serialization of the data for you. However, there are limitations to what can go into a save object. For example, you cannot save uobject data as normally you will pass references/pointers.
Another limitation of the save object is that you have no control of where the data is saved i.e. inside the …/Project/Saved/SaveGames/ directory. There may be instances where you may want to specify where data is written to disk.
To handle scenarios where the save object will not be sufficient, you have the ability to create a custom save system and write what ever data you require and specify its location. The downside is that these objects take longer to set up and you will get little support from the engine when writing / reading the data. I.e. you are in charge of assigning and clearing the memory.
You can export textures using render targets, but lets just say for this example that render targets don’t exist. You wouldn’t be able to save a texture in a save object as the transient memory used for the texture is loaded on the GPU only giving you a reference. Using a custom save system you can pull the MIP data from the texture and write that to the harddisk.
Save objects are usually suffient and as I mentioned, quite easy to implement in either BP or C++. Custom objects require more work, but give you more freedom to the data you wish to save.
I still don’t understand why someone would want to create their own. Other than for file location freedom. Is there anything that this custom save method can save that the normal UE4 save system cant? I mean, with the texture, a normal save obj can save its raw bits to an array. That’s what this custom one would need to do also, correct? If so, why make a custom saver? I’m still confused
Thanks for the clarification, but it’s a tad stating the obvious. (with all due respect)
One of the reasons I have used a custom save system was to store large amounts of JSON data from the internet and stored into the content directory. This is so the data will be packaged when I build the project. At run time I query the stored data to see if it’s still relevant, or if an update is required. This prevents the application from needing to download all the data every launch and just update any changed data.
I will then filter the data into various structs to be used at run time and these are serialized in a standard save object for use between levels.