PersistentDataManager ignores "Include All Item & Quest Data"

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
VoodooDetective
Posts: 222
Joined: Wed Jan 22, 2020 10:48 pm

PersistentDataManager ignores "Include All Item & Quest Data"

Post 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.
User avatar
Tony Li
Posts: 22158
Joined: Thu Jul 18, 2013 1:27 pm

Re: PersistentDataManager ignores "Include All Item & Quest Data"

Post 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.
VoodooDetective
Posts: 222
Joined: Wed Jan 22, 2020 10:48 pm

Re: PersistentDataManager ignores "Include All Item & Quest Data"

Post 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.
User avatar
Tony Li
Posts: 22158
Joined: Thu Jul 18, 2013 1:27 pm

Re: PersistentDataManager ignores "Include All Item & Quest Data"

Post 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().
Post Reply