I’ve been having a hell of a time getting asset bundles to work for me in my project, and wanted to know if this was a common issue. My game is primarily a 2d game with a lot of textures… about 500mb of textures in png format. But when I try to build them into an asset bundle though, unity explodes and throws out vague error messages.
Despite how incredibly unhelpful error message is, I eventually found out what it’s trying to tell you: the asset bundle is too big. Asset bundles have a maximum size of 4Gb… but this number is misleading. Even though I have only 500mb of textures, when they’re imported as truecolor textures in unity, that 500mb balloons to 12Gb. Unity guidelines helpfully tell us that these assets will get compressed at build or in asset bundles, and that’s true, but the asset bundle size limit is based on uncompressed asset size.
If I split up the asset bundles into small enough pieces based on the uncompressed size of the textures and use crunch compression, I get about 700mb worth of bundles, which is more than the 500mb of input pngs, but acceptable. Doing this though is made considerably harder by the fact that there is no way to tell what the uncompressed size of any one asset is. For textures I can estimate by loading every texture and calculating size when I want to build bundles (terribly inefficient), but other assets I’m out of luck.
Ultimately the best solution in terms of size and speed (no need to wait 3 hours for unity to import textures) would be just to rename all pngs to .bytes and bypass unity’s asset processing entirely. Then I could load them by creating textures from pngs. But I don’t want to do that, I’d rather use the correct process. But the correct process just doesn’t work.
Am I doing something wrong here or is the whole thing actually a huge mess?