Extremely long build time

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

224033-снимок.jpg

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:

224035-снимок3.jpg

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).

My specs:

  • i5 4690K
  • GTX 970
  • 8GB of RAM
  • Win 10 (up-to-date)

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.

It doesn’t help at all. Almost the same results :frowning:

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.

I never had a Engine folder created in the project directory, but if that works for you then great, the main question is for how long.

Build to 64 bit looks like extremely long, I only build to 32 bit now. Maybe you can try building to 32 bit and see if that works.

So is the issue fixed?

Building in 32 bit is way much faster. Deleting folders may not be a good idea.

The Engine folder isn’t in the project folder. It’s only in solution as a second projects.

I don’t know for how long and I don’t know why it’s even in my solution.

Win32 is not a supported platform for Project. Valid platforms are Win64.

No, I can’t do 32bit build because I have x64 project. This is not a good idea.

In this case, it’s different if you have to do it with 64. I guess you have to be patient.

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.

Yes that is not normal, i have a much more complex project and it takes like 30 seconds the hot reload.

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 already unchecked that.

So it seems that both VS17 and UE4 recompiles ENGINE with every code change.

It happens even if I am excluding UE4 project in build settings.
It happens even if I am rightclick on MyProject and only building IT.

And it seems that if I delete ENGINE folder (with UE4 project) from solution, it will be added every time when I Refresh project with UnrealVS tool.

So It looks like ProjectFileGenerator executes with -Engine flag. But I don’t know how to make all my projects to creating without -Engine flag.

I don’t need Engine source files and why the hell it adds them for me by default?

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.