Announcement

Collapse
No announcement yet.

Cheats to circumvent long compile times

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Cheats to circumvent long compile times

    Hey, I'm just starting to work with c++ in Unreal and was wondering if there are ways to skip the rather long (in my case 10-20 seconds right now which is already getting frustrating, I assume others have much longer) compile times to test things?

    For instance, can I compile single classes? Is there anything else maybe one can do?

    I'm on 4.15,
    Thank you.

    #2
    Are you using a Source build from github or a binary engine from the launcher?
    https://www.casualdistractiongames.com

    Comment


      #3
      Originally posted by OptimisticMonkey View Post
      Are you using a Source build from github or a binary engine from the launcher?
      Just the default engine and adding a few c++ classes from that.

      Comment


        #4
        Yeah, you can speed up the C++ build times for a game project or plugin project. By default, the Unreal Build Tool will lump all source files together into a single combined .cpp file and compile that all at once. That means that even a tiny change in a single source file will trigger a rebuild of the entire project source. You can change this behavior by adding the following two lines to your project's .Build.cs file:

        Code:
        MinFilesUsingPrecompiledHeaderOverride = 1;
        bFasterWithoutUnity = true;
        Just put those in the C# constructor, right above the "PublicIncludePaths" line. This will force UBT to compile each source file individually, much like a Makefile would do, and can speed up your compile times tremendously.

        Comment


          #5
          It only uses unity build for large game projects by default (with dozens of files) so that probably changes nothing.

          Also takes about 10-20 seconds to compile one change in a cpp file for me.

          Comment


            #6
            Yeah that doesn't seem to do much for my project either.. good to keep in mind for the future though, thanks.

            Comment


              #7
              It takes 5- 20 seconds for a change for me, I find this quite acceptable to be honest

              Comment


                #8
                Originally posted by RyuMaster View Post
                It takes 5- 20 seconds for a change for me, I find this quite acceptable to be honest
                I think if I was more comfortable writing c++ for UE then I miiiight be able to agree.. but on the other hand I'm pretty fluent in Python for various applications and it would be frustrated waiting 20 seconds to try to run that. If you're doing error prone large algorithm things it can quickly get tedious to wait. Of course c++ is a different thing but still.. just seeing if there are ways to speed things up.

                Comment


                  #9
                  Get an SSD if you have not got one yet.

                  Comment


                    #10
                    It's hard to bring compile times below the 20 seconds mark. Avoid changing .h files too often as that causes a recompilation of more files than just changing a .cpp file.

                    Comment


                      #11
                      Originally posted by tanis2000 View Post
                      It's hard to bring compile times below the 20 seconds mark. Avoid changing .h files too often as that causes a recompilation of more files than just changing a .cpp file.
                      Ah I see. Thanks, I'll keep that in mind.

                      And I'm running an SSD yes, it's pretty frigging fast one too..

                      Comment


                        #12
                        Originally posted by Zeblote View Post
                        It only uses unity build for large game projects by default (with dozens of files) so that probably changes nothing.

                        Also takes about 10-20 seconds to compile one change in a cpp file for me.
                        I wonder if this is related to the VS 2017 update I installed yesterday, but compiling a change in a single file only takes 1-2 seconds now.

                        Comment

                        Working...
                        X