I was profiling my game for some frame rate drops that were happening- I noticed this part of Dialogue System being called which was causing some performance spikes-
I haven't tested it in builds yet as I know some things don't show in builds- Is it only called once per scene load etc? Just thought I'd get your opinion on it- thanks.
UnityUiQuestTracker and GC (SOLVED)
-
- Posts: 8
- Joined: Sat Dec 08, 2018 2:01 pm
UnityUiQuestTracker and GC (SOLVED)
Last edited by mdotstrange on Sat Dec 14, 2019 3:31 am, edited 1 time in total.
Re: UnityUiQuestTracker and GC
Hi,
If possible, use the StandardUIQuestTracker instead of the older UnityUIQuestTracker. The StandardUIQuestTracker has further optimizations. However, both of them use pools so they will allocate memory only once when it sets itself up. If you add more quests to be tracked, it will allocate more to grow the pool, but since it uses a pool it won't keep freeing and reallocating memory. The process of updating the tracker does use a little memory, but it only occurs when you update the tracker. Make sure you're not updating the tracker every frame or something like that. It only needs to be updated when a quest state or quest variable changes, and in most cases the Dialogue System will automatically tell it to update so you don't have to do anything.
If possible, use the StandardUIQuestTracker instead of the older UnityUIQuestTracker. The StandardUIQuestTracker has further optimizations. However, both of them use pools so they will allocate memory only once when it sets itself up. If you add more quests to be tracked, it will allocate more to grow the pool, but since it uses a pool it won't keep freeing and reallocating memory. The process of updating the tracker does use a little memory, but it only occurs when you update the tracker. Make sure you're not updating the tracker every frame or something like that. It only needs to be updated when a quest state or quest variable changes, and in most cases the Dialogue System will automatically tell it to update so you don't have to do anything.
-
- Posts: 8
- Joined: Sat Dec 08, 2018 2:01 pm
Re: UnityUiQuestTracker and GC
Thank you for the detailed response. I'm not updating the tracker/invoking anything related to it manually. It seems to happen 10-20 seconds after game start.
Is there a place in the doc's where it shows how to switch to the Standard tracker? Thank you.
Is there a place in the doc's where it shows how to switch to the Standard tracker? Thank you.
Re: UnityUiQuestTracker and GC
Hi,
There's no specific documentation for switching to the StandardUIQuestTracker. Just replace the UnityUIQuestTracker script and the UnityUIQuestTrackTemplate script from the child GameObject with the corresponding StandardUIQuestTracker and StandardUIQuestTrackTemplate scripts, and reassign the UI elements.
There's no specific documentation for switching to the StandardUIQuestTracker. Just replace the UnityUIQuestTracker script and the UnityUIQuestTrackTemplate script from the child GameObject with the corresponding StandardUIQuestTracker and StandardUIQuestTrackTemplate scripts, and reassign the UI elements.
-
- Posts: 8
- Joined: Sat Dec 08, 2018 2:01 pm
Re: UnityUiQuestTracker and GC
Will do, thank you.