Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Library folder huge

Discussion in 'Editor & General Support' started by DrSpoutnik, Nov 20, 2022.

  1. DrSpoutnik

    DrSpoutnik

    Joined:
    Jan 14, 2018
    Posts:
    72
    hi i know this topic comes often...
    but i don't understand why my library folder is so huge : 13go ! my game project is only about two caracters spirte (psd), few rocks lowpoly and not much hudge textures... all the files in windows explorer should weight no more than 50mo, so i don't understand the difference ?
    i read i shouldn't care about the size of this folder, but i a bit scared that it would increase more and more as my game developmente keep growing ? somewhere i read i should delete the whole library folder to purge it, then unity would rebuild it (lighter) restarting...
    i'm a bit confused...

    In case it could helps : i import psd files of 1920x1920px in single sprite mode to build animation clips (run, idle, walks, etc.)
     
  2. DrSpoutnik

    DrSpoutnik

    Joined:
    Jan 14, 2018
    Posts:
    72
    i just try to build and run my level (just iteration of a lowpoly rock for the environnement, a player and an ennemy sprites)
    the sharedfiles weight 9go for a simple poor test level...!
    i think that's problematic : i can't ask people to download a 9go game for moving trough two screens and 15 seconds of game play. i don't understand.

    i tried create another project, and just copy the asset folder of my actual project into instead. (replacing the whole folder)
    unity recreate the library folder and it's worse : 18go. but i dont understand, the project is almost empty, only fews sprites and few low poly rocks...???
     
  3. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,610
    The Library folder is just a cache folder that Unity uses to speed up some things during development. It doesn't get built into your game.
     
  4. DrSpoutnik

    DrSpoutnik

    Joined:
    Jan 14, 2018
    Posts:
    72
    Ok, but it getting bigger and bigger, i wonder, when it's gonna end.
    Plus, after built the game for a try, i have a 9gb of "sharedassets0.assets.resS" wich is hudge.
    if peolle would like to try my little game, i can't expect them to download 9gb for a so little thing (it won't be Red Dead Redemption, i mean :D )
     
  5. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,610
    How many assets do you have sitting in folders named Resources? Those plus any assets in a StreamingAssets folder will always be built into the games files regardless as to whether they've been used in a scene.

    As mentioned the library folder isn't indicative of the game's built size.
     
  6. DrSpoutnik

    DrSpoutnik

    Joined:
    Jan 14, 2018
    Posts:
    72
    ok thanks Spiney.
    i understood that the library folder isn't indicative for the game's built size.
    However i'm concerned with :

    1/ the size of the library folder wich i found disproportionnally huge (21Go of library files for 647Mo of Assets). if eventually it' stays around 20-30Go for a whole game it won't be a problem. but considering i'm just at the early stage of my project (i don't even have a real complete level, just few tries and no much elements in it, all of them are low poly and sprites) i'm scare taht in the end, when i complete a full level, or several levels, in the end the library folder reach 1To !

    2/ the built may be without any relation to the library, however, the files are 9go for a ridiculous tiny level...
    the files "sharedassets0.assets.resS" in "my project data" weight 9go on his own.

    In the "resources" folder, there only 2 files, and the folder is only 4,50 Mo
     
  7. DrSpoutnik

    DrSpoutnik

    Joined:
    Jan 14, 2018
    Posts:
    72
    i did some tests :
    - my sprites are .psd rvbA files imported with PSD importer package and it seems to be really heavy both in library, and in the built. the psd sequence itself size is 10mo.
    - i created an empty project test and import : installed PSD import package, boom, the library get 1Go even empty. then i import my psd sprite sequence, boom, almost 2go. (for a single 10mo animation !!)
    - i deleted the PSD, uninstall the PSD importer package, import the same sprite sequence in PNG (the size is even lighter : 2,83mo for the same animation), and the library size turn to 283mo... wich is 10x less than with PSD.

    Now, i think i will do the same for all animation in my main project (import all animations in png, ununstall psd importer, delete all psd files left) to compare both library and built size, but i need few hours to do so.
     
  8. DrSpoutnik

    DrSpoutnik

    Joined:
    Jan 14, 2018
    Posts:
    72
    EDIT :
    after reexporting all my animations in PNG to unity, delete the older versions, uninstall psd importer of my project, the library folder goes from 25go (few days ago it was 13go, without adding nothing else, it just reach 25go !!??) to 11go.
    i think 11Go it still ridiculously huge for the files i'm dealing with (100mo maybe) but that way better.
    ok, the folder size doesn't matter for the game, i know.
    But after that, when i built the level, instead of 9go i got 617mo... wich is better (even if i don't understand where are the extra 500mo difference form the files imported...)

    well, no more psd for me !!