Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Asset Hunter (Project cleaning tool)

Discussion in 'Assets and Asset Store' started by KristianHJ, Oct 15, 2014.

  1. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,560
    Just bought this :) Looks sweet.
     
  2. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    340
    Good to hear. Hope you get plenty of mileage out of it.
     
  3. MarkusGod

    MarkusGod

    Joined:
    Jan 10, 2017
    Posts:
    168
    Hi, just bought your asset, it works well, except incompatibility with the dotween pro.
    It deletes between dlls which are used in animation script.
     

    Attached Files:

    • 1.png
      1.png
      File size:
      57.2 KB
      Views:
      840
  4. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    340
    Hi Markus. You can manually ignore the DoTween folder in settings as a temporary fix, but I will take a look and see whats going to on, to potentially make a more permanent fix.
     
    MarkusGod likes this.
  5. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    340
    Just submitted a new version (2.1.6) that should fix your problem. I believe it will be approved by Unity in 2-4 days.
     
    MarkusGod likes this.
  6. f0ff886f

    f0ff886f

    Joined:
    Nov 1, 2015
    Posts:
    201
    Is it possible to export the results to a CSV text file or something similar? I'd like to load the results into Excel and peruse them in a separate app.
     
  7. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    340
    I'm sure it is. Will take a look and add it to my backlog.
     
  8. f0ff886f

    f0ff886f

    Joined:
    Nov 1, 2015
    Posts:
    201
  9. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    340
  10. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    329
    Will this interfere with 3rd party sdk's, e.g. In particular heyzap ad mediation.
     
  11. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    340
    Haven't used Heyzap meditation, but just tried to import it and Run Asset Hunter, and everything seems to be in order.
    So you are good to go :)
     
  12. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    329
    Awesome, thanks for the extra effort.
     
  13. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    340
    Np, hope you'll like Asset Hunter
     
  14. JoeFernaldSG

    JoeFernaldSG

    Joined:
    Apr 3, 2017
    Posts:
    9
    I have 2 questions for KristianHJ.

    1) I can't seem to figure out how to exclude a directory from being looked at. Nothing I select seems to enable or disable the button. Would it be possible to post a video or something of the sort on how to exclude a directory?

    2) I have some custom files that we stream from disk in our builds because these assets are streamed at run time there is no references to them in the project and asset hunter 2 seems to believe they are not in use. I was wondering if it would be possible to add some sort of header in the log file which asset hunter could use to add the file to the list of items used in the project?

    For example:

    ----- Total AssetImport time: 0.01s, AssetImport time: 0.000000s, Asset hashing: 0.000000s [0 B, 0.000000 mb/s]
    [AH2_CustomFileInclude] 0.2 kb 0.0% Assets/2D/StreamingAnimation.strm
    [AH2_CustomFileInclude] 0.2 kb 0.0% Assets/2D/Movie.bk2

    This would allow me to iterate over the scenes in the build process, look for the component that defines the streaming animations and log it out.
     
  15. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    340
    Hi Joe

    I'm just about to take a 12 hours flight, so just going to answer question no. 1 right now. Will be back with regards to question no.2.

    My immediate guess, why the directory exclude doesn't work is that you are selecting folders on the left side in a "two-column project view" window.

    https://docs.unity3d.com/Manual/ProjectView.html

    If you are using two-column view, you need to select the folder in the right hand side. If you are using one-column view, then everything should be good to go.

    For some reason unity does not interpret folders in left hand side of the view as actual folders. (Does also not affect properties view when selected)

    Hopefully that helps with question 1.
     
  16. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    340
    NB: If you can get the folder exclude to work, that will fix your issue with streaming as well right?
    If not, could you give me a bit of info on how you do the streaming, is it through the streamingassets folder, or are you doing something custom?
     
  17. JoeFernaldSG

    JoeFernaldSG

    Joined:
    Apr 3, 2017
    Posts:
    9
    Excluding the directory will prevent all of the streaming assets from showing up as false positives in Asset Hunter 2 , but it won't allow me to know what streaming assets are in use in the project. I was hoping that it would be possible to add some user defined data to the log file when I build that would essentially mark the file(s) I specified as in use even though there isn't a direct reference to the asset in the unity scene. I actually already wrote some code to do exactly that and i was outputting it in a way I hoped Asset Hunter 2 would be able to recognize unfortunately Asset Hunter just ignored the additional output most likely because it was printed out after the header you are likely looking for to identify where in the editor.log file references to the assets used in the scene are printed.

    I will need to check in with our back end developers to figure out exactly how we do the streaming in order to give you an answer to that question.

    What I can say is that from a users standpoint a we have 2 streaming asset types. When we want to use one of those asset types we attach one of 2 monobehaviors to the game object. For our purposes here the monobehavior simply contains a string with the full path and file name under the assets folder for example: "/Assets/StreamingAnimations/StreamingAnim.strm".

    or in C# code something along the lines of...
    public class StreamingAnimationTypeA : MonoBehavior
    {
    public string fullPathAndFileName = "/Assets/StreamingAnimations/StreamingAnim.strm";
    }


    public class StreamingAnimationTypeB : MonoBehavior
    {
    public string fullPathAndFileName = "/Assets/StreamingAnimations/StreamingAnim.bk2";
    }

    At run time that file name accessed and the Streaming Asset begins to load (I'll need to check on the details of how, for now I'm assuming some sort of customized black magic)
     
  18. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    340
    Hi Joe

    So if its possible for you to "inject" information regarding your assets in this section of the log, then I presume it will work:

    Used Assets and files from the Resources folder, sorted by uncompressed size:
    256.1 kb 0.8% Assets/ASSETHUNTER TEST SCENE/SpriteSheet/NESTED_SPRITE.jpg
    115.8 kb 0.4% Resources/unity_builtin_extra
    4.1 kb 0.0% C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll
    ...
    ...
    ...

    If that doesn't work, you could modify this method "internal static AssetHunterBuildReport AnalyzeBuildLog()" in "AssetHunterHelper.cs"

    I could also add "exclude single asset" in settings, which would allow you to write directly to the "AssetHunterSettingsData" file. I think that could actually be a good idea to add that regardless, so I'll put that in the backlog, but it will probably be a few weeks, until that functionality is added.

    And btw, did the 1-column project view trick I mentioned earlier work out for you?
     
  19. JoeFernaldSG

    JoeFernaldSG

    Joined:
    Apr 3, 2017
    Posts:
    9

    Thank you for the reply ,

    I'll have to dig into unity's documentation and google.com to see if it's possible to inject information into the area where the normal assets are written to the log file. So I may end up looking into the AssetHunterBuildReport AnalyzeBuildLog like you have suggested.

    I'm reviewing this tool for more broad use at our company and not being able to add the used streaming assets and other custom assets as part of the build was a downside as they tend to take up the most space. So if I'm able to resolve it with some slight modifications I'm pretty sure there will be a few more sales on the way.



    I did see the 1 column project view note you made in the last post. It is currently the weekend here in the states so I have been unable to try it out. It'll be one of the first things I try tomorrow morning.

    Thanks again. You've been very helpful!
     
  20. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    340
    Hi again Joe

    Talking to you made me realize that I should do some work with the Asset Hunter API, making it more extensible.
    I just changed how to exclude folders/types/assets etc so you are now able to do it directly from code.

    Example:
    I've created the following methods (And a few more) that allows you to modify the settings file from your own code.
    I believe that should fix your problem right?

    HeurekaGames.AssetHunter.AssetHunterSettings.ExcludeIndividualAssetWithID(string id)
    HeurekaGames.AssetHunter.AssetHunterSettings.ExcludeIndividualAssetWithObject(Object asset)
    HeurekaGames.AssetHunter.AssetHunterSettings.ExcludeIndividualAssetWithpath(string path)


    I will submit new version with that code today, and then it will take approx 4 days for Unity to approve it.
     
    JoeFernaldSG likes this.
  21. JoeFernaldSG

    JoeFernaldSG

    Joined:
    Apr 3, 2017
    Posts:
    9
    I believe that will work just fine.

    Thanks Again.
     
  22. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    340
    Version 2.2 was just approved so you are now able to update and try it out.
     
    JoeFernaldSG likes this.
  23. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    329
    As per the product description, it analyses your projects build log. With this is mind, does it matter on what platform you build (ios or android), and will it analyse ios specific assets if you analyse an android build, and vise versa.
     
  24. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    340
    Hi nobluff67

    Asset Hunter analyses the build log, so if you have platform specific assets meant for a different platform that the current build, those will be seen as unused. The one thing Asset Hunter does with regards to cross-platform though is to respect icons and splash-screens for each platform.

    Besides icons and splash-screens, I'm not aware of any way to have platform specific assets though - Could you elaborate a bit on how you deal with platform specific asset?
     
  25. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    329
    Other platform specific things could be plugins (specifically advertising) that have different plugins for iOS and Android. So my project has a plugins/iOS and a plugins/Android folder, so If I build for Android will your product suggest that the plugins/iOS is unused? If that is the case, what do you recommend?

    I just noticed that your Readme says that you exclude /plugins/
     
  26. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    340
    Yes, I exclude the 'Plugin' folder since Asset Hunter has no way to knowing if the content of that folder is an editor plugin, which we dont want to delete. I do the same for the 'Editor' folder for the same reason.
     
  27. Seraphic572

    Seraphic572

    Joined:
    Mar 11, 2016
    Posts:
    21
    Will This work with Unity 2017.2 Just a cross check before buying it
     
  28. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    340
    Hi Seraphic

    Yes, it'll work just fine :)
     
    Seraphic572 likes this.
  29. Wecica

    Wecica

    Joined:
    Jul 20, 2016
    Posts:
    27
    Hello KristianHJ:
    I used Asset Hunter in my project recently. But each time after I built my project. It displayed "Load Build Log(required)". I don't not whether it's normal nor abnormal. I tested a lot of small projects and they all behave like this. So my only choice is to click this red button. And then there comes another problem. It always stuck at the procedure of "Analyzing assets". Hope you can help me find the problems.
     
  30. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    340
    Hi Wecica

    Sorry to hear you are having problems. First of all could you tell me Unity version and Asset Hunter version?

    The "Load build log" is fine that's just to start analyzing the build log to find used and unused assets.
    You should however not be stuck at the "Analyzing assets" step. Does the progress bar not move at all, or could you be more specific in what you are experiencing.

    Thank you
     
  31. Wecica

    Wecica

    Joined:
    Jul 20, 2016
    Posts:
    27
    Hello HJ,
    My unity version is 5.6.3f and Asset Hunter version is 2.3. I read the documentation. It will be a yellow button with the text "Log update(Refresh)" after building the project, but mine is always a red button with the text "Load Build Log(required)" after building. So I click the red button and it starts to process until the step I showed you. I wait for it for a whole night and it doesn't even move a little. it still displays as "(1 of XXX) Analyzing Assets".
     
  32. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    340
    Sorry, I misread regarding about the button text. You are right, it should be yellow, not red.
    You mentioned you had small projects that had the same problem, would it be possible for you to send it to contact@heurekagames.com It would make it much easier to debug. Obviously if you rather not send my the project that is completely understandable.

    Does the log indicate any errors?

    I will try to repro the problem hopefully later tonight
     
    Last edited: Oct 29, 2021
  33. Wecica

    Wecica

    Joined:
    Jul 20, 2016
    Posts:
    27
    I‘ve sent you the test project and write you the reason I found why there will be a red button in the test. And there will be an Asset Hunter error on console. Hope you can locate the problem.
     
  34. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    340
    H
    Hi Wecica

    Thanks for the test project, I'm sure that will help a lot trying to track down the issue
     
  35. Wecica

    Wecica

    Joined:
    Jul 20, 2016
    Posts:
    27
    Hello HJ, is there any progress on my problem?
     
  36. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    340
    Hi Wecica

    Unfortunately not, as I wrote in my last mail, I could not download your sample project (It simply stopped downloading after 1024kb) So I have nothing that allows me to reproduce the problem.

    Perhaps if you could send me the sampleproject again using wetransfer.com or some other service, I can take a look.
     
  37. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    340
    Just a quick update to anyone that may experience the same problem Wecica had.
    The problem was that the "AssetHunterSettingsData" file had somehow got corrupt.
    I will to to safeguard around that problem, but If anyone else experiences the problem, just delete the file (A new one will be auto generated)
     
  38. ael-kadh

    ael-kadh

    Joined:
    Nov 23, 2017
    Posts:
    1
    Hi KristianHJ,

    I just used Assets Hunter for the first time and I am facing this problem.
    It always get stucked at the "Analyzing assets" and the progress bar don't move at all, I waited for more than 3 hours and nothing changed.
     

    Attached Files:

  39. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    340
    Hi ael-Kadh

    I'm sorry to hear you are experiencing problems.
    Seems I might have made a change in my latest submit that cause this to happen for a few people.

    I will try to figure out what is going on, but I recommended him to delete the "AssetHunterSettingsData" file. (Forum post here https://forum.unity.com/threads/v2-...ssets-from-project.274173/page-4#post-3378468)

    That worked for him, If it doesn't for you, please write me at contact@heurekagames.com and I will help you out.
    Also, if it doesn't work, please inform me of the version of Unity you are using
     
    Last edited: Oct 29, 2021
    ael-kadh likes this.
  40. JoRangers

    JoRangers

    Joined:
    Nov 7, 2017
    Posts:
    26
    Hi KristianHJ,

    I don't understand how works the BuildReport part about the size of the assets.

    For example on an audioClip :
    Asset hunter BuildReport size : 5.3mb
    Unity editorLog size : 1.1mb
    Unity preview size : not available
    Original size (in windows explorer) : 1.2mb

    Another example for a texture :
    Asset hunter BuildReport size : 2mb
    Unity editorLog size : 4mb
    Unity preview size : 4mb
    Original size (in windows explorer) : 2.1mb

    I have this "issue" with all the others assets for the build on Android & iOS and perhaps your asset don't use my selected build platform.

    I use Asset Hunter 2.3 & unity 2017.3.1p1

    Have you any idea ? or I don't understand something ?

    Thanks for your help !
     
  41. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    340
    Hi JoRangers

    That does indeed sound weird. I (relatively) recently changed the way i calculate asset size by using a new Unity method, perhaps I need to revisit that.

    Could you send me the audioclip you mention (And a screenshot of your import settings for that asset)
    That would really help me in figuring out what it going on.
    I might be able to figure it out without it, but it always help with examples, so if you dont mind, please send it to contact@heurekagames.com

    Thanks,
    Kristian
     
    Last edited: Oct 29, 2021
  42. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    340
    Ok, so I have a bit more info now after having looked through my code, and the documentation.
    So in Unity there are 5 size values for each asset.
    1: Actual file size in project
    2: Imported file size in project
    3: Uncompressed file size in build
    4: Compressed file size in build
    5: Runtime memory size

    The best thing to indicate in Asset Hunter would be (4) "compressed file size in build", but due to platform constraints the best to hope for is (3) "uncompressed file size in build" which is also perfectly fine since its quite indicative of the file size in build.

    However I have recently been using the Unity API to find the runtime memory size, which seemed to give that desired value, but I can see that the value can be far off in some cases, especially Audio that is decompressed at load.

    I will need to revise how I calculate used file asset size, and a fix will be in the next version.

    Sorry for the inconvenience but thanks for bringing the issue to my attention.
     
    JoRangers likes this.
  43. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    340
    Managed to finally identified the issue that caused the filesize of imported assets the be calculated incorrectly.
    I have fixed the problem and will submit it tomorrow (v2.4), which means it will be in your hands in probably 4-5 days
     
  44. GloriaVictis

    GloriaVictis

    Joined:
    Sep 1, 2016
    Posts:
    133
  45. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    340
    Hi GloriaVictis

    Regardless of your project size, it shouldn't hang. It might take some time, but you should be seeing a progress bar.
    Looking at your image it doesn't seem like that is the case.

    Could you be a bit more specific on what happens when?
    I.e. Is it when you press the refresh button, or after the progress bar has completed?

    You are also welcome to write me directly at contact@heurekagames.com so we can figure out whats going on.
     
    Last edited: Oct 29, 2021
  46. tessellation

    tessellation

    Joined:
    Aug 11, 2015
    Posts:
    377
    With the latest version, the text is so dark that it's unreadable with Unity Pro:

     
  47. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    340
    Hi Tesselation, thanks for bringing that to my attention. I will do something about that
     
  48. paulkopetko

    paulkopetko

    Joined:
    Jul 27, 2015
    Posts:
    3
    In case this helps anyone else, I had the same problem as ael-kadh and Wecica on PC, with "Traversing Directories" getting stuck at 1 of XXX in Unity 2018.1.4f1.

    The problem for me was that Asset Hunter 2 must be installed in the Assets/Heureka/AssetHunter directory. When I first installed the plugin, I moved it into my Assets/Plugins/ directory, which meant the AssetHunterSettingsData file could not be created and various parts of the GUI would hang.

    @KristianHJ, perhaps you could amend AssetHunterSettingsCreator.cs line 26 to use a relative path? Or just mention the specific directory requirement in the documentation. Thanks for the plugin!
     
  49. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    340
    Hi Paulkopetko

    Thanks for sharing your findings.
    It actually already is using relative path, but it just requires the "Heureka" folder as well. I do however agree with you that that is kind of an arbitrary constraint, so I will do something about that and implement a more elegant solution
     
  50. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    340
    Just submitted a fix for v2.5. Should be online in 4-5 days, which is about the time it takes for Unity to approve.