I am working on a web player project where there are hundreds of large (~250k) textures and corresponding models, and the scene will need to load up some small number of them as defined at runtime.
I bought a Pro license so I could use asset bundles, since I figured it would be a cleaner way to manage all of the data. I had never used them before, so I’m not sure if I did it right, but I found an example editor script and made a bundle out of just one model with its texture.
I loaded the GameObject back up and instantiated it fine, but the .assetbundle file is 1.5 times bigger than the size of the texture. Now, I know that having many fewer WWW requests is great, but it seems like it will take up even more space than hosting the texture files individually. I’m not extremely worried about this but I am curious as to why it is so much bigger.
My actual question is, I was wondering if there was some recommended size for asset bundles? Presumably it would be better to get many GameObjects into one bundle so I don’t have to make too many WWW requests, but at some point the file will be too big for it to be worth it.
Sorry if this is a stupid question, I am still new to this stuff. Thanks!
How big was the original test object? The asset bundle does add some extra data to catalogue what is stored inside but I wouldn’t expect this to add much overhead to a file that is already pretty big. Is this what is happening in your case?
Well, the texture file is about 250k, but the model I used to test with is pretty simple - the .prefab file for it is only about 10k. And that one model with that texture on it was the only thing I put in the asset bundle.
the prefab does not store any model information.
only relationships on what is stored on it as well as the variables set on components.
the mesh will go in itself and they easily pick up quite some space. With texture sizes in the 512 pixel range and smaller and compressed, a several thousand poly mesh with more or less smooth normals will easily compete in size with it.
For the asset bundles I’ve done in the past, meshes commonly were the 2nd largest part after movies, with textures being the 3rd largest.
I see, that makes sense. So how many models do you think should be in each bundle?
bump, sorry again if this is a stupid question. Is there, in general, a practical size limit for asset bundles? I don’t think the use cases for this project will be specific enough to define how many models should go into each one.
Put in how many you want.
In the end its about how you want to handle the loading etc
For the webplayer, to be sure the browser caches it if you don’t pay for a cache addon license, the bundle would need to be in the 1mb range basically beyond that it can but not needfully will cache anymore