UE-81677 Additional Details

RE: UE-81677 UnrealMathTest fails when compiled with VS2019

I am using Visual Studio 2019 Pro (v.16.3.5) and am experiencing this error as well. From my research, it appears that that this happens with the C++ code optimizer when it tries to do a fast normalize – it uses an uninitialized register. This appears to be a compiler level bug.

Effect: Vectors, rotators, and any math which depends on square roots (ie, normalization) will be quite off and you’ll get glitchy behavior (objects appearing/disappearing at random, wrong textures, other rendering artifacts).

Best Practice: Avoid updating to the latest version of Visual Studio 2019 until Microsoft issues a compiler hotfix (No ETA).

Workaround: If you already updated visual studio 2019, the work around is to use the visual studio installer to install the 14.22.27905 build tool chain and then modify the UE4 “\Engine\Saved\UnrealBuildTool\BuildConfiguration.xml” to point to that compiler version. I have verified that this works.

References:

Is there a solution to this when building a project, rather than the whole engine? I’m building a plugin as part of a project, and need this fix, as I updated to the latest VS2019.

This is a compiler level fix. You can’t (and shouldn’t) apply this per project or per plugin.

I’m not trying to compile the whole engine - I’m using a version of the engine from the Epic Launcher. I have a plugin that I’m wanting to compile, and I usually do this by making it a project plugin and compiling the project/plugin together. I’m hoping that there is a way of building this that I can apply the fix to.