assetbundle optimize

A big map can be packed into assetbundles,and then loaded dynamicly.
while we usually there are too much resources which have been shared by more than 2 assetbundle files.
we have two chioce to build the assetbundle:

  1. build the map objects one by one
  2. build the whole map objects into one assetbundle
    the question is :
    when wetake the first method,then the total size of the assetbundle files will be much more larger than the second.
    if we take the second method, then the use would wait for a long time to load one big assetbundle file.
    the reason why the total size woulde be much larger than the second ismainly because shared textures I think.
    So I’m considering build the shared textures separately,and then when we just need to load them one time.
    while I also found that even do this the final total size of asstbundle files still too much larger than the size of the assetbundle which is built by 2nd method above.

So I’m wondering how do you arrange your assetbundles with shared resources.
by the way,the project will be published on web.

any idea will be appreciated

The only reason why #1 should be much larger is because of data duplication. But if you duplicate the material then you’ll also loose out on the dynamic batching. So you could try to let the asset bundles share resources when possible. Its a bit more work to rewire the connections but if you wanna eat your cake and have it too; you may have to work for it. :slight_smile:

Having a material with a particular built-in shader could be a hint to look up the material from another asset bundle. Of course you then have to write someway of locating the correct asset bundle that contains the material, texture and shader. So when you load the models from the asset bundle you could scan it for stuff like this and do the rewiring manually. You could also add it as a monobehaviour that handled it smoothly.

Lots of possibilities, but they do require some effort.