Search Unity

Streamlined 3rd party extensions DLL creation with uTomate

Discussion in 'Scripting' started by RDeluxe, Nov 25, 2015.

  1. RDeluxe

    RDeluxe

    Joined:
    Sep 29, 2013
    Posts:
    117
    Hi guys,

    We are a small team, and our project starts to get some weight, and we realized we could reduced our compilation time by compiling the 3rd party extensions (assets) we bought to managed dlls.

    We are using some pretty big extensions, like :

    • Best HTTP Pro
    • Node Canvas
    • JsonDotNet
    • Anti cheat toolkit
    • Additive Scenes
    • Console Pro
    • Grids by Gamelogic
    • I2
    • Online Maps
    • Particle Playground
    • Vectrosity
    • uTomate
    And a few others. The project is pretty big, but by themselves all those extensions are bigger than our own code at the moment. And every time we compile our code, all those extensions get compiled again ...

    So we decided to use a uTomate feature (http://www.ancientlightstudios.com/utomate/documentation/actiondocs/5.2/build_dll.html) to make our life easier : all our extensions are in a Extensions folder. Utomate parse each folder, take all the .cs files and compile them in a dll file outside the asset folder (using other dll files as references if needed).
    We then move the sources (.cs files) outside our Assets folder (keeping theirs structure, allowing us to browse them in VS), and we put the newly created dll in the extension folder (we basically switch the previous .cs and .dll files for the new one).

    This process is working, but of course all the monobehavior scripts behind used in our scenes or prefabs end up breaking ("missing script"). We are also not 100% sure if we should compile specific {MyExtension}Editor.dll files, and put them in a Editor folder.

    The difficulty I have now is to change the guid of every script in our .unity files. I found some hints there : http://forum.unity3d.com/threads/yaml-fileid-hash-function-for-dll-scripts.252075/#post-1695479 but I struggle to put this into place.

    My first performance tests are promising : 53 to 13 seconds. It's a 40 seconds improvement, really welcome.

    My goal here is to find some help to be able to finish this, and then post an article + wiki page describing the whole process. Being able to auto compile all 3rd party sources into DLL, but also to easily update an extension (juste replace the extension folder, launch the uTomate plan, and it's done) would help a lot of teams.

    Thanks for your insights.


    Edit 11/25 :

    I also tested another method : moving files to Standard Assets (except Editor scripts), to compare performances.

    • DLL : 13 seconds
    • Standard Assets technique : 14 seconds
    • Nothing : 53 seconds
    Moving files to Standard Assets being way easier than compiling DLLs, I'll change this topic goal to an automatisation (still using uTomate for simplicity) of moving extensions scripts to Standard Assets.
     
    Last edited: Nov 25, 2015