Search Unity

Why is one BLANK scene 10MB, while another is only 600 KB? Do scene files retain past data?

Discussion in 'Editor & General Support' started by ak0382nflakn309gn, Mar 14, 2016.

  1. ak0382nflakn309gn

    ak0382nflakn309gn

    Joined:
    Feb 29, 2016
    Posts:
    6
    Here's what I did:

    • Created a blank scene. Started at ~600kb...

    • Added terrains, models, audio, code, etc... Now at 10 MB.

    • Days later, deleted all objects from that scene. STILL at 10 MB.

    • Delete GI cache, temp files, etc... Then restart Unity. Still at 10 MB (and still only a blank scene)

    • Then I create another blank scene and started at 600 KB, just like the previous one had.
    So, why is the previous scene 10+ MB even when blank? When I add objects, the number goes up. When I delete objects, the number only decreases a bit.

    I was told that the mininum scene size in Unity is 10 MB? Then why do all my NEW blank scenes come in the 600 kb flavor?

    SO, I figured, perhaps I needed to add something to a new scene to make it go up to 10 MB. So I added all the objects that used to be in the previous scene, into the new one. Yet, the new scene only grew to about 3 MB.

    The only difference betw. the old and new scene? The new scene is 10 minutes old. The previous scene is about a week old and had withstood tons of modifications along the way.

    Therefore, it seems as if the scene files still retain data from its past edits. Is this true? Is there another explanation for this? No wonder my proj folder has is still at 15GB + even when I did a heavy object clean up in all the scenes...
     
  2. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    The answer might be interesting I guess, but you might also need to ask yourself... why do you care? :)
     
  3. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    I believe you can turn on "force text" in the settings and then inspect the meta file to find out. Haven't tried it myself for scenes (have for other file types) but it should work so you can compare the two.
     
  4. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Yeah a scene can contain anything you previously baked I guess, plus any serialized data.
     
  5. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Serialised scene data does sometimes hang around. I've noticed that reading a field that was previously removed will often have the same serialised data.

    @greggtwep16 has the right idea. Just force it to text and have a look.
     
  6. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,366
    I've seen this behavior before. Will make some tests again and see what happen.
     
    Last edited: Mar 14, 2016
  7. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    If you look in the Library/metadata folders Unity builds up some massive HD hogging files, that could be easily compressed but last time I tried turning on compression (in windows) the Unity project failed to work.

    On the plus side there are some tips for recovering lost scenes if Unity crashes or your code locks up!

    I think it loads these files to build up a cache of platform specific assets, you can delete all the files in meta data but everything will be re-imported the next time you load the project. I'm not sure if re-import all will clear this data though.
     
    Last edited: Mar 15, 2016