Hello Tony,
I've noticed some serious peaks in profiler considering Bark On Idle, sending you a screenshot.
Best!
Bark On Idle profiling
Bark On Idle profiling
- Attachments
-
- BarkOnIdleProfiling.jpg (105.98 KiB) Viewed 710 times
Re: Bark On Idle profiling
Hi Artur,
Yes, starting a bark can involve a lot of work. The "quick fix" if you don't use conditions is to tick Cache Bark Lines.
The most expensive operations are usually:
For example, say you have a character "George" that barks some lines when he's hurt ("I'm bleeding!", "Am I gonna die?", etc.) and other lines when he's healthy ("Hi!", "Nice day, eh?"). Say you have also registered a Lua function "IsHurt(characterName)" that returns true if the character is hurt.
If you temporarily set the profiler to Deep Profile, you can get more details about what's taking the most time. It's probably Lua conditions, but it could be something else such as spinning up the sequencer or setting up the bark UI if it uses a lot of Unity UI auto-layout features.
Yes, starting a bark can involve a lot of work. The "quick fix" if you don't use conditions is to tick Cache Bark Lines.
The most expensive operations are usually:
- Evaluating Conditions on dialogue entry nodes that link from START.
- Running sequences.
- Any OnBarkStart methods in your scripts that do heavy processing.
For example, say you have a character "George" that barks some lines when he's hurt ("I'm bleeding!", "Am I gonna die?", etc.) and other lines when he's healthy ("Hi!", "Nice day, eh?"). Say you have also registered a Lua function "IsHurt(characterName)" that returns true if the character is hurt.
- Create two conversations, for example titled "Hurt Barks" and "Healthy Barks". Don't put any Conditions on the dialogue entry nodes. (Or at least minimize the number of Conditions if possible.)
- Add a Bark On Idle component to the character.
- Assign the "Hurt Barks" conversation.
- Tick Cache Bark Lines.
- Open the Condition foldout, and add a Lua condition: IsHurt("George")
- Add another Bark On Idle component to the character.
- Assign the "Healthy Barks" conversation.
- Tick Cache Bark Lines.
- Open the Condition foldout, and add a Lua condition: IsHurt("George")==false
If you temporarily set the profiler to Deep Profile, you can get more details about what's taking the most time. It's probably Lua conditions, but it could be something else such as spinning up the sequencer or setting up the bark UI if it uses a lot of Unity UI auto-layout features.
Re: Bark On Idle profiling
Tony,
thank you very much!
Best!
thank you very much!
Best!