Huge delay and freeze on first run on iOS

More
4 years 1 month ago #896 by adamliu
Hi. I am using the newest version 2.6.0 b4. In editor the I2 Localization works great, but when I deployed it on iOS and run it for the first time, the plugin will cause the device freeze for 10 - 15 seconds when I open a scrollview (with 20 uGUI Text localized) and it pulls the translations from google spreadsheet instead of local language source. But when I force the app to quit and run it again, everything seems working fine, no noticeable delay and it doesn't use google spreadsheet anymore. Can you tell me what the issue is? Is there a way I can disable it from using the translation from the spreadsheet and only use local data? Thanks!

Please Log in or Create an account to join the conversation.

More
4 years 1 month ago #899 by Frank
Hi,
The plugin always uses the Local translations to localize.

However, every some time, it contacts google and downloads new updated translations. This process happens in the background, while the game is playing.
What will happen is that after you get the data from google, the game suddenly re-localize all text/fonts/images/etc.
But the game should never be waiting for the data from google.

Normally, when I see a lag when localizing, is when the localization changes fonts/images that require Unity to load all those assets.
Also, when using dynamic fonts and switching to a language with different characters (e.g. english->chinese) or in you case, when opening a window with lot of new text. If you are using dynamic fonts, every time a new character or font size is used, Unity has to recreate the font atlas texture and add the new character/size. That's usually the biggest cause for lag.

What I have done to reduce the lag is to not use dynamic fonts. Instead I'm using pre-rendered bitmap fonts or an SDF font like TextMesh Pro or Smart Edge.

If you want to try disabling the updates from google, you can open your Language Source, and in the google spreadsheet tab, changes the Update frequency to "None". That wont prevent the source to import the spreadsheet every time you manually click the "Import" button, but will stop downloading translations when running the game.

Nonetheless, As soon as I get back, I will debug the code a bit to make sure that there is no regression in 2.6.0 that could stall the game while waiting for google.

Thanks,
Frank

Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out

Please Log in or Create an account to join the conversation.

More
4 years 1 month ago #900 by adamliu
Wow this is really helpful. I am translating between Chinese and English, and using Dynamic fonts. I think this is very possible the reason of my problem. I'll look into it and thank you for your help.

Please Log in or Create an account to join the conversation.

More
4 years 1 month ago #901 by adamliu
Turned out its a bug from Unity. I was using the latest 5.1.2f1, and it has a bug that leads to the unbearable lag. And luckily it's fixed in 5.1.2p1. Thanks for the reply though, it's still very helpful.

Frank wrote: Hi,
The plugin always uses the Local translations to localize.

However, every some time, it contacts google and downloads new updated translations. This process happens in the background, while the game is playing.
What will happen is that after you get the data from google, the game suddenly re-localize all text/fonts/images/etc.
But the game should never be waiting for the data from google.

Normally, when I see a lag when localizing, is when the localization changes fonts/images that require Unity to load all those assets.
Also, when using dynamic fonts and switching to a language with different characters (e.g. english->chinese) or in you case, when opening a window with lot of new text. If you are using dynamic fonts, every time a new character or font size is used, Unity has to recreate the font atlas texture and add the new character/size. That's usually the biggest cause for lag.

What I have done to reduce the lag is to not use dynamic fonts. Instead I'm using pre-rendered bitmap fonts or an SDF font like TextMesh Pro or Smart Edge.

If you want to try disabling the updates from google, you can open your Language Source, and in the google spreadsheet tab, changes the Update frequency to "None". That wont prevent the source to import the spreadsheet every time you manually click the "Import" button, but will stop downloading translations when running the game.

Nonetheless, As soon as I get back, I will debug the code a bit to make sure that there is no regression in 2.6.0 that could stall the game while waiting for google.

Thanks,
Frank

Please Log in or Create an account to join the conversation.

Time to create page: 0.165 seconds
Template by JoomlaShine