Search Unity

[RELEASED] Better Build Info - An in-depth look at build and assets

Discussion in 'Assets and Asset Store' started by gwiazdorrr, Sep 9, 2016.

  1. gwiazdorrr

    gwiazdorrr

    Joined:
    Sep 29, 2014
    Posts:
    66
    Hi guys!

    I created a tool to analyse assets' usage across scenes, resources and other assets - the Better Build Info. The information provided is, as far as I can see, way more detailed and easier to navigate, compared the most popular plug-ins for build log analysis. I put a lot of effort into making the tool sleek, integrated with the editor and easy to use. And it's only 10$ and just got accepted.

    Asset store link: http://u3d.as/zmh



    Background:

    I work on a fairly big mobile hack'n'slash game - Bladebound (http://bladeboundgame.com, may not have been soft launched in your territory yet). As with every other bigger project I used to work on, tracking down assets' usage is an immense pain. A pain that seems unavoidable, because you want to keep your build size low.

    There are tools out there that analyse the build log to show you which assets get included in a build, some even show you which scene references which asset. However, I found that they still leave most of the dirty work for you, as they don't tell you *why* an asset got referenced - is it because it was a resource? Or maybe referenced by a resource? Or maybe used explicitly on a scene? Also, what other assets get pulled into a build along with a prefab? Which prefabs reference a given material? How do I rearrange my sprite atlases to reduce scenes' memory usage? The list goes on. Also, the most informative of said tools had a rather clunky feel and just didn't feel quite right.

    My team has been using Better Build Info on this project as it got developed and am fairly pleased with how it feels and works. Reports generated from making the build get passed to art and level design folk and they fix oversized assets/scenes themselves.

    Demo:



    Some screenshots:











    Future plans:

    I work on new features (collecting even more info about assets, such as texture format etc., unused assets) and cleaning up the code to release an open the source variant. If you've got more ideas, let me know!

    So, what do you guys think? What would you like to see changed/added? Any suggestions?
     
  2. Klakwa232

    Klakwa232

    Joined:
    Sep 9, 2016
    Posts:
    1
    Looks great! Can't wait to test it out.
     
    tigerleapgorge and gwiazdorrr like this.
  3. Xtense

    Xtense

    Joined:
    Feb 18, 2015
    Posts:
    34
    We've tested it in our projects and it works really great! It allowed us to deal much quicker with tracking sizes and cleanup, it's a really great tool, highly recommended!
     
    tigerleapgorge, Jiven and gwiazdorrr like this.
  4. gwiazdorrr

    gwiazdorrr

    Joined:
    Sep 29, 2014
    Posts:
    66
    Awww yeah, Better Build Info has been featured and is on the front page :)

    No time for celebration yet, since the feature I've been working on needs some polishing and final decisions to be made. It's called "extra info" and what it basically does is collects detailed information per asset type. You can then sort/filter by said properties, just like by path, size, category etc. Extremely useful in case of textures.



    So far, the info I'm collecting (based mostly on the requirements of the project I'm working on):
    • scene: game objects count, components count, static mesh vertex format, vertex & primitive count
    • prefab: game objects count, components count
    • model: vertex, primitive & blend shapes count, vertex format, optimize flag, generate uv2 flag
    • texture: format, mipmaps, width, height
    • audio: frequency, length, channels, load type
    Is there anything else you would find useful?

    The new release will take place this week.
     
    Jiven likes this.
  5. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    821
    Hi,
    Just purchased this, it's very cool and useful thanks!
    Some questions:
    1- What does it mean the total size listed? It's the sum of what?
    For example some fbx report a total size bigger than the size. Same for the fonts.
    2-Do Unity embed all dynamic fonts of the same type even if you don't use it?
    Because I have roboto-light, roboto-bold, roboto-italic, etc. But I'm only using one kind in the scene.
    3-Are the size displayed actual build size as embedded in the final build, meaning already compressed?
    4-Per your experience, can a scene for a mobile game affect the size of the build?
    Not talking of the assets included in the scene, but the scene file alone.
     
  6. gwiazdorrr

    gwiazdorrr

    Joined:
    Sep 29, 2014
    Posts:
    66
    Awesome!

    I think I explained it in the video, but in hindsight I should've included it in a README or maybe provide a tooltip... it is the sum of the asset's size and sizes all its dependencies; you can basically see how much stuff an asset drag into the build with itself. In case of a fbx it may be imported materials and textures they are using.

    I don't have such test case. Maybe the fonts are in Resources directory? Are there any other assets referencing your fonts?

    No, they are uncompressed sizes. In case of Android, I don't think it is possible to get the compressed size reliably; some assets get embedded in scenes' files, some are clumped together in sharedassets blobs. Having said that, I guess it would be possible to include the compressed size as an yet another Asset Detail, for assets that seem to live freely in the APK. I'll check it out.

    A scene - no. In our game the largest scene is less then 10 MB, with ~20k Components and ~5 GOs.

    However, if your scene count goes in dozens, it is a different story. For us, turning static batching off decreased size of each scene by a few MB. If you have hundreds (or more) of GOs/Components you use for debug purposes only, you might want to remove them in PostProcessScene callback; it saved us ~700 kB per scene.
     
  7. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    821
    Nope, they are outside. And the total size also report a bigger size, so if like you explained it's the sum of the dependencies I guess Unity embed all the variants.

    By uncompressed you also mean, the size of the textures is not compressed?
    Or just the apk compression?

    Thanks for the tips.
     
  8. tachyon-particle

    tachyon-particle

    Joined:
    Jan 5, 2016
    Posts:
    60
    Hi,

    Does Better Build Info also analyze the usage of the following?

    * DLL
    * Sound (OGG, MP3, WAV, etc.)
    * Fonts
    * Mesh


    Thanks
     
  9. gwiazdorrr

    gwiazdorrr

    Joined:
    Sep 29, 2014
    Posts:
    66
    I meant apk compression.

    For everything except DLLs - yes, just like any other asset type. Additionally, the tool can store detailed audio clip properties (length, format, channels, etc.) and mesh properties (vertices count, vertex format etc.), like here:



    Full DLLs support is coming soon.
     
  10. tachyon-particle

    tachyon-particle

    Joined:
    Jan 5, 2016
    Posts:
    60
    Awesome. Thank you for the response. I just purchased Better Build Info after your response.

    I am looking forward to seeing the full DLL support hopefully in the near future!

    Cheers!
     
    gwiazdorrr likes this.
  11. gwiazdorrr

    gwiazdorrr

    Joined:
    Sep 29, 2014
    Posts:
    66
    The update has been review and accepted. DLLs are now supported.

    I also decided to include experimental Unused Assets overlay - see which assets are used and which are not directly in the Project Window.



    Let me know what you guys think about it.
     
  12. tachyon-particle

    tachyon-particle

    Joined:
    Jan 5, 2016
    Posts:
    60
    Unity 5.5.1p4 Pro

    Wow! The new update looks amazing!

    The unused assets overlay looks great.

    I have a few questions:

    * Many Textures just show the same size of 0.10kB, but they are actually in the Megabytes on disk. Please see the below attached image of this. On the Unity Editor Preview screen and on disk, the sizes are different than what is shown in the Better Build Info. Am I reading this right?

    * The new DLL support looks great so far! How come some dll have the asset path shown, and others don't? For example, I have 2 dll in my Assets under the same folder, but only 1 of them show the complete path in Better Build, and other dll just shows the filename.

    * Is it possible to show Date Modified column for the asset files? This would be a great feature, especially comparing builds, deployments, etc.

    All in all, wow, this tool is amazing!

    Thank you

    upload_2017-2-21_18-43-9.png
     
    Last edited: Feb 22, 2017
  13. gwiazdorrr

    gwiazdorrr

    Joined:
    Sep 29, 2014
    Posts:
    66
    From my experience this may happen if:
    1) texture is a part of a spritesheet
    2) sometimes assets get merged with scenes they're used on

    In both cases, the size Unity reports seems to be related to some sort of asset metadata (just like size of a script).

    All the DLLs without full paths you see are the DLLs Unity puts in the build, but doesn't mention them in the process.

    Sounds good! The problem is that AFAIK there are three dates:
    - asset file date
    - .meta file date
    - timeCreated property in the .meta file

    I think that the latest of first two will do.
     
    tachyon-particle likes this.
  14. tachyon-particle

    tachyon-particle

    Joined:
    Jan 5, 2016
    Posts:
    60
    Thank you for the detailed explanations.

    I am very excited in seeing all the new upcoming greatness for Better Build Info for the forthcoming future!

    Awesome
     
  15. michal_cwiek_red

    michal_cwiek_red

    Joined:
    Mar 16, 2016
    Posts:
    24
    Hey Piotr,

    It seems like this is *not* the case. Somehow the parsing of the textures fails on Unity 5.5.1p4. Possibly the whole 5.5.x branch.
    Everything was fine on 5.4, it started showing incorrect sizes for all textures since 5.5 upgrade.
    Could it be the new TextureImporter being troublesome?

    Tried to debug, however, the confuser does a pretty good job at making the code unreadable after IL decompilation ;P

    // EDIT

    Also, it happens for all the textures inside the build.
    If we add a new texure to Resources/ directory (which naturally won't be referenced by anything), it will be displayed as for example
    <asset path="Assets/Resources/dash.png" size="102" />
     
    Last edited: Feb 24, 2017
    tachyon-particle likes this.
  16. gwiazdorrr

    gwiazdorrr

    Joined:
    Sep 29, 2014
    Posts:
    66
    There have been a few API changes in 5.5 and I'm going to submit an update ASAP. However, I unable to reproduce your problems. What platform do you build for?

    Also, if running multiple Unity instances, log may become corrupted. Try running Unity from command line with -logFile argument.
     
  17. gwiazdorrr

    gwiazdorrr

    Joined:
    Sep 29, 2014
    Posts:
    66
    Ok, I reproduced it on 5.5.1p4. Unity reports wrong size both in the log and in the internal build report, so there's little that can be done. Alas, looks like a bug.

    As @michal_cwiek_red suggested, size can be estimated by peeking into Library/metadata directory, but there's no guarantee how accurate this is going to be.

    5.5.0f3 works fine.

    EDIT: 5.5.2 is also affected. I've filed a bug report.
     
    Last edited: Feb 27, 2017
    tachyon-particle likes this.
  18. LoftyTheMetroid

    LoftyTheMetroid

    Joined:
    Oct 26, 2012
    Posts:
    57
    Hi! Our team just bought this today and I've found it INCREDIBLY helpful! It's already helped us identify some problem areas in our builds.

    However, I'm having a bit of an issue with detecting the total build size. It's reporting 0.00 kB, and all of the asset categories say NaN% or Infinity%. I've attached a screenshot below.



    We're using Unity 5.4.0. Before now, we knew that the problem area likely had something to do with our scenes (the console describes them as taking about 75% of a 20 GB build), which was partially the impetus for me picking this up, to see what is being included in that number. I've been trying to make smaller builds with just one or two scenes that were only 1-2 GB in size in case the large build size was the problem, but I was still having this issue even with the smaller builds.

    Also, I just realized the screenshot doesn't show it (I took it as I was heading out the door this afternoon), but I had found a window that showed Scenes were reported as having zero size, which is why I'm thinking they may be connected to all of this.

    Any insight into this? (I'm hoping I didn't just miss a setting somewhere...)
     
  19. gwiazdorrr

    gwiazdorrr

    Joined:
    Sep 29, 2014
    Posts:
    66
    I'm looking into it. Scene size alone should not be a problem, unless we're approaching 2^64 bytes :)

    What platform are you building for? Also, could you see any BBI warnings/errors in the console when report was being generated?

    In the meantime I will try to reproduce it will artificially big scenes.
     
  20. LoftyTheMetroid

    LoftyTheMetroid

    Joined:
    Oct 26, 2012
    Posts:
    57
    I was building for Mac 64-bit.

    I don't have console output here, but I'll make a couple more builds tomorrow morning/afternoon and check it. I'll also play around with the scene and see if I can isolate what's going on. I wouldn't be surprised if there are crazy shenanigans going on in our scenes.
     
  21. gwiazdorrr

    gwiazdorrr

    Joined:
    Sep 29, 2014
    Posts:
    66
    Ok, I think i fixed it. I will submit a new version ASAP. If you're interested, I can send you a fixed version right away -- it takes anywhere between a few days to two full weeks for Unity guys to accept a plugin update.
     
  22. LoftyTheMetroid

    LoftyTheMetroid

    Joined:
    Oct 26, 2012
    Posts:
    57
    Yes! I would definitely appreciate having the fixed version now if you don't mind. PM it to me? Thanks!
     
  23. gwiazdorrr

    gwiazdorrr

    Joined:
    Sep 29, 2014
    Posts:
    66
    Unity has fixed the size issue:
    I tested in on 5.6.0p3 and texture sizes look OK so far.
     
  24. gwiazdorrr

    gwiazdorrr

    Joined:
    Sep 29, 2014
    Posts:
    66
    Aaaaand Unity 5.6.1f1 comes with another bug, hurray!

    I submitted a fix a moment ago, should be live in a few days (up to two weeks). If someone needs fix immediately, please let me know.
     
  25. SamuelGoldenbaum

    SamuelGoldenbaum

    Joined:
    May 21, 2017
    Posts:
    47
    Unity Cloud Build failing with the following in the log:

    Code (CSharp):
    1. [Unity] BuildInfoProcessor: Unexpected error: System.ArgumentException: No asset info found in the log
    2. 8361: [Unity] Better.BuildInfo.BuildInfoProcessor:LogError(String, Object[]) (at Assets/Plugins/Editor/BetterBuildInfo/BBI_BuildInfoProcessor.cs:1004)
    3. 8362: [Unity] WARNING: -536307904 format is not supported, decompressing texture
    4. 8363: [Unity] WARNING: -523076768 format is not supported, decompressing texture
    5. 8364: [Unity] Player export failed. Reason: BuildInfoProcessor: Unexpected error: System.ArgumentException: No asset info found in the log
    Anyone else getting this? Is there a way to exclude this from running in Cloud Builds?
     
  26. gwiazdorrr

    gwiazdorrr

    Joined:
    Sep 29, 2014
    Posts:
    66
    Define BETTERBUILDINFO_DISABLED in your build settings. If you rather not you can alter BetterBuildInfoDisabler.cs:

    Code (CSharp):
    1. using UnityEditor;
    2.  
    3. [InitializeOnLoad]
    4. public static class BuildInfoDisabler
    5. {
    6.     static BuildInfoDisabler()
    7.     {
    8.         BetterBuildInfo.ForceDisabled = false;
    9. #if BETTERBUILDINFO_DISABLED || UNITY_CLOUD_BUILD
    10.         BetterBuildInfo.ForceDisabled = true;
    11. #endif
    12.     }
    13. }
     
    SamuelGoldenbaum likes this.
  27. MoribitoMT

    MoribitoMT

    Joined:
    Jun 1, 2013
    Posts:
    298
    I have a great suggesion for this tool.

    - Showing mesh vertices / triangle sizes ( for each mesh ) after build. So developer can identify meshes with under 300 vertices and mark them "unstatic", so they can use dynamic batching instead of static batching. As you know static batching increases build size dramatically.

    Regards.
     
  28. gwiazdorrr

    gwiazdorrr

    Joined:
    Sep 29, 2014
    Posts:
    66
    Good news - it is already implemented, no update needed! :)

    1) Make sure this option is checked in settings:
    upload_2018-4-23_23-42-24.png

    2) Build your game, open report

    3) Click on the "+" button on the right of "Total" column, click Triangles
    upload_2018-4-23_23-45-4.png

    4) Done!
    upload_2018-4-23_23-46-24.png

    Triangles, Vertices and VertexFormat property also work for scenes, if static batching is enabled.

    You may also be interested in Format property, which is great for hunting down these few textures/audio clips that have obviously wrong import settings.
     

    Attached Files:

    MoribitoMT likes this.
  29. MoribitoMT

    MoribitoMT

    Joined:
    Jun 1, 2013
    Posts:
    298
    Oh, it is awesome.

    I have to say, I purchased almost all build info assets, this the number one by far. First of all it is extremely fast, no lags or sluggishness, and secondly presentation of information simply the greatest among all.

    To be honest, I cannot found any flaws or suggestions. Maybe you can look into, giving optimisation suggestions to developer, such as "Project Scan" tool. ( https://assetstore.unity.com/packages/tools/utilities/project-scan-85287 )
     
    gwiazdorrr likes this.
  30. gwiazdorrr

    gwiazdorrr

    Joined:
    Sep 29, 2014
    Posts:
    66
    Thanks, I agree with your observation ;)

    Regarding suggestions, sounds interesting, I'll give it a look. Staying on topic, since you previously mentioned static batching, there is a nice alternative that keeps its benefits, but without the main downside (severely increased build size) - StaticBatchingUtility.Combine, aka runtime static batching. We used it in Bladebound, where there's tons of geometry on each level and it worked great.
     
    MoribitoMT likes this.
  31. MoribitoMT

    MoribitoMT

    Joined:
    Jun 1, 2013
    Posts:
    298
    I like the idea of StaticBatchingUtility.Combine

    But never tried it, my main focus mobile, I always thought it will increase load times at first launch. I do single scene games, quite load there already..
     
  32. sevensails

    sevensails

    Joined:
    Aug 22, 2013
    Posts:
    483
    Hi, I just build your asset, great! But I have two questions!

    1 - On build report from my Game, the biggest asset from my game is a scene, splash.unity with 68mb..... But the original file is only 120kb. When I click on it it shows me no Dependencies nor Referencing. Is this correct?

    2 - How to use the Project Window add-on? It's not working for me.

    3 - I'm using the New Unity Sprite Atlas and it seems to be not detecting any atlas on final build. But I'm sure they are there.

    Thanks
     
    Last edited: Apr 25, 2018
  33. gwiazdorrr

    gwiazdorrr

    Joined:
    Sep 29, 2014
    Posts:
    66
    The original scene's file size has little to do with how large it ends up in the build. For example, you have to take these under consideration:
    - static meshed are not saved in .unity files, but are saved in build
    - some prefabs get pasted onto scenes (end they up with their size being reported as 0)
    - PostProcessScene attribute marked methods

    That said, your results are a bit extreme. What Unity version do you have?
     
    Last edited: Apr 25, 2018
  34. sevensails

    sevensails

    Joined:
    Aug 22, 2013
    Posts:
    483
    Hi! I use 2017.3.1p4. And on this scene I use a prefab that references most Sprite Atlas I use on the game.

    That being said, strangely enough these Sprite Atlas does not appears anywhere on Build Report.
     
  35. gwiazdorrr

    gwiazdorrr

    Joined:
    Sep 29, 2014
    Posts:
    66
    I tried to reproduce it, to no avail. What platform are you building for? I checked Windows and Android.

    Anyway, you can check the editor log file to see what Unity is reporting. After performing a build, you should look for "Used Assets and files" and see if the sprite sheet is there at all.

    EDIT: OK, I see the problem. Working on it.

    EDIT: Soooo turns out I didn't support New Sprite Atlas assets. I am sending you a link to an updated DLL, in case you'd like to get it working ASAP.

    By the way, Unity 2017.3 reports scene size funny. Seems that the first scene using atlases gets bloated. I am going to investigate it further, but if it's a bug, there's nothing that can be done with this particular issue, for now.

    EDIT: Fix is live on store (1.4.0).
     
    Last edited: May 3, 2018
    sevensails likes this.
  36. philwinkel

    philwinkel

    Joined:
    Jun 6, 2013
    Posts:
    313
    hey i am interested in purchasing, just want to verify - is this working in the latest version of unity 2018.1?
     
  37. gwiazdorrr

    gwiazdorrr

    Joined:
    Sep 29, 2014
    Posts:
    66
    Yes, both version (without source and with source, aka PRO) do work in Unity 2018.1.
     
  38. anzz

    anzz

    Joined:
    Oct 17, 2013
    Posts:
    4
    Does not work on Unity 2018.3.0b11:

    IndexOutOfRangeException: Index was outside the bounds of the array.
    UnityEditor.Android.AndroidBuildWindowExtension.GetBuildPlayerWindow () (at <17bc29c07d9543e6bfc9e3d40117d430>:0)
    UnityEditor.Android.AndroidBuildWindowExtension.RepaintTargetList () (at <17bc29c07d9543e6bfc9e3d40117d430>:0)
    UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:200)
     
  39. gwiazdorrr

    gwiazdorrr

    Joined:
    Sep 29, 2014
    Posts:
    66
    Ok I am running my tests on this version.

    In the meantime - the stack trace doesn't contain anything from the plug-in. Are you sure this is Better Build Info related? How can I reproduce this error?
     
  40. anzz

    anzz

    Joined:
    Oct 17, 2013
    Posts:
    4
    UPD: The report is generated, but the "Build Info" window is not displayed after the build. I believe these errors relate to him.
     
  41. gwiazdorrr

    gwiazdorrr

    Joined:
    Sep 29, 2014
    Posts:
    66
    The window does not open automatically, unless you enable this in settings.

    What you want to do is click "Window/Better/Better Build Info". This will open the main window. From there you can go to settings and enable "autoOpenReportAfterBuild".

    There are many more options there, I encourage you to have a look!
     
  42. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,535
    Hi, So I grabbed this asset over the sales... what are the steps taken to get to this project view?
     
  43. MoribitoMT

    MoribitoMT

    Joined:
    Jun 1, 2013
    Posts:
    298
    I love this tool, for me it is 5/5.

    My only suggestion is to have more features for iOS and Android since majority of Unity Developers works for mobile sector. Specially estimation for final .APK and .IPA files would be amazing, and auto suggestions for how to reduce size more, for example Google Play have 100 mb limit before splitting apk..
     
  44. gwiazdorrr

    gwiazdorrr

    Joined:
    Sep 29, 2014
    Posts:
    66
    Open a report, then click on "Unused Assets" tab, then "Refresh Overlay"
    upload_2018-12-5_17-31-34.png

    Well you'll be happy to know that in the version that has just been published there's an experimental support for computing compressed sizes for Android, i.e. how much of APK/OBB assets actually take. For textures and scenes, should be pretty reliable. Other assets - depends on the version of Unity. Just enable Check Assets Compressed Size in settings.

    upload_2018-12-5_17-39-56.png

    This basically lets you find textures that compress poorly (too much high frequency detail, too many gradients).
     
    MoribitoMT likes this.
  45. kobyle

    kobyle

    Joined:
    Feb 23, 2015
    Posts:
    90
    Hello,

    Using Unity 2018.3.2f1 on Mac trying to open the build report crashes Unity every time.

    Please advise.

    Koby
     
  46. JediNizar

    JediNizar

    Joined:
    Nov 13, 2016
    Posts:
    43
    Hi,
    What is the difference between this and the Pro version?
     
  47. gwiazdorrr

    gwiazdorrr

    Joined:
    Sep 29, 2014
    Posts:
    66
    Could you please check what's up in the logs?

    Pro comes with full source code access. Whether you really need it is up to you - I don't recommend it as personally I prefer binary plugins (less clutter).
     
  48. pajamajama

    pajamajama

    Joined:
    Oct 22, 2012
    Posts:
    55
    Does this work for finding references within nested prefabs in 2018.3?
     
  49. gwiazdorrr

    gwiazdorrr

    Joined:
    Sep 29, 2014
    Posts:
    66
    Yes.

    There's a catch, though. In my test harness it seems that Unity "flattens" prefabs during the build. Unless a nested prefab is in Resources or is assigned to a field somewhere (aka held by reference), it won't appear in logs; all its references, used assets etc. will show up under master prefab. I will try to work around that.

    In the meantime, I encourage you to give the plug-in a try. If you find it lacking, I'll accept a refund :)
     
  50. snugsound

    snugsound

    Joined:
    Mar 9, 2014
    Posts:
    12
    Hey Piotr, great tool! Just a small suggestion: it would be nice if I could navigate the Used Assets list using the up/down arrow keys. (pg up/down would be a-nice-to have as well)
     
    gwiazdorrr likes this.
unityunity