Hello, I’m using localization package v.1.3.2 and I’m facing long loading times on low end devices, more specifically on the Samsung Galaxy Tab A7 Lite.
As soon as the first scene starts, a loading spinner is displayed until LocalizationSettings.InitializationOperation returns using the following code:
private IEnumerator Start()
{
Screen.sleepTimeout = SleepTimeout.NeverSleep;
yield return LocalizationSettings.InitializationOperation;
#if UNITY_EDITOR
//delay to check how it looks in the editor, loads too fast otherwise
yield return new WaitForSeconds(1);
#endif
titlePanel.HideLoader();
}
When launching the app, it takes about 25 to 30 seconds to get passed the loader:
~ 10 seconds of black screen before it shows the loading spinner (I don’t know if localization or addressable affect this)
~ 15-20 additional seconds before the loader is hidden. (sometimes even more if the tablet happens to be busy with background tasks)
I have 3 tables: 1 string table with a little bit less that 300 entries, an audio assets table with ~175 entries and another audio assets table with 27 entries.
Is there any way to reduce the loading time of the localization table?
Maybe selectively choose which tables are loaded? Only the string table is needed to display the title screen, audio tables could be loaded later. I wasn’t able to find the “preload” option for specific tables that is mentioned in other threads so I assume all my tables are preloaded for the default language when the application start.
I would appreciate any advice.
Regards.
Preloading can be disabled in the metadata panel Asset Tables | Localization | 1.4.5
If you have no preloading then I would not expect much of an impact on the startup time. Try using the profiler to see what is taking so long.
If it’s addressables you could try switching to using uncompressed asset bundles. The option is part of the addressable group settings.
Thank for you answering this fast.
I don’t know why but every tables were set to preload, I don’t know if it’s by default (the documentation does seems to imply it’s not the case) or if I set that during my tests at some points in the past.
Leaving only the string table for the default locale as preloaded solve the issue. The loading spinner is barely visible now. Selecting another language is also blazing fast now.
However, as the preloading time was so long when loading the other string tables and audio assets tables as well, I was expecting the audio part to break and not being able to play correctly without additional code to make sure the audio was properly loaded before playing the first voice lines but that’s not the case, everything is smooth and audio have no noticeable delay to play.
So I’m a bit confused now
Is LocalizedAudioClip.LoadAsset()
only loading the needed asset and thus is fast ?
The documentation you pointed seems to indicate that when not preloaded, the table must be loaded, then the asset. That’s why I was expecting the delay from the preload to bite me when playing my first sounds but everything is fine now.
LoadAsset uses synchronous loading so it will be faster however it does block the main thread until loading is completed the first time and this can be a significant delay, especially if the asset bundles are remote. However it’s working for you so no worries