[Loading Data] New issue appeared when trying to deserialize via InventorySaver

Ignatios

New member
Hey there,

I dug around on the forums here but couldn't find a search bar for previous topics, so my apologies if this has already been discussed and resolved.

Recently my saving/loading has not been working, and I couldn't figure out why but after a long time debugging, I finally found a warning that pops up after loading the game data and trying to deserialize.
Code:
Saved Item ID 836986638 could not be retrieved from the Inventory System Manager.

I'm not sure why this is happening. The item in the Database has a different default ID than the one being saved, but it seems to be randomized when I run the game (when I view the inspector and take a look at the item in the inventory, it has the ID 836986638, but in the database before I run the game, the default ID is 3811135883). I assume this is due to all the serialization happening such as specific scene runtime data, but maybe that is the culprit.

I can post more info about my specific setup, but I'm hoping someone has a "Oh yeah! I ran into that and it was because of xyz reason" :)
Again, everything was working fine, but suddenly it just stopped working out of nowhere. I was thinking the database became invalid or corrupted but that doesn't seem to be the case.

Thanks in advance!

EDIT: Please note that at this point, I'm just starting the game with empty inventories and grabbing 1 item that is effectively a potion, then saving the game and closing out. I then just try to load the game with that 1 item, which is why I get 1 warning with that information I noted above. The same warning occurs multiple times if I grab more items and then save/load.
 
Last edited:
I tracked down the issue. In the end it was due to a corrupted data type. The "Usable" category had become corrupted somewhere down the chain, causing all usable items to not be loaded when deserializing. I'm not sure if there is a way to track this, or prompt the dev that there is an issue with the item... oh well, but I'm glad it's solved.

For future devs who run into similar issues, try making a "test" category and deriving items from that new category to make sure there isn't an issue in your category chain.

Once I resolved this, I noticed swords and shields (and everything else) were saving/loading properly.
 
My assumption would be that the item you were using was an Immutable&Common item. But in the Inspector you changed an item attribute making it "custom". The issue is that the system does not support saving those custom Immutable&Common items. The save system assumes Immutable&Common items are all the same. so it only saves the ID, it doesn't save any information about their attributes. The reason being that they are immutable, meaning they cannot change.
But at the same time the system doesn't prevent you from spawning a custom Immutable&Common item, this makes a new item, with different attribute values and therefore a new ID which is kind of a double edge sword because they cannot be saved.

At least I'm glad you were able to fix your issue.
 
Top