I finally got around to setting up ue5 yesterday. I sometimes forget about the build times. Like it was all a fever dream. 12979.21 seconds ( so says VS2022 ) is 3.6 hours. 🤕 And that was after making changes to its build configuration ( below. )
To be fair, a lot of that is down to C++ itself. It’s just a slow language to compile. Not only template expansion, but header file management and the rules that #define
imply for them. ( side note: C++ modules are super exciting. UE doesn’t have any .ixx
files (yet?) but there is a bEnableCppModules
documented - so possibly that’s coming. Porting #include
to #import
is no joke. There’s 9k+ header files in Engine/Source/Runtime alone. )
Beyond messing with the build config, i had to remove AutoRTFMTests
from the generated vc project as there are apparently some issues with it.
But all in all – even if the compile is grinding slow – it’s impressive that it simply works. There’s a lot of moving pieces to Unreal. That i can clone it from github, run a couple of batch files, and get the editor running successfully with minimal hassle is the result of a lot of behind the scenes work.
Build fixes Link to heading
Prior to the build xml change, the ubt decided that it should only use 1 core and 1 action. I had let it run for several hours before i noticed it wasn’t making any meaningful progress in the 6714 tasks it had to complete.
<!-- %APPDATA%\\Unreal Engine\\UnrealBuildTool\\BuildConfiguation.xml -->
<?xml version="1.0" encoding="utf-8" ?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
<BuildConfiguration>
<MaxParallelActions>6</MaxParallelActions>
<bAllCores>true</bAllCores>
</BuildConfiguration>
<ParallelExecutor>
<MaxProcessorCount>16</MaxProcessorCount>
<ProcessorCountMultiplier>8.0</ProcessorCountMultiplier>
<MemoryPerActionBytes>512000000</MemoryPerActionBytes>
</ParallelExecutor>
</Configuration>
Setting the number of max parallel actions to more than the number of cores on my pc caused pch generation to run out of swap space. ( An issue which gets its own webpage listed in the build output.1 )
The sweet spot for me seemed to be when the build output printed: Executing up to 6 actions base on MaxProcessorCount override.
It’s the kind of process that takes a long time to verify. But, i will probably try some other configurations to see if i can get hyperthreading going without running out of swap. Based on Resource Monitor, I should also probably order some more RAM for my box.
For reference, this is their documentation for the configuration. ( The namespace url in their file is a 404 😕. )
The ParallelExecutor
block i have doesn’t make a lot of sense, but having it larger than the number of parallel actions didn’t seem to affect anything; it might be worth setting the Max Processor count to the number of cores, and removing the BuildConfiguration
part to see what happens. The interactions between the two blocks isn’t perfectly clear to me. ( Might also be worth taking a gander at the source for the build tool to see what it does. )
Follow up Link to heading
I’m currently waiting on 7k shaders to compile so i can open the example puzzle game. The first time i tried, i go this:
but i have hope.