[Mobile] Changing language to Arabic causes permanent lag!

Hey,

So in my App I have implemented support for 10 different languages, which is working great.

I change language by using the “Set Current Language and Locale” with bSaveToConfig set to true.

I support Arabic / Simplified Chinese / English / German / French / Spanish / Portuguese / Japanese / Korean / Russian.

Out of all of these languages, Arabic ALWAYS causes lag.
I’ve checked the Font and some minor stuff but I can’t see what the issue is and why it’s lagging.
I know Arabic is Right to Left and I’ve tested if changing my UI to Right to Left would remove lag, but it doesn’t…

All texts have a single universal font asset that they share, which dynamically changes symbols and all that based on Unicode character ranges. There is no visual errors, other than the heavy lag that occurs.

I really need some ideas here, I checked Unreal Slacker discord with search bar and no matches, google doesn’t have anything on the topic either. (Even with short consistent keyword searches)

1 Like

So for future users that might come across this, the issue was tracked down to “GameThread->FrameTime->Total Slate Tick Time->SlatePrepass”, what this means is the Layout Pass was continuously updating my UI, full TICK style.
The first information I came across pointed me towards **SScaleBox::FArguments::SingleLayoutPass** which would make the UI only capture first frame and reduce FPS/latency drastically.

For 4.25 I couldn’t find this setting, and after even more research I found “InvalidationBox” which ultimately was the solution I went with.

How does InvalidationBox work?

I put mine as the Parent of all other UI components in the Class and then in the Class Code I simply called “Invalidate Layout and Volatility” when I wanted to recapture the UI, a good scenario would be when you want to toggle the Widgets visibility to Visible. IF that doesn’t work wonders for you, try InvalidationBox->SetCanCache to false and when your UI animations are over, toggle it back to true and call InvalidationBox->InvalidateCache.

Another helpful tips is to always set your UI elements to “COLLAPSED” and not to “HIDDEN”, reason being that Hidden UI elements still goes through Layout Pass while Collapsed UI elements don’t. Saves a lot of frames!!

Cheers to all future readers! Was a hard thing to learn.

1 Like