Search Unity

Asset Hunter (Project cleaning tool)

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

  1. SirOhlamon

    SirOhlamon

    Joined:
    May 2, 2017
    Posts:
    7
    Hello, @KristianHJ
    I think there is problem with "Nested Prefabs"
    If i use any nested prefab like this:
    Prefab A -> Contains prefab B and C
    Prefab B -> some meshes
    Prefab C -> some meshes

    In report we got only prefab A as used but Prefab B, C is UNUSED. But its not true.
    Can it be fixed?
     
  2. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    350
    Hi SirOhlamon
    Thank you for bringing that to my attention, haven't tested nested prefabs with asset hunter.
    Is it the preview build, or were nested prefabs released without my knowledge?
     
  3. SirOhlamon

    SirOhlamon

    Joined:
    May 2, 2017
    Posts:
    7
    You not necessary to fix anything (Because this is the 3rd party tool), but it would be great
    There is great assets for nesting prefabs (since mar 2017) https://assetstore.unity.com/packages/tools/utilities/nested-prefabs-84495
    Its works really great and useful. Also it contains free trial version, and you can test it and fix your script if possible.
     
  4. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    350
    Oh, didn't realize you were talking about a 3rd party tool. Unity will roll out their own nested prefabs in 2018.3 i believe and I will be supporting that. Its next to impossible to support 3rd party editor tools that at edit time generates assets from other assets. Sorry to say, but I wont be supporting 3rd party tools as there are simply too many.
     
  5. MetaDOS

    MetaDOS

    Joined:
    Nov 10, 2013
    Posts:
    157
    Hi. Is it possible to open log from Unity Cloud build?
     
  6. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    350
    Hi LeGiangAnh

    To be perfectly honest I have never used cloud build so I'm not really sure what information I can access.
    Do you know if you get any sort of buildlog etc?
     
  7. MetaDOS

    MetaDOS

    Joined:
    Nov 10, 2013
    Posts:
    157
    Here it is.
     

    Attached Files:

  8. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    350
    Thanks for the log. Unfortunately the format of that log is not identical to the local build log, so it wont out of the box.
    I'm currently in the process of re-writing Asset Hunter completely to improve speed, UI and workflow so I wont be including any more major features in v2, but I will however try to see if there is a good way to incorporate cloud build logs into the upcomming v3.
     
  9. Meceka

    Meceka

    Joined:
    Dec 23, 2013
    Posts:
    423
    Hello, after taking a build can I use Asset Hunter to see unused scripts? In "Show Types" list, I couldn't find a toggle for "script" and it doesn't show any scripts even if I select all.
     
  10. nsmith1024

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    870
    Is there any nice video tutorial on how to use AnyIK-3 with UMA?
     
  11. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    350
    Hi Meceka

    Unfortunately asset hunter does not support finding unused scripts, although it very high on my wishlist, I have been unable to find a foolproof way of doing so yet. The reason being that all (non-editor) script are added to the build and can be instantiated through stuff like reflection. Its actually one of three disclaimers on the store page :)
     
    Last edited: Sep 26, 2018
  12. Meceka

    Meceka

    Joined:
    Dec 23, 2013
    Posts:
    423
    Hi, I can recommend you to also add that disclaimer to the documentation, that's the place I checked before posting here :)
    I understand your concern with being foolproof. But for developers that don't use reflection or other stuff maybe you can allow the option to see unused code with some toggles and disclaimers in red text explaining it's not 100% accurate.
    In my case, I just need some hints to find unused code, it doesn't need to be perfectly accurate. I made some research and couldn't find any good way of doing this. (Exporting/selecting dependencies and etc. doesn't work)
     
  13. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    350
    Hi Meceka
    You're touching a weak spot there with regards to documentation. I should really get that updated...
    Any attempts to show unused scripts would potentially be extremely flawed because of stuff like
    gameObject.AddComponent(typeof(CustomClass)) so I would have to add TONS of warning for people relying on that. Also interfaces as well as abstract and partial classes are tough to solve.

    Regardless, it wont be in an update for AssetHunter2 as i am currently working on a complete re-write to speed up the processing and to bring you guys a new and better UI. That also means that only very minor fixes will go in the current v2, whereas stuff like this would go in the upcomming v3.
     
  14. hammmm

    hammmm

    Joined:
    Oct 5, 2013
    Posts:
    1
    Hi,
    Our project is one big Unity project but has several build modes. And these build modes are using different scenes and files using #ifdef and also removing some files on build time. So the build log for just one build can not determine unused files in the project tree.
    So, can I use multiple build logs to be used in Asset Hunter 2?
    I'm thinking about a workaround that merging build logs into one with text editor. Do you think it will work?
     
  15. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    350
    It would probably be possible (With a few minor tweaks to code)
    I am however currently working on a complete re-write of Asset Hunter that could probably do this quite easily, would you be interested in testing this. I'm pretty close to completion, mainly lacking UI work, but it would be nice to have a couple of "outside" people with non-standard projects take it for a spin before releasing. Write me at contact@heurekagames.com if you like to try to test the new Asset Hunter version.
     
    Last edited: Oct 29, 2021
  16. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    429
    New user. Very much enjoying the view of the build report :) and somewhat shocked at some of the unnecessary stuff that's being included. (mostly shaders but also custom inspector banners)

    Does anyone have any advice on how these can be excluded from the build, but without deleting them from the project?

    @KristianHJ Would it be possible to add this kind of 'disable' functionality in the upcoming Pro version?
     
  17. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    350
    Hi JeromeWork

    Asset Hunter PRO (And actually current version as well) has the ability ignore certain assets (or asset types) so it wont show up in the build report. If I understand correctly though, you are asking for a way to force Unity to exclude certain assets when building, am I correct?
     
  18. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    350
    Here's a couple of teaser videos for Asset Hunter PRO (Will be released in January)

     
  19. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    429
    Yes, I'm talking about actually excluding assets from the build, not just the display of the build report.
    More something like the ~ (tilde) trick mentioned here:
    https://forum.unity.com/threads/excluding-folders-from-build.408375/
    (or ideally something more robust)
     
  20. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    350
    Hi Jerome

    Theoretically I could add a tilde when the build starts, and then remove it again after build has completed, but just not sure whether or not it would work. I will definitely add it to my backlog of stuff to investigate because it seems like a valuable addition. Just not able to promise anything
     
  21. SpyrosUn

    SpyrosUn

    Joined:
    Nov 20, 2016
    Posts:
    144
    Is asset hunter pro going to be a separate asset from asset hunter 2? I want to buy it but I would rather get the newer one if it's going to be separate :D
     
    Last edited: Jan 1, 2019
  22. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    350
    Hi Spyros
    It will be separate from Asset Hunter 2, but I will be making the upgrade free for all AH2 customers within the last 6 months. For customers before that day there will be and upgrade fee (Less than full price)

    So no need to wait, better take advantage of the current sale :)
     
  23. SpyrosUn

    SpyrosUn

    Joined:
    Nov 20, 2016
    Posts:
    144
    Thanks ! I just missed on the sale though :( I guess I may wait a bit now then. I thought they would give a warning before the sale is over, weird that they ended it so abruptly.
     
  24. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    350
    Yes, they have really been slacking with regards to communications from the asset store team recently. There is almost no information coming from twitter/facebook etc anymore.

    Sorry to hear you missed the sale. Asset Hunter is relatively often added to sales, but it will probably be some months before it happens again.
     
  25. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    350
    Last edited: Jan 12, 2019
  26. Zebbi

    Zebbi

    Joined:
    Jan 17, 2017
    Posts:
    521
    Hey there, I bought it at the end of May but I haven't actually used it yet, what is the upgrade fee?
     
  27. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    350
    Hi Zebbi

    All customers who made their purchase prior to the 180 grace days will recieve a 60% discount on the new Asset Hunter PRO.
     
  28. Zebbi

    Zebbi

    Joined:
    Jan 17, 2017
    Posts:
    521
    Thanks, just bought! Quick question about using Asset Hunter Pro, it doesn't detect prefabs that are used in Adventure Creator menus, is this because AHP doesn't know about how assets are using prefabs? It may be this way with other assets that rely on prefabs, just wondered if there was a way to force it to know?
     
  29. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    350
    Hi
    Hi Zebbi

    I'm not familiar with how Adventure Creator works, and it indeed quite hard to make sure Asset Hunter works with all 3rd party assets, since sometimes they apply some sort of pre-build step where assets referenced in scene is replaced with some generated assets - which is impossible to detect.

    If you want you are more than welcome to send me (contact@heurekagames.com) a small test project in which an 'Adventure Creator' asset is not detected as used.
     
    Last edited: Oct 29, 2021
  30. imgumby

    imgumby

    Joined:
    Nov 26, 2015
    Posts:
    122
    So...Before I spend another $10 on updating a tool that largely sits unused....is this a one time fee for the "Pro" version 1000x times faster,,,whiter whites in cold water etc ...;)..or are you going to come out with a Pro+ version next year and ask for more update fees ?
    thanks in advance
     
  31. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    350
    Hi imgumby

    Personally i think my track record speaks for itself. I started with releasing Asset Hunter as open source in 2012, then I released a paid version with proper ui and additional features in 2014. I have been doing regular updates on that package for more than 4 years, and responded to any and all requests within a few days.
    Early 2018 I then decided that in order to move Asset Hunter forward as a tool I would need to do a complete rewrite. Not a single line of code is reused (ah, maybe a few). I then decided to make it free for all new customers within 6 months and give 60% discount for all other previous owners of Asset Hunter.

    I think all of the above speaks pretty clearly for me not trying to milk people, but in 4-5 years time when Unity API changes has made it logical for me to redo everything once again, I might do Pro+ but for now i just plan on supporting Asset Hunter PRO in the same consistent way as have done with Asset Hunter 2 for more than 4 years.

    Hope this answers your question
     
  32. imgumby

    imgumby

    Joined:
    Nov 26, 2015
    Posts:
    122
    Yes it does..thanks..just a shame you deprecated asset hunter 1 in the process.Would've made a better choice for those of us who couldn't afford to upgrade before the 180 day grace period...or just don't need all the new bells and whistles...it'll be dead next api change...there goes another asset I bought on conjecture...meh...it'll join Opsives stuff and Ork in the bin for awhile until I decide ..they live there permanently as a reminder of bad decisions made..
    thanks again
     
  33. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    350
    Well there is nothing stopping you from downloading Asset Hunter 2 if you already purchased it. It is fully functional.
    I actually un-deprecated Asset Hunter on thursday, but it takes Unity a few days before they are able to release it on the store.

    I deprecated it because I dont want people to buy the old version, as they really should purchase PRO instead. Its better in everyway and costs the same. If Unity would allow me to keep AH2 live, but remove the purchase button, that would be fine, but thats unfortunately not an option as of now.

    I will try to keep it live, and then just write in large capital letter for people not to purchase old version, but the options regarding upgraded packages for a publisher is quite limited.

    So in summary:
    AH2 is still avaliable for download so you have lost nothing
    AH2 is tested with 2019 beta, so it will continue to work throughout that
    AHPRO is avaliable either free or with a 60% discount for existing customers
     
    Last edited: Jan 22, 2019
    hopeful likes this.
  34. r_chevallier

    r_chevallier

    Joined:
    Apr 20, 2014
    Posts:
    31
    Hello,
    Just purchased the upgrade Asset Hunter Pro. Only $10.00 after discount which is reasonable in my opinion.

    My Question-
    I am trying to simplify all my files so I deleted Asset Hunter 2 prior to importing Asset Hunter Pro.

    I now get this Error:
    The type or namespace name 'AssetHunter' could not be found (are you missing a using directive or an assembly reference?)

    Compiler Error at Assets\Heureka\AssetHunterPRO\Editor\Scripts\AH_VersionUpgrader.cs:62 column 96

    Do I really need to re-import Asset Hunter 2 back into my project for Asset Hunter Pro to not have this error?
     
  35. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    350
    Hey Chevallier

    I added an upgrade function that should allow existing AH2 users to transfer their settings to AHPRO. Apparently you found a bug with that process.

    Open Playersettings, find 'Scripting Define Symbols' and remove "AH_HAS_OLD_INSTALLED"
    That should do the trick, let me know if it doesn't.

    upload_2019-2-1_12-16-2.png

    I thought I had automated that process fully, must have missed something though, can you remember the steps you took for this to happen?

    EDIT: Actually I think I found the bug. I think it happens if AHPRO sees you have AH2 installed, prompts you to transfer settings, you say no, and then deletes AH2. Regardsless I will have a look to fix this in next release, but you should just remove the Scripting Symbol as mentioned above, and you should be good to go
     
    Last edited: Feb 1, 2019
  36. egable

    egable

    Joined:
    May 21, 2014
    Posts:
    23
    I don't own Asset Hunter yet, but I plan to buy it in a month or so. In the meantime, I read a review which said you have issues detecting assets which are spawned after the game starts as opposed to being in the scene on load. I just wanted to suggest that you look into how to hook into the asset loading which happens when the game runs. Then, you can get a callback on each asset loaded during runtime and build a list of assets (stored in the project somewhere on disk) and when you last saw them used while the game was running. Then you can provide a "stale assets" threshold where any assets it hasn't seen in the game after X number of launches and Y calendar days (need both in case people take long dev breaks on a project) you could flag as Stale and let the user manually resolve whether to keep them. The stale assets could be listed somehow in the Unity UI (sortable by name, size, X launches ago, Y days ago) while the game isn't running so users can do manual cleanup of those assets whenever it suits them and in whatever order they want. You could even offer an option for them to permanently resolve a stale asset as "never remove" or "don't alert me about this asset for X days / months / years / launches of additional staleness". People would probably use those options for assets marked as stale because they are in a baked section of the game which they are no longer actively working on (and thus not testing during runtime).

    I, too, will have lots of spawned assets which won't be present in the scene by default, so I could really use that functionality myself when I buy this.
     
  37. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    350
    Hi egable

    I remember that review. I asked the reviewer to give me examples of what he was experiencing but he never responded as far as I remember. I haven't heard anyone else experiencing this problem, so I think it might have been a misunderstanding on his part.
    The thing is; if a spawnable asset is directly referenced from scene, Asset Hunter will pick that up. If it is NOT directly referenced from scene and its spawned at runtime, it probably lives in the Resources folder. Everything in that folder will be added to the build regardless, so that shouldn't pose a problem either.

    Your idea could probably hint to which assets are spawned in game, but it would be problematic with regards to assets that would spawn rarely i.e. some legendary drop from a boss. That asset would spawn rarely by default, and thereby be marked as "stale".

    Regardless I dont think you should worry too much about that review, as no one else have contacted me with that problem, and quite a few people have purchased this asset. If you, against all odds, would experience something other than expected behaviour, feel free to contact me - either here, or at contact@heurekagames.com, and we will figure something out
     
    Last edited: Oct 29, 2021
  38. egable

    egable

    Joined:
    May 21, 2014
    Posts:
    23
    Thanks, I will let you know if I have any issues with it after I pick up a copy. I don't have a need for it quite yet, but I know it's coming. I'd buy it now, but I've bought so many other assets in the last couple weeks I'm a bit tapped out. :p
     
  39. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    350
    I just submitted a fix in 1.1.3 which should fix this issue by making sure the compile symbol is removed if AH2 is deleted.
    (This fix is only for everybody other than you though :(, You will however still have to delete the symbol manually, since I couldn't fix the issue retroactively and you already encountered it)
     
  40. hoevetim

    hoevetim

    Joined:
    Dec 5, 2018
    Posts:
    1
    Hi, I'm running into a issue where creating builds throws a bunch of errors saying `Unable to read header from archive file` for several folders and files. Any clue what could cause this? Adding those folders and files to the ignore list unfortunately doesn't seem to help.
     
  41. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    350
    Hi hoevetim

    Sorry to hear you are experiencing problems. I think your issue must be related to AssetBundes LoadFromDisc: https://forum.unity.com/threads/unity-5-3-bundles-unable-to-open-archive-file.372799/

    This seems like a well known Unity issue, but I will look into how/if Asset Hunter can circumvent it.

    Until a fix can be submitted, you can open AH_SerializedBuildInfo.cs and comment out line 201 - 241.
    Sorry for the inconvenience

    EDIT: Managed to find out what was going on. It wasn't really a problem, Asset Hunter found all the correct assets, but Unity threw an error nonetheless. While digging through the Unity API I found another way of reading contents of assetbundles though which wont cause that error message to appear. I will implement that in next release (1.1.6). Submitting today, so it will probably be live this evening or in the beginning of next week.
     
    Last edited: Feb 8, 2019
  42. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    350
    So I've experienced a bit of problem getting 1.1.6 live, for some reason Unity´s automated process failed, and the submit was never added to their review queue. I've released 1.1.7 now (Skipping 1.1.6) and it seems to be working, so hopefully that version will be live in a few days.
     
  43. Kinogoblin

    Kinogoblin

    Joined:
    Feb 19, 2017
    Posts:
    2
    Hello! I had some problems when I built the build. I get this error and do not want to analyze the build.It would be great if you could help me :)
     

    Attached Files:

    • 1.png
      1.png
      File size:
      203.8 KB
      Views:
      733
  44. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    350
    Hi KinoGoblin. Sorry for the inconvenience. I haven't seen that error before, but I will try to investigate. If there is any change you might be able to send me the project (I know that might not be feasible) you are welcome to do so at contact@heurekagames.com.

    In the meantime, if you dont need to analyze the given build, you should be able to toggle this value OFF.
    upload_2019-2-17_14-18-17.png
     
    Last edited: Oct 29, 2021
  45. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    350
    So I forgot to make a safeguard (I didn't think it was necessary there). I will have a fix released in 1.1.9, but until then you can goto line 186 in AH_TreeviewElement.cs and change this line:
    Code (CSharp):
    1. this.assetSize = Profiler.GetRuntimeMemorySizeLong(asset) / 2;
    to this:
    Code (CSharp):
    1. if(asset!=null)
    2.                         this.assetSize = Profiler.GetRuntimeMemorySizeLong(asset) / 2;
     
    Kinogoblin likes this.
  46. Kinogoblin

    Kinogoblin

    Joined:
    Feb 19, 2017
    Posts:
    2
    Thanks a lot. It helped. You are the best !
     
    KristianHJ likes this.
  47. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    350
    Thanks, that's what I'm here for :)
     
  48. blast0002

    blast0002

    Joined:
    Nov 24, 2015
    Posts:
    2
    Hi Kristian, quick question. I have some files that are being marked as "used" and show a large "asset size". However, they have nothing under "level refs". When I delete the files from my project, it no longer shows up in my build report, but does not change my actual apk build size. Any idea, why these are showing up as being used and taking up asset size, when I don't believe they are? Attached is a screenshot of 9.png and 8.jpg. 9.png is not actually used in the project, only in remote asset bundles. Thanks for any insight!
     

    Attached Files:

  49. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
    I wanted to say, I for one glad you have a new version , and I bought your first, we have upgraded to the second..... I understand, how things work....so I have no problems paying the upgrade costs as this is how it should be...You should be PAID for your work.....

    The more people understand that, the better.... Modo, charges Yearly Substance does, and Auto Desk used to, but charges subs, and many more do....This is common....You provide it a service we should PAY for it... it shouldn't be free for ever...as you could never stay in business...So I just wanted to let you know many others understand this and should.......

    When we make our games, as multi player, we have people throwing fits when we charge for DLC's.... it cost money to make, and we tell people all the time, you aren't forced you don't have to buy it...but its there...if we keep giving everything away for free, we will be out of business one day.... Companies need money coming in, that is how it works.

    So I think Unity should have a system in place for you guys, that you can easily charge a yearly fee... for major upgrade releases or yearly releases or assets like this, that add new content... This way you can keep making great tools allowing us, to make a nice living as well.

    So thanks for this........instead of closing it done, as I seen other good assets shut down....due to them working for free..... 10-20 dollars is a lunch money for many people....My pizza cost that today...So, again, we support you, and I wanted to say thanks for your hard work.

    PS: I used your asset for a few years.. So I never needed support, but wanted to show you my support. ) Keep it up..and we support, you charging updates...
     
  50. kavika

    kavika

    Joined:
    Feb 23, 2017
    Posts:
    4
    Is there a way to dump the list of detected orphans to a file, instead of just having them in the UI? I'd like my team to have a text document with a list to manually review. I would prefer to work off google docs together, then have one person carefully delete on one branch, test it there, and perge the files from LFS. I'd rather not have 5 people deleting files in the repo :)