Discussion Optimizing compile time

Discussion in 'GameMaker Studio 2 Community Tech Support' started by Petr Skornok, May 17, 2019.

  1. Petr Skornok

    Petr Skornok Member

    Joined:
    Sep 13, 2017
    Posts:
    44
    Hi,

    we've recently hit a point where the compilation of our game takes over 1min 30s on well performing desktop machine (project includes 3500 art assets, 1500 SFX/music files and still growing). It became a real challenge to make any changes in the code and stay in the programming flow while the game keeps compiling.

    I was wondering whether there are any recommended steps to speed up the compilation time. First one I've found was adding all of our audio files into Audio Groups, loading these groups asynchronously on game start and unticking for each of those groups "Use Group On..." unless we need to recompile the audio files in the group. The audio still keeps playing and the compilation time got half of the original value.

    Is there some similar trick for the assets? If Texture Group is not included during the compilation it leads to the assets not being added to the texture and not being drawn on the screen.

    Thanks for the tips
     
  2. ph101

    ph101 Member

    Joined:
    Jun 20, 2016
    Posts:
    415
    I dont have any tips but I want ed to say - 1min 30secs seems a really fast compile time? Is that on YYC?
     
  3. Petr Skornok

    Petr Skornok Member

    Joined:
    Sep 13, 2017
    Posts:
    44
    It's VM build which has been previously built and run so it is running from cache. I don't consider 1min 30s for a code change as a fast compile time. YYC build takes approx. 40mins
     
  4. Mert

    Mert Member

    Joined:
    Jul 20, 2016
    Posts:
    388
    If you're only changing images, audio files, images or anything but the code, you can use UnityBuild pragma which saves a lot of time. I put a small tutorial here about it.
     
    immortalx and rIKmAN like this.
  5. Petr Skornok

    Petr Skornok Member

    Joined:
    Sep 13, 2017
    Posts:
    44
    @Mert that's nice addition! Is there also something that would save time when changing only the code and not assets?
     
    Mert and Oscar like this.
  6. immortalx

    immortalx Member

    Joined:
    Sep 6, 2018
    Posts:
    296
    Something I noticed today is that at least on YYC target, on a completely empty project but with some relatively big extensions included (FMODGMS & ImGuiGML) it takes 1 min to compile. A "full" project without these extensions, takes mere seconds on YYC.
    I haven't noticed the same on VM target, but please note that I'm talking about projects wayyyy smaller than yours, and since VM builds are faster I wouldn't know for sure. Now I image that at your scale it would affect both anyway, so if you have any big extensions that you could exclude and isolate the code making use of them, maybe it would make a difference.
     
  7. Petr Skornok

    Petr Skornok Member

    Joined:
    Sep 13, 2017
    Posts:
    44
    @immortalx Thanks for the note. I've checked the extensions we're using (GameAnalytics, Easing) and they are fairly small in size and not affecting build time that much. One interesting thing I've noticed with colleagues is that the trick I've mentioned in the original post (excluding Audio Groups from the platform build) doesn't work on Windows and the game actually builds without them, not playing SFX/music afterwards because it's not able to load the audio group. It's a behaviour I'd normally expect so I kind of feel that I am exploiting Mac bug to decrease the build time here?
     
    immortalx likes this.
  8. DukeSoft

    DukeSoft Member

    Joined:
    Jun 20, 2016
    Posts:
    776
    Petr Skornok likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice