top | item 45111273

Speeding up Unreal Editor launch by not spawning unused tooltips

206 points| samspenc | 6 months ago |larstofus.com

86 comments

order

bob1029|5 months ago

From a purely technical perspective, UE is an absolute monster. It's not even remotely in the same league as Unity, Godot, etc. when it comes to iteration difficulty and tooling.

I struggle with UE over others for any project that doesn't demand an HDRP equivalent and nanometric mesh resolution. Unity isn't exactly a walk in the park either but the iteration speed tends to be much higher if you aren't a AAA wizard with an entire army at your disposal. I've never once had a UE project on my machine that made me feel I was on a happy path.

Godot and Unity are like cheating by comparison. ~Instant play mode and trivial debugging experience makes a huge difference for solo and small teams. Any experienced .NET developer can become productive on a Unity project in <1 day with reasonable mentorship. The best strategy I had for UE was to just use blueprints, but this is really bad at source control and code review time.

blashyrk|5 months ago

I felt the exact same way until I tried Hazelight's AngelScript UE fork. It is amazing, it brings the developer experience and iteration speed to Unity levels. They even made a VSCode plugin for it. Cannot recommend enough

Agentlien|5 months ago

I have worked full time for five years with a combination of Unreal and Unity. I've also worked for five years with Frostbite and another five in various custom engines.

I absolutely love both Unreal and Unity. Unreal is amazing from a technical perspective and having worked with a talented team in Unreal the stuff we were able to make were mind-blowing given the resources we had.

Unity is way easier to work with if you aren't focused on high fidelity graphics. In fact, I've never tried any engine that felt as easy to work with as Unity. I would absolutely not call it a monster. Even with a fairly green team you can hit the ground running and get really productive with Unity.

MountainTheme12|5 months ago

My issue with Unreal is that Epic puts little effort into improving the developer experience, focusing instead on churning out tech demos, flashy visuals and half baked features that only become usable after several major releases (if ever). The artists at my company love it, the developers not so much.

cheschire|5 months ago

And blueprints take forever to wire up in my experience compared to just writing the C++ directly.

stemlord|5 months ago

That's extremely unfortunate given that Unity is becoming financially hostile gouging enterprise customers, and apparently Godot is not quite mature enough to compete. Game engines are quickly becoming a problem

Melatonic|5 months ago

Is Cryengine still relevant at all ?

I'm also always surprised we don't see more games on the current gen id software engines

markus_zhang|5 months ago

I think UE is so good at graphics that there is no reason to use it for most of the developers. I don't understand why many indie developers chose to use it.

TGower|5 months ago

Blueprints can be a great learning tool, if you double click a node it will open a VS window with the actual C++ code function.

smittywerben|5 months ago

NEW QUEST: "These New Gaming Requirements Are Unreal"

OBJECTIVE: Any project that demands HDRP and Nanometric Mesh

BONUS: Find the happy path

hinkley|5 months ago

Any time a library in your code goes from being used by a couple people to used by everyone, you have to periodically audit it from then on.

A set of libraries on our code had hit 20% of response time through years of accretion. A couple months to cut that in half, no architectural or cache changes. Just about the largest and definitely the most cost effective initiative we completed on that team.

Looking at flame charts is only step one. You also need to look at invocation counts, for things that seem to be getting called far more often than they should be. Profiling tools frequently (dare I say consistently) misattribute costs of functions due to pressures on the CPU subsystems. And most of the times I’ve found optimizations that were substantially larger improvements than expected, it’s been from cumulative call count, not run time.

smittywerben|5 months ago

Dare me to say costless leaky abstraction. Then I'll point to the thread next door using Chrome profilers to diagnose Chrome internals using Scratch. Then I'll finish saying that at least Unreal has that authentic '90s feel to it.

thaumasiotes|5 months ago

This was originally submitted with the title "Speeding up Unreal Editor launch by not spawning 38000 tooltips", a much closer match to the actual title of the post, "Speeding up the Unreal Editor launch by ... not spawning 38000 tooltips".

Why has it been changed? The number of tooltips improves the title and is accurate to the post.

adithyassekhar|5 months ago

This reminded me, I saw tooltips being a large chunk when I profiled my react app. I should go and check that.

Similarly, adding a modal like this

{isOpen && <Modal isOpen={isOpen} onClose={onClose} />}

instead of

<Modal isOpen={isOpen} onClose={onClose} />

Seems to make the app smoother the more models we had. Rendering the UI (not downloading the code, this is still part of the bundle) only when you need it seems to be a low hanging fruit for optimizing performance.

trylist|5 months ago

I remember solving this problem before. These are both global components, so you create a single global instance and control them with a global context or function.

You basically have a global part of the component and a local part. The global part is what actually gets rendered when necessary and manages current state, the local part defines what content will be rendered inside the global part for a particular trigger and interacts with the global part when a trigger condition happens (eg hover timeout for a tooltip).

aiiizzz|5 months ago

That breaks the out transition.

Cthulhu_|5 months ago

Alternatively, how many modals can be open at any given time? And is it a floating element? May be an option to make it a global single instance thing then, set the content when needed. Allows for in/out transitions, too, as another commenter pointed out. See also "Portals" in React.

pathartl|5 months ago

In the Blazor space we use factories/managers to spawn new instances of a modal/tooltip instead of having something idle waiting for activation.

The tradeoff is for more complicated components, first renders can be slower.

WhereIsTheTruth|5 months ago

I once made the mistake to buy some sound effects from Fab, I had to download the entire Unreal Engine and start it to create a project to then import the assets..

It took the whole afternoon

It's no wonder UE5 games have the reputation of being poorly optimized, you need an insane machine only just to run the editor..

State of the art graphics pipeline, but webdev level of bloat when it comes to software.. I'd even argue electron is a smoother experience tan Unreal Engine Editor

Insanity

Cthulhu_|5 months ago

It's just like your computer and IDE, you start it up and never shut it down again.

Wouldn't it taking the whole afternoon be because it's downloading and installing assets, creating caches, indexing, etc?

Like with IDEs, it really doesn't matter much once they're up and running, and the performance of the product has ultimately little to do with the tools used in making them. Poorly optimized games have the reputation of being poorly optimized, that's rarely down to the engine. Maybe the complete package, where it's too easy to just use and plop down assets from the internets without tweaking for performance or having a performance budget per scene.

redox99|5 months ago

It took that long because it had to compile shaders for the first time. After that it would open in seconds.

daemin|5 months ago

Yet it is the engine dominating the industry and beloved by artists of all kinds.

To get UE games that run well you either need your own engine team to optimise it or you drop all fancy new features.

drbig|5 months ago

> It's no wonder UE5 games have the reputation of being poorly optimized

Care to exemplify?

I find UE games to be not only the most optimized, but also capable of running everywhere. Take X-COM, which I can play on my 14 year old linux laptop with i915 excuse-for-a-gfx-card, whereas Unity stuff doesn't work here, and on my Windows gaming rig always makes everything red-hot without even approaching the quality and fidelity of UE games.

To me UE is like SolidWorks, whereas Unity is like FreeCAD... Which I guess is actually very close to what the differences are :-)

Or is this "reputation of being poorly optimized" only specific to UE version 5 (as compared to older versions of UE, perhaps)?

Sharlin|5 months ago

Hmm, so what exactly is stored in that gigabyte of tooltips? Even 100,000 tooltips per language should take maybe a few tens of megabytes of space. How many localizations does the editor have?

lukan|5 months ago

It is not the text data. It is that every tool tip gets made into an UI element.

"Firstly, despite its name, the function doesn’t just set the text of a tooltip; it spawns a full tooltip widget, including sub-widgets to display and layout the text, as well as some helper objects. This is not ideal from a performance point of view. The other problem? Unreal does this for every tooltip in the entire editor, and there are a lot of tooltips in Unreal. In fact, up to version 5.6, the text for all the tooltips alone took up around 1 GB of storage space."

But I assume the 1GB storage for all tooltips include boilerplate. I doubt it is 1 GB of raw text.

kg|5 months ago

This is one scenario where IMGUI approaches have a small win, even if it's by accident - since GUI elements are constructed on demand in immediate mode, invisible/unused elements won't have tooltip setup run, and the tooltip setup code will probably only run for the control that's showing a tooltip.

(Depending on your IMGUI API you might be setting tooltip text in advance as a constant on every visible control, but that's probably a lot fewer than 38000 controls, I'd hope.)

It's interesting that every control previously had its own dedicated tooltip component, instead of having all controls share a single system wide tooltip. I'm curious why they designed it that way.

lentil_soup|5 months ago

No idea why you're getting down voted but that was my thought as well.

With immediate mode you don't have to construct any widgets or objects. You just render them via code every frame which gives you more freedom in how you tackle each UI element. You're not forced into one widget system across the entire application. For example, if you detect your tooltip code is slow you could memcpy all the strings in a block of memory and then have tooltips use an index to that memory, or have them load on demand from disk, or the cloud or space or whatever. The point being you can optimise the UI piecemeal.

Immediate mode has its own challenges but I do find it interesting to at least see how the different approaches would tackle the problem

bob1029|5 months ago

Unity uses an IMGUI approach and it makes all the difference in the universe. Overriding an OnDrawGizmos method to quickly get at an editor viz of a new component is super efficient. There are some sharp edges like forgetting to set/reset colors, etc, but I much prefer these little annoyances for the convenience I get in return.

AFAIK, UE relies on a retained mode GUI, but I never got far enough into that version of Narnia to experience it first hand.

krzat|5 months ago

How does this compare to React-like approach (React, Flutter, SwiftUI)?

It seems like those libraries do what IMGUI do, but more structured.

0xml|5 months ago

Don't have access to read the code, but I think ideally there should be only one instance created at startup, right?

RossBencina|5 months ago

At most one instance at start up. Asynchronous creation or lazy creation on first use are two other potential options. Speaking generally, not Unreal-specific.

Yiannis128|5 months ago

They really need to rewrite the whole editor, or at least strip down unused systems... The whole thing being that big is inexcusable...

Stevvo|5 months ago

I recently decided the fastest way to work with Unreal is to throw it out and go with something else. It's like 10 fucking minutes to compile an empty project.

I like Godot primarily because of GDScript; you are not compiling anything so iteration time is greatly reduced. Unigine is also worth a mention. It has all the modern features you could want like double precision, global illumination etc but without the bloat and complexity. It's easy to use as much or as little of the engine as you need; in every project you write the main() function. Similar license options to Unity/Unreal.

ehsankia|5 months ago

Kinda annoying that the article doesn't really answer the core question, which is how much time was saved in the start up time. It does give a 0.05ms per tooltip figure, so I guess multiplied by 38000 gives ~2s saved, which is not too bad.

charlie-83|5 months ago

"Together, these two problems can result in the editor spending an extremely long time just creating unused tooltips. In a debug build of the engine, creating all of these tooltips resulted in 2-5 seconds of startup time. In comparison development builds were faster, taking just under a second."