Search Unity

Question 'Bad' assets compression on build. (sharedassets0.resource)

Discussion in 'Editor & General Support' started by Gustjc, Jan 29, 2023.

  1. Gustjc

    Gustjc

    Joined:
    Oct 16, 2017
    Posts:
    9
    This is a question that I had for quite a while but I've not being able to find an answer for.

    Why is the unity asset compression so 'bad'? Let me explain what I mean below.
    Is there an editor configuration I'm missing? LZ4 helps, but still.

    This is a problem I've seem is a LOT of unity games over the years and this has always bugged me.
    Why is the sharedassets compression so bad to the point that even a basic .rar compression makes the game 50-80% smaller. For me .rar compression is one of the most simple compressions there is, and if a file is being compressed that much with a simple .rar.... There must be something very uncompressed inside.
    I've seem a few unknown free indie games that goes from 300MB inside a .rar to 4-5+ gigs in size.

    I know that unity has that texture compression options and even model compression and that helps but
    I've just compiled a game here.
    It's a low-poly game and I have literally 1 texture that is 512x512 atlas map.
    All my project assets have 28 MB. A total of 35 MB even if I include the editor-only plugins.

    When I compile the game normally it gets a 175MB game and when using LZ4 compression it still gets a 135 MB game. It's not that much for todays standards but I still find it hard to swallow for a low poly game with barely 30Mb of assets. Its an URP project.

    Back in 2016 an empty unity game build without any compression was 33 MB.
    I've recompiled the same game with 2020 (not URP) and now its about 70 MB.

    But the worst of it, and the main question of this thread is the sharedassets0.resource
    Its a 63 MB and when a put it in a winrar file it goes to 28MB. That's still 50% compression with basic winrar compression. Oddly similar to my original assets size.

    My best random guess is that unity generates something out of the assets to load the game faster?
    Is there an option anywhere to not do that?
    I got into the habit of LZX compressing all unity games I have installed with windows 'compact.exe' which has a similar compression to what winrar does but that doesn't work when distributing games.

    I'm not expecting a solution to this as its more likely something unity does internally to run the game faster but I've still like to understand why this does happen. So does anyone have an explanation of why this happens?