Images in invalidation box moving to back of layout

Hello, all. I have been working on optimization recently and have been implementing invalidation boxes to reduce total slate tick time. While this has seen reduced slate tick time, it also has had the bizarre side effect of the images within the box disappearing from the widget and not returning. This happens both with images that are only set on initialization and others that can be set on user input. This happens with very little consistency. Different widgets disappear each time this occurs.

Some other info:
Toggling full screen with F11 brings them all back, but they will typically disappear soon after, at random.

Some of these images are in front of a button, and when they disappear, I can see the button, meaning they either moved to the back of the layout, which I find unlikely, or they went transparent.

While random, it seems to occur when I build (spawn) a building (possibly due to loading the static mesh?) however, this theory implies the boxes’s cache was dropped, which is not reflected in the logs.

Finally, with the images that can be set on user input, they work fine, until they disappear. however, once they disappear, the user input that previously caused them to change has no effect, until F11 toggles fullscreen, after which it works normally.

I have spent several hours on this and am out of ideas, does anyone have any theories or solutions?

I’ll take any help I can get, even general advice about invalidation boxes or alternate ways to handle this problem. I’m new to UI optimization and could use everything, even some general stabs at the problem.

Surely the unoptimized version isnt that bad I never any time optimizing anything and I usually don’t have any issues with performance or anything.

The total Slate tick time was just over 5ms before the optimization. With the invalidation boxes, that time fell to ~3.5 ms.

Currently, at “maximum strain”, which my game reaches in most cases, total game thread time is somewhere between 17-19 ms, much closer to 17 when optimized. If I were to apply this to the rest of the UI, I could cut slate time to 2ms or less, get the game thread under 16ms, and finally get the game running at 60 frames.

The optimization is necessary. Other optimizations are in progress, but 5 ms for the UI is quite a glaring inefficiency.

If it doesn’t work with the optimizations, you might just have to remove them. Invalidation boxes seem like a bit extra.

I’ve lowered some expectations to get stuff working before, but I don’t think choosing between an extra 5ms per frame and non-functioning UI is the play here.

got any screenshots?

UI set up for the selected UI.

What did you want screenshots of?

What does it look like when its running?

I have determined the images are rendering behind the backing image for some reason. It is as if their Z-order is changing at random. I went and ensured everything had an explicitly defined Z order, but the behavior has not changed.

Also, I removed all code related to changing anything to do with changing these images or the backing image. The issue still occurs. While not consistent, it seems to happen when I spawn buildings (static meshes) into the level.

Also, when played in PIE, this issue does not occur but does in standalone. When in PIE, however, health bars (User widgets in the level) clip through the UI on the screen where they do not in standalone.

The question to solve now is: why does spawning static meshes cause images in invalidation boxes to move behind other widgets with lower z orders (and stay there)?

Also, have I not provided enough information, or is this problem unsolvable? This has been up for the better part of a month now.

Could you make cutouts for the images so they don’t move to the back of the layout?
Also, you have the “minimap” in an invalidation box and that you don’t say breaks, so can that be a factor?

1 Like

I like the idea, however, I want to do the same with the text boxes as well, for which cutouts won’t work as the text changes.

Also, the minimap has no backing panel, so that is why it isn’t broken.

I replaced the backing image with a border, but this did not help issues. The widget reflector revealed identical properties in images that moved behind the layout and not, and this includes the Z-order.

Finally, doing things like forcing pre-pass and invalidating layout manually doesn’t work, but using F11 to toggle full screen does. What does toggling fullscreen do to cause the images to render properly?

For the sake of anyone else who finds this in search of help: I have given up.

For over 3 weeks I have done little developing other than trying to solve this issue. I have tried far more than I posted here, but I believe I have posted what is important enough to matter. My obsession with solving this issue has taken a toll on my sanity and has pushed me closer to complete burnout than I have ever gotten. I am using retainer boxes to limit performance hogging and I am just going to leave it there. If you are struggling with invalidation boxes, good luck.

1 Like