Page 1 of 1
Need help in optimization
Posted: Wed Nov 04, 2015 2:12 pm
by nishant
Hey ,
I was trying to optimize my code and found that DialogueSystem causes spikes in the game.
This happens when I start a conversation from script
using
DialogueManager.StartConversation("conversation name");
Is this not the proper way to start conversation ??
I am also attaching a screenshot for reference
Re: Need help in optimization
Posted: Wed Nov 04, 2015 3:55 pm
by Tony Li
Hi Nishant,
You can reduce the load of ConversationModel.SetParticipants() by specifying GameObject transforms:
Code: Select all
DialogueManager.StartConversation("conversation name", actor.transform, player.transform);
Otherwise SetParticipants() will try to find appropriate GameObjects in the scene using the expensive Tools.GameObjectHardFind(), which examines every GameObject in your scene.
If your participants aren't associated with GameObjects already, you can create empty GameObjects to pass to StartConversation().
Also, on the Dialogue Manager click
Preload Resources. This will load the database and dialogue UI at the start. If it's not ticked, these resources are lazy-loaded the first time they're needed, which can cause a momentary spike.
Re: Need help in optimization
Posted: Wed Nov 04, 2015 6:12 pm
by nishant
Thanks ... As always your quick response fixed the issue

Re: Need help in optimization
Posted: Wed Nov 04, 2015 7:18 pm
by Tony Li
As always, happy to help!
