NewsTips and Tricks

Unreal Engine ‘Quality Of Life’ in Visual Assist 2021.2

The first two releases of Visual Assist this year contain some great Unreal Engine quality-of-life improvements you may want to take advantage of.

While we’ve always announced features in our changelog and release blogs, we’re starting to blog in greater detail about some of what we change — our December blog about reducing memory usage started this — and this time we’ll dig a bit more into two changes improving using Unreal Engine with Visual Assist.

This applies only to versions 2021.1 and 2021.2, the first two versions this year. If you’re reading from the future, there’s likely much more for UE than is described here!

There are two notable items in these versions:

  • Improving parse times for Unreal Engine projects
  • Removing unwanted generated headers and symbols

These mean that your Unreal Engine projects should be fully usable with Visual Assist faster when you open them, and that Visual Assist only shows and uses methods and other symbols that you’re really interested in.

Parse Times

When a solution is opened in Visual Studio, Visual Assist (VAX) parses that solution. This generates the databases of symbols and other data which VAX uses to be able to implement features like GoTo Related, extra syntax highlighting, parameter info, and so forth.

Parsing can take time. Although VAX is not based around a C++ compiler (one of its strengths), parsing is analogous to compiling a project, and while you can use VAX right away, some features require that data before they will work. Unreal Engine solutions can be very large. Therefore, we spend a lot of thought on how to speed up parse time to make the time between opening a solution and having VAX fully functional be as short as possible.

Avoiding Unnecessary Parsing

This following is going to sound ridiculously simple, and it is. What’s the best way to spend less time doing something? Not to do it.

We do focus on optimisations; the parse engine is heavily multi-threaded; the database uses considerably less memory than it used to; and other techniques. But ultimately, the best way to reduce parse time is to do less parsing.

Unreal Engine projects include plugins. These are additional libraries that add features to your game or project (in-editor or at runtime.) The UE editor lets you enable and disable these, so it’s common to have several installed but only use a subset of them. Yet, the presence of plugins is a key item that makes parsing a UE project lengthier. We added an option to turn off parsing them.

In 2021.1 we added an option to disable indexing these plugins. When off, the default, UE plugins were not parsed.

However, we realised this was based on a flawed understanding: that if plugins are third-party (as plugins often are) then you may not need them to be parsed into VAX’s memory: after all, we thought, you’re unlikely to do a ‘find references’ on an internal method of a third-party library. Omitting them from being parsed would not affect day to day use of Visual Assist. But we got feedback that it was more common than we thought for plugins to be first-party: that is, for UE developers to move parts of their game or project’s functionality into a plugin. That means that it was necessary to parse some plugins, and so a simple on/off parse all-or-none toggle was not useful.

In 2021.2 we expanded the setting so that Visual Assist can parse plugins that are genuinely used by your project, only. Today the ‘Index Unreal Engine plugins’ setting has three options for parsing plugins:

  • None: don’t parse anything in the Plugins folder. This reduces parse time the most
  • Referenced: parse only plugins references by the project, and referenced by default. Depending on how many plugins you have installed that are not used, this still reduces parse time. It is the recommended setting
  • All: parse all plugins; there is no reduction in parse time.
Visual Assist Options dialog, showing the settings to index all, referenced, or no Unreal Engine plugins

Real-World Performance Improvements

The amount of time saved by not parsing unused plugins depends on the complexity of your Unreal Engine solution and the specific machine on which Visual Studio runs, but some real-world measurements are as follows:

Time (minutes and seconds) to fully index an Unreal Engine project, when indexing UE plugins. The percentage annotations are the fraction the Referenced Plugins or No Plugins times are of the time indexing the same project with all plugins.

The absolute values may vary but we expect the relative percentage to be broadly applicable.

Notes

If you open a file from a plugin folder which was not parsed (either not referenced, or the above setting was set to None), then you will see a notification message that the file was not parsed and Visual Assist won’t provide your expected functionality for that file. This is shown only once, and won’t be shown again until Visual Studio restarts.

Avoiding Parsing UE-Generated Files

Saving a very useful change for last — there are many places Visual Assist shows you the symbols and files it’s aware of. The two main windows are Open File In Solution which lists all headers (and other files), and Find Symbol will list every symbol in the database. Unreal Engine, however, generates header files, and these include generated symbols, neither of which are useful in practice when coding on your UE project in Visual Studio.

Voila, a new setting, which means Visual Assist won’t show *.generated.h files, and the Find Symbol dialog is not polluted with generated symbols either. The setting is called ‘Index generated code’ and is off by default. That is, the default is aimed at clean results within Visual Assist, to not index these generated files and store those generated symbols. You can always turn it back on if you want the old behaviour.

Visual Assist Options dialog showing the checkbox to index generated code. By default it is off, which means the results shown within Unreal Engine will be cleaner

Unreal Engine with Visual Assist 2021.1 and 2021.2

The above covers only the first two releases this year, and we have more planned. However, the parsing speed improvements (including our followup for more granular parsing of plugins) and removing generated files and symbols by default should the general ‘quality of life’ using Visual Assist with Unreal Engine. As always, feedback is welcome!

Related posts
Success Story

Success Story: Visual Assist for modeling and simulation software for automotive C++

Tips and Tricks

Installing Unreal Engine 4/5 + Visual Studio: A complete step-by-step guide with pictures

Tips and TricksWebinar Recap

Setting up cloud-hosted Perforce source control for Unreal Engine [Webinar Recap]

Build Announcements

Visual Assist 2022.3 now available

Leave a Reply

%d