How to save game progress with scriptable object references?

Hello, I am making an rpg and I am storing the “base” item and character data in scriptable objects. That is the fixed data I don’t want to be changed during run time and works fine.

Now I want to save the game progress, including the inventory contents and what characters are in the players party. I need to save some kind of reference that would allow me to, when loading saved game data, read some kind of identifier and get access to the scriptable object that contains the properties of the item or character.

I am considering using the name of the scriptable object as an identifier or adding an identifier field to the scriptable objects. However, that sounds prone to failure as it implies manual management.

Is there a better way? Are instanceIDs reliable identifiers though differente builds?

I came through the same problem a while ago. As you realized, we can’t serialize scriptable objects. So to retrieve items for my player inventory I made a struct called InventoryMemory which has an ID and a Quantity (2 int), the ID retrieves the items he possesses from the item pool on my inventory system script. (an item array that has all the item I must manually drop in…) It works well for me so far but sure doesn’t feel that robust. I plan to make an editor script that adds all my items in this array with the click of a button.