Hi ,
While using profiler in my game , I noticed that Dialogue UI kindof slows things down while starting a conversation. Are there any tips to optimize it ?? Yes I am using Preloaded resources and passing actor and conversant transforms which did improve the performance drastically , but I am wondered if it can be improved further?. So when I start a conversation , basically DialogueManager.StartConversation and Text.UpdateGeometry takes more time. I am more concerned about Text.UpdateGeometry as it drops me fps to 50 fps till the dialogue text disappears.
Thanks.
Nishant
Optimize Dialogue UI
Re: Optimize Dialogue UI
Hi Nishant,
Does it happen only the first time you start a conversation, or every time?
Part of the slowdown may be the Show/Hide animation. To test this, temporarily clear the Show and Hide fields in the dialogue UI's Animation Transitions foldouts. There are Animation Transitions for the Dialogue Panel, Subtitle Panels, and Response Menu Panel. If this speeds up the performance, then take a look at the animation clips and see if you can optimize them.
The other slowdown may be the layout elements, such as Vertical Layout Group, Horizontal Layout Group, and Content Size Fitter. Try to simplify your dialogue UI hierarchy to eliminate as many layout components as possible. The Generic Unity UI Dialogue UI has a lot of automatic layout components because it doesn't make assumptions about how the developer wants to lay out UI elements. In your own dialogue UI, you should be able to simplify it significantly.
If you've set the Dialogue Manager's Debug Level to Info, this may also cause significant temporary slowdown because it will log a lot of information to the Console view, which is a slow operation. If this is the case, try setting the Debug Level to Warning.
Finally, to specifically address Text.UpdateGeometry, there are a few things to try:
Does it happen only the first time you start a conversation, or every time?
Part of the slowdown may be the Show/Hide animation. To test this, temporarily clear the Show and Hide fields in the dialogue UI's Animation Transitions foldouts. There are Animation Transitions for the Dialogue Panel, Subtitle Panels, and Response Menu Panel. If this speeds up the performance, then take a look at the animation clips and see if you can optimize them.
The other slowdown may be the layout elements, such as Vertical Layout Group, Horizontal Layout Group, and Content Size Fitter. Try to simplify your dialogue UI hierarchy to eliminate as many layout components as possible. The Generic Unity UI Dialogue UI has a lot of automatic layout components because it doesn't make assumptions about how the developer wants to lay out UI elements. In your own dialogue UI, you should be able to simplify it significantly.
If you've set the Dialogue Manager's Debug Level to Info, this may also cause significant temporary slowdown because it will log a lot of information to the Console view, which is a slow operation. If this is the case, try setting the Debug Level to Warning.
Finally, to specifically address Text.UpdateGeometry, there are a few things to try:
- Untick Best Fit.
- Don't use an abnormally high Font Size. Above 64 often causes performance issues.
- Set Font Style or Normal.
- Remove Outline or Shadow components.
Re: Optimize Dialogue UI
Hey Tony,
Yes it happens every time. Thanks for the tips; I will try them out soon and let you know regarding its outcome
Yes it happens every time. Thanks for the tips; I will try them out soon and let you know regarding its outcome