Download

FAQ: StreamingFAQ: UMG

Dec 1, 2020.Knowledge

If using both server travel and client travel, what are the right places in the code to add Show() and Hide() calls?

  • This will vary depending on your game’s flow, but binding to FCoreUObjectDelegates::PreLoadMap and FCoreUObjectDelegates::PostLoadMapWithWorld is a good place to start.

Could you explain more about using external modules for loading screens? What is the difference between this and using UMG?

  • Using a separate module for loading screens decouples the functionality from your game module(s) and enables you to reuse the code in other projects. The ARPG example runs the loading screen on the slate thread instead of UMG, so it’s smooth and unaffected by the level loading happening on the game thread.

What is the recommended method to efficiently style the UI?

  • With UMG you make blueprints of widgets that are reused everywhere so if you need to change the style of a button, you just make a blueprint of the button and just update the blueprint which will propagate the changes to all live instances. You can also make style assets shared between widgets and update those assets instead of the widgets directly.
  • We have an internal system built on top of UMG called CommonUI which makes this a lot easier. We’re planning to release this to licensees in the future.

Are there any solutions for Discord or Twitch integration?

  • We don’t have any out-of-the-box solutions for Discord or Twitch integration. Our media framework supports playback of some streaming formats, so it may be possible to embed a Twitch stream that way.

Web Widget. Is this ever going to be fully implemented?

  • It’s unlikely that it will ever be considered “complete”, as there are many CEF features that aren’t supported or come with large performance costs that we want people to be wary of. If you’re running into any specific issues, feel free to open a UDN ticket and we can route that to the proper team.

Are there optimizations that are coming down the road?

  • We’ve recently been experimenting with an invalidation-based mode for Slate that has given some significant performance gains. Those changes are available now in beta via the Slate.EnableGlobalInvalidation console variable, and we’re ironing out bugs as we encounter them.

A release update recently cited tools in the editor that could be created with UMG. What is the intended use case for that?

  • Editor Utility Widgets were conceived as an upgrade/replacement for Blutilities, which empowers our designers and technical artists to quickly create tools in the editor without needing a programmer to code it for them. We don’t plan to use it for any editor functionality that we ship for performance reasons, but we’ve used it on game projects to quickly create tools for tasks like generating minimaps or finding and replacing deprecated data

We had to implement a loading spinner in native code so that it wouldn’t hitch. Is there any way for UMG to display something that will not hitch?

  • Plenty of things don’t hitch, but if you do something in UMG that forces a sync load, that’s going to hitch - same as any other asset. There’s nothing else intrinsic about UMG that’s any different than native, save for the fact that it’s backed up by UObjects for blueprint integration and the ability to easily reference assets and have those cook correctly.

What is Epic’s thought on using materials in UMG?

  • Using materials is the best approach

We are planning on using Rich Text as our default rather than try to juggle between two different types of text boxes. Are there performance concerns?

  • Rich Text Blocks are heavier weight than the traditional UMG text blocks. If performance isn’t a concern in the cases where you’re using them, it should be fine. However, you may run into problems in places where performance is important, especially in text that updates often. You may need to do some profiling to see what works best for you.

What is the benefit of UserWidget templates?

  • Under the old approach (duplicating each thing via serialization), widget creation costs could be extremely costly in CPU time. By building up a completed tree with everything fleshed out, UE4 can use that as an archetype in UObject creation so that it works like a CDO.
  • To reduce the memory, in the blueprint properties you can set up the widget to not generate a template by default, we do that for several that are never themselves directly created, but are always included inside of other widgets that we create. E.g. if A is your inventory and B and C are widgets that are always just placed inside of A in the designer, you can disable template creation for B and C, and at Editor time we log an error if you do try to create B or C directly.

Ways to get HTML into UE4?

  • You can try loading your UI through a web view. There’s also an HTML menus plugin. It might be easier to rebuild into UMG than to try to get it in your project.
1 Like