So, I’m currently working on a project where I need to have a developer tool that shows buttons that control which tiles of this grid are selected.
(Image 1)
I’d say I did a pretty good job on that, however there was quite an unexpected performance problem… (One that we didn’t foresee)
Task Requirements:
You see the grid size can be a maximum of 35x35 (Which is a Requirement), which is 1225 buttons that can show up on this “Editor Utility Widget”…
With the use of scale boxes, and scroll boxes, and a uniform grid, I’m able to create these 1225 buttons in the way you see in.
(Image 2)
And here is the button: (Image 3)
As for the code inside of the button… I’ve made sure that nothing uses any ticks.
So each button on spawn is entirely event-based.
So while they appear on screen, essentially nothing in their code is firing.
Here’s what I did:
I followed possible solutions from this UMG Documentation at:
Optimization Guidelines for UMG in Unreal Engine | Unreal Engine 5.0 Documentation
-
I’ve discovered that I had used a bit too many nested scale boxes and horizontal/vertical boxes, so I compromised and decreased them.
-
I’ve also discovered that I had the problem “Use Event-Driven Updates Instead of Bound Attributes” mentioned in the link, and also fixed it.
At this very moment and given the requirements of my task, and with my high-spec PC…
I’m able to get 30 FPS with the 35x35 requirement.
(Image 4)
And 39 FPS with the 35x35 Requirement IF I remove the root scalebox. (Found at Image 2)
So… my question is, what else could I do to show 1225 buttons on the screen, have them scaled correctly, have an option to scroll, and make them uniformly spread in a grid.
Which I haven’t already done?
Perhaps there’s a way to show how much processing this “Editor Utility Widget” is using?
Perhaps I don’t need to do that if I can immediately fix an obvious problem that I may not have realized?
So yeah… I’d appreciate the help.