Performance spike on trigger conversation (new)

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
juanchodeth
Posts: 8
Joined: Fri Feb 11, 2022 1:55 pm

Performance spike on trigger conversation (new)

Post by juanchodeth »

Hey, just posting this issue here as it has been bugging me for a while. I tried the solutions given in other similar posts on this forum, but none of them worked for me (preload ticked, logs set to none, a trigger with a delay sequence on start, etc.).
On each character, when the player enters the trigger, I get a spike just for a moment, even in simple conversations without any sequence or fancy text. I’ve attached a screenshot of the profiler during one of those spikes (this specific one has some SetActive sequence lines that might be contributing to the spike, but it shouldn't be that aggressive).
Image
User avatar
Tony Li
Posts: 21980
Joined: Thu Jul 18, 2013 1:27 pm

Re: Performance spike on trigger conversation (new)

Post by Tony Li »

Hi,

You'll need to dig deeper into that call. I understand that not all of your conversations use SetActive(), but it might be a case-by-case thing. For example, when you activate a GameObject (e.g., via SetActive()), it runs all of the OnEnable() methods on all scripts in the GameObject's hierarchy, performs occlusion culling and level-of-detail checks, and more. Let me know how I can help.
juanchodeth
Posts: 8
Joined: Fri Feb 11, 2022 1:55 pm

Re: Performance spike on trigger conversation (new)

Post by juanchodeth »

Sorry for the delay in responding. I’ve been doing more tests, mostly with dialogues without any sequences, just text, and in all the tests, it seems that the load is here, but I don't know what the cause is.
Image
Each time the player enters the trigger to call the conversation, there is that micro lag spike, I guess the example I showed on the first post was an extreme one, with the SetActive adding more load, but even without sequences playing, there are lag spikes.
For the game, I'm only using Dialogue System triggers that start the conversation when entering their trigger (also without added sequences), and for the canvas, I’m using the barks that come with the project (with some visual modifications).
User avatar
Tony Li
Posts: 21980
Joined: Thu Jul 18, 2013 1:27 pm

Re: Performance spike on trigger conversation (new)

Post by Tony Li »

Hi,

I see that Sequencer.LateUpdate is calling something that's calling FindObjectsOfType.

Are you using any Dialogue System Events components in which something is assigned to the OnSequenceEnd UnityEvent? Or are you using any scripts that have OnSequenceEnd() methods? If so, maybe these are calling FindObjectsOfType.

At any time, please feel free to send a reproduction project to tony (at) pixelcrushers.com. I'll be happy to take a look directly and let you know what's causing the spike.
Post Reply