Search Unity

Asset Bundle Compression

Discussion in 'Scripting' started by tinman, Dec 4, 2012.

  1. tinman

    tinman

    Joined:
    Jan 8, 2011
    Posts:
    229
    Hi Everyone,

    I'm making an asset bundle for one prefab of my game. In WebPlayer, my entire game is about 7mb. I have many meshes, sounds etc.
    Now from what I see when the asset bundle is being made, it uses the same LZMA compression as the WebPlayer, except just for this one item, which is just a small part of the game, the asset bundle is a whopping 1MB. I have several of such meshes in the game, including many others, so it seems the compression is much less effective in asset bundles compared to WebPlayer. Is this true or am I missing something?
    Thanks!
     
  2. NTDC-DEV

    NTDC-DEV

    Joined:
    Jul 22, 2010
    Posts:
    593
    Check your editor log in your console for more information as of what was put into your asset bundle. Sometimes there are suprises...
     
  3. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    This is a basic compression theory problem. Compression requires that a lot of data is 'the same' to be replaced with tiny yet reconstructable replacements. The more data you have the higher the likelyhood that you find such data especially on preprocessed, redundancy reduced data like meshes.

    If you include it in the webplayer it has many more meshes that share similar data for compression, but when its on its own, it has no other objects with similar data and has to gain a compression benefit only from its own data.
    If you add in animation it will normally get even more impacting.

    You will see similar effects on images and sounds too.
     
  4. tinman

    tinman

    Joined:
    Jan 8, 2011
    Posts:
    229
    @PolishRenegade - thanks, that did indeed clear up some things :)
    @Dreamora - thank you too! I see exactly what you mean, makes sense. Nice to "see" you again :)