still using Localization, and still pretty happy with it! Unfortunately, we now got a blocking bug when trying to release on PS5VR2. The issue is a noticeable lag when switching locales in game (we allow players to switch their locale manually if they want to).
I profiled this, and what shows up in the profiler is two things in two frames following the switch.
a) I get a lag of about 20ms after switching the locale (with LocalizationSettings.SelectedLocale= newLocale) when the first string is retrieved (s.GetLocalizedString()).
b) I get a huge lag of over 100ms when the canvasses are updated. We have a quite large menu with lots of translated texts. The lag occurs in TextMeshProUGUI.Rebuild() after the end of the frame.
We are trying to get this waived but if we can’t, we need to address this. Do you have any suggestions on how to spread these two things out over several frames?
Edit: The initial error in the first post was without preloading. Now, we preload all tables: A string table, an image table, and an audio table. The issue a) changed a bit to the following:
On the current instance I see three consecutive frames where Loading.LockPersistentManager (underneath EarlyUpdate.UpdatePreloading()) has times of 10ms to 25ms.
As for issue b), the TextMesh updates, we fixed that by disabling (enabled=false) all instances of LocalizeStringEvent and, spread out over multiple frames, reenabling them. That seems to work out.
I might not be entirely certain about the preload feature. We have “Preload All Tables” ticked for all three of our tables. I am assuming that “preload” means at system start. That’s correct, right?
System start is not the issue for us. We are seeing this later in the game when changing the locale, but not at the locale change itself, but as “the aftermath” of that change. I can provide additional data, let me know what you need.
As I said above, the second issue with the text updates can be migitated by delaying those (bit of a PITA, but works). Unfortunately, we still get a PS system message about missed flips when switching which might be a deal breaker, still waiting on Sony to decide.
Preloading all will help reduce the initial lag of switching language as it won’t need to load the new language.
Can you share some profiler captures?
I’m away this week so my response may not be until next week now.