After about 3 days of ever so elusive bug hunting, I finally found and fixed the issue which was relating to disappearing inventories, buildings, and even occasional crashes. The crux of the issue was a race condition for multiple things being saved at the same time. This meant they could override each other and break the state of the database, then, many bad things would start to happen. This is now fixed.
This patch also introduces some safety measures to help communicate the current save state:
- Items which are in the process of being saved will now show a "Saving..." tooltip and be blocked from usage until they are completely saved. This will help prevent lag causing new unsaved items to be used in constructions, quests, and other places.
- Buildings which are not yet saved will now show a hint "Details about this building are being decided." rather than allowing you to start building it prematurely.
For very large saves, they may make more apparent some lag. However, the huge stability improvement is worth it for everyone. In these large saves, you may also occasionally think that items have not saved, especially if you are placing a lot of new buildings at once. They may briefly dissappear from your inventory - but rest assured, they are there, it's just that the huge save will cause some time for them to properly be saved and show-up. Of course, there will be optimisations heading this way in the future too!
Changed files in this update