The best way of explaining this is to show you guys a screenshot:
These are both Windows builds and the exact same project. My project before for some reason was creating a data.unity3d file which has everything compressed inside of it and was coming out to roughly 300MB. My more recent build is coming out to 1.5GB and has all of these sharedassets files for some reason.
Not sure if this is your problem or not, but have you recently added a folder that might have coincidentally had one of these special folder names?
Particularly something like āResourcesā or āStreamingAssetsā? As I understand, any unused assets in these folders will not be excluded from the build like they normally would.
I have a StreamingAssets folder with data that I delete once itās built. The game pulls almost all of itās resources from the resources folder using Resources.Load(). Iām looking into using the Build Report Tool asset, but the problem is that the file size difference is gigantic when it doesnāt create the data.unity3d fileā¦
What doesnāt make any sense to me is the two builds look completely different in this way, yet itās the exact same game.
Okay so by the way, the only changes I made were to add OpenVR support to the project and to add in the Steam VR asset. This must have somehow caused it to build in a different way. Very confusing to me, Iāve unchecked VR supported and itās still building in this less optimal way.
It could be something else though, but I donāt think I changed much else. Iām using Unity 2018.4 by the way.
Did you say you were using Resources? They will always be built into Unity even if they are not used. In your first build I can see no scene files. Did you add a scene to the build? That would result in all the extra data as we only include assets that are referenced in scenes/assets etc.So if you do a build with no scene and then a build with a scene, different assets will be included.
The Build Report tool is probabaly your best tool to get a better picture of things.
@karl_jones Thanks Karl for the help. All of my scenes are in both builds, there are about 16 of them in the game. Iām not sure why it would break it all apart into the sharedassets files on one build, and then in the same exact or similar build compress it all into a single data.unity3d file.
Using the build report tool Iām getting rid of unused assets though right now, and Iām going to see where my textures balloon up to for some reason 1000MB (my game looks like minecraft with all 128x128 textures or less so weāll see whatās up with thatā¦).
Did you change the platform settings for the build? My understanding is that data.unity3d is generated when compression is enabled for the build. In the build report it will say āCreating compressed player packageā.
How would I enable compression in the windows build then? Here are my build settingsā¦Iām not understanding why it wouldnāt create the compressed player package like it did before.
The Compression Method option. If you did not change it before then I do not know why it has changed between your builds. Do you have source control to check what changed?
Okay yep I feel like an idiot, that did it, and by the way LZ4HC works wonderfully. I think since it said āDefaultā I was thinking it didnāt mean ānoneā. So to anyone as dumb as me reading this, if you select āDefaultā compression it will mean āNoneā, and there will be no compression. My file size of my game went from 1.5GB down to 300MB with the compression, and now on the Steam Store itās down to 98MB. Wow.
I had a similar i issue with the size. Couldnāt work out what was causing it as I manually checked all the same settings. Ended up just creating a new project, moving stuff over, and the build size was back to normal. It wasnāt the compression for me as I didnāt have many assets besides materials and scripts.
Wait it shot back up in size now⦠Not sure why⦠around 80mb in size. Itās hard to see why itās so big without any files.
Wait I found from editor log:
āLevel 0 āAssets/Scenes/Empty.unityā uses 79.7 MB compressed / 133.8 MB uncompressed.ā
Edit:
I think it was to do with shaders. By setting it from Strip Unused, to strip all. Then setting them manually in the keep shaders list, I was able to reduce the build size. Seems a bit buggy the āstrip unusedā not sure if it works as intended.