Hello! I am new in UE4 and I have a HUGE problem with build times.
I am following [this course][1], and I am experiencing very and very big build times.
For example, I am on seventh video and now I have THIS solution structure
I have a hot reload configured and I am using this build settings (as far I understand, I should build the project every time I make a change in C++ code, because it’s the only way to have changes in editor).
Now a quick test. I have my project, I go to ONE .cpp file and change only ONE ARGUMENT IN ONE FUNCTION. I click “UnrealVS Quick Build → Development Editor” and I have this:
What am I doing wrong? I beg you for help, because It can’t be possible to waste so much time just for a small little change in code. I am really can’t believe that this is normal. I really wan’t to write C++ code, but with that slow workflow It feels impossible.
It is also takes about 1-2 minutes to CREATE new C++ class (derived from Actor, for example). It recompiles the project and doing other things.
I’ve made a fresh VS2017 and UE4 installation today but it didn’t help at all! I read about IWYU and it seems it is ON bu default in my .cs file (PCHUsageMode.UseExplicitOrSharedPCHs).
Hey there, i’m not sure if it helps, but i’ve never used that, i’ve always used the Compile button in the editor to hot reload and unless you are changing some core stuff in the header file usually it works without having to restart the engine and it’s decently fast.
Try deleting the intermediate, binaries, saved folder, regenerate the visual studio project from the uproject and try recompiling all over again to see if it makes a difference.
I deleted the Engine folder and now build time is about 5-10 seconds.
But, do I really need the Engine folder? It seems that all people who makes tutorials have the Engine folder and their compile time is fast.
I think they have Engine folder removed from build settings, but it didn’t helped me. Only complete deletion from the solution makes sense.
To be patient and to wait for 200+ seconds every time I want to make a change or to learn how to write code in C++ for Unreal?
Huh, but it’s not worth it.
I still think that that compile time is not how it should be.
It’s OK if my project were 100+ files big, but seriously, even the template TopDown example compiles for about 3-5 minutes every time I touch even one line of code.
Oh sorry, you were talking about Compiling time not Package Build time. With Blueprint you have to go to Editor preference and uncheck Compile Manager. With C++ I guess there is something like this.
I’ve made some observations: when I am editing header file it takes a few minutes to apply changes and make a hot build (I am using Development Editor build option).
When I am changing some .cpp files, it takes only 2-10s to hot build with the same options.
It’s strange, because I am changing only 1 game header file, and only 1 .cpp file has that file dependency.
What’s with PCH? It seems I’ve got a bug.
UPD:
No, it seems that was a random behaviour. Now my build with one edited .cpp file took 288 seconds.
Ok. Slow compile times were because of RAM.
Close your browser and free ~3 GB of ram. It will be very fast.
I don’t understand that behaviour, because there is no warnings and messages about your RAM. It’s silently increasing compile time and stop using all available RAM. I think because it’s trying not to hang up your PC.