Page 1 of 1
PersistentDataManager ignores "Include All Item & Quest Data"
Posted: Tue Oct 19, 2021 6:14 pm
by VoodooDetective
I was just profiling our game and noticed that PersitentDataManager.AppendItemData() was taking a long time even though we have "Include All Item & Quest Data" deselected.
Code: Select all
public static void AppendItemData(StringBuilder sb)
{
if (!includeAllItemData) return; // <<-- this is missing maybe?
try
{
There's some very expensive code right below.
Re: PersistentDataManager ignores "Include All Item & Quest Data"
Posted: Tue Oct 19, 2021 8:20 pm
by Tony Li
Hi,
When includeAllItemData is false, it's still supposed to run the code, but it will only record quest statuses and quest tracking info. Do you need to save quest states? Perhaps there should also be an option to save no item & quest data?
Are you sure AppendItemData() is the culprit? Usually it's the conversations, especially SimStatus.
Re: PersistentDataManager ignores "Include All Item & Quest Data"
Posted: Tue Oct 19, 2021 9:44 pm
by VoodooDetective
Ahh gotcha! I misunderstood what that checkbox was doing. I shouldn't say "very" expensive, but I was seeing it take 60ms or even when it was saving zero data. I think the .Find() operation among other things was taking some time.
Re: PersistentDataManager ignores "Include All Item & Quest Data"
Posted: Tue Oct 19, 2021 9:54 pm
by Tony Li
I'll optimize that out in the next update. It'll be better to cache some data at the start of the method instead of using Find().