(UE4 4.26) How to handle multiple UI Widgets with performance in mind?

In short for a VR project my menu system requires multiple “windows” to display types of information like Equipment, Stats, Skill Trees, Inventory, Quest Log etc. However each type of window (Inventory Vs Skill Tree for example) are vastly different in their interactions with the player and how much “blueprinting” is needed to set up these windows with information etc, so I am a little unsure how to handle this.

widgetproblem
Currently the setup is handled by 3 unique Actors with a widget component that are displaying a widget blueprint (Center is navigation menu, Left and Right are a window displaying one of the aforementioned stats at a time).

Until now for Window C for example, I would have an ‘Inventory Widg’ and a ‘Quest Log Widg’, that are both inside a parent Widget Blueprint. Then simply hide ‘Inventory Widg’ when I need Quest stuff showing, visa versa etc. Yet considering Window A and C could potentially have 4 different unique types of information windows each, that’s potentially 6 hidden windows worth of blueprinting that doesn’t have to exist at this time so to speak.

I’m by no means an expert so any advice/questions/answers would be helpful, thanks!

honestly, i wouldn’t worry about it too much, tho one thing to keep in mind is widgets may not be destroyed fully (ie memory leak) unless you wipe your current level, so do keep that in mind. i struggled with this for a while, till i bit the bullet and came up with a level refresh system. you can also reuse widgets to combat this, but thats a bit of a pain.

for the raw performance tho, generally avoid canvas if you can. its a generic, non specialized widget that can be pretty heavy with enough widgets. you need like a few hundred widgets tho, so 6 isnt a big deal. there are other specialized widgets that may be worth looking into, like list view or widget switcher.

unreal also only acts on widgets that are actually active, so they will just stay in memory and not use up any CPU time (you could have 10,000 widgets that you “removed from parent” and it would feel the same as if you had none)

Thanks for the reply. Hadn’t heard of those kinds of widgets and will look into them.

I had a feeling this would be ok, just wanted to clarify before I invest more effort into this area so I don’t have to redo work later :slight_smile:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.