When building, one build has data.unity3d, another has sharedassets files and is huge?

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.

1 Like

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?

1 Like

Unfortunately I haven’t been using source control. The two compression methods are LZ4 and LZ4HC, gonna look up what that means.

Like I said earlier though I implemented OpenVR and installed the SteamVR asset package, but I unchecked virtual reality supported before building.

1 Like

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.

3 Likes

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.