Saving one property in scriptable object.

Discussion and help for Easy Save 3
Post Reply
rd3d
Posts: 4
Joined: Thu Nov 23, 2023 8:30 am

Saving one property in scriptable object.

Post by rd3d »

Hi there!

I have a scriptable object that contains a lot of properties (some lists that grow), and that I have saved.

Later, I wish to modify and save just one property in this big scriptable object. Is there a way to just update that one property and save, or do I have to save the entire scriptable object again?

I'm concerned that as this scriptable object grows, the save time will start to increase. So I would rather just update and save the single property that needs changing rather than entire object. Is this possible with ES3?

Likewise, if I wanted to just save 2 or 3 properties, is this also possible?

Cheers!
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Saving one property in scriptable object.

Post by Joel »

Hi there,

You would need to save the entire ScriptableObject again, or instead of saving the ScriptableObject, save it's fields separately.

Note that generally a ScriptableObject with loads of fields isn't going to be particularly intensive to save unless the fields themselves are complex types (i.e. Meshes, Textures). If the ScriptableObject only contains basic types such as primitive types, Vectors, Quaternions, etc, it shouldn't have any issue dealing with hundreds of these (at which point you'd probably want to consider breaking your ScriptableObject down into multiple ScriptableObjects for maintainability anyway).

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
rd3d
Posts: 4
Joined: Thu Nov 23, 2023 8:30 am

Re: Saving one property in scriptable object.

Post by rd3d »

Thanks for clearing this up! Much appreciated.

Does the size of the of .es3 save file contribute to the save time?

For example, if I save just a single int under a given key, would the save time to file be longer if the file size of the .es3 is bigger?
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Saving one property in scriptable object.

Post by Joel »

Number of keys is usually a much bigger factor than file size, but in both cases you can follow the Improving Performance guide to improve this significantly:

https://docs.moodkie.com/easy-save-3/es ... rformance/

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply