Split and merge assetbundle

Good day guys,

Anyone here tried to split assetbundles to smaller chunks then load it and merge once downloaded ingame.

yes it is a good practice to bundle each file and manage it to be smaller size, but we got this project like this and have no choice but to split and merge it because time is also an issue.

best regards,
Aaron

You can trivially “split” an asset bundle just by reassigning a portion of its assets to a brand-new asset bundle name. Let’s say you have everything in a bundle called ‘mybundle’. You could select certain assets and make them instead live in an asset bundle called ‘myotherbundle’ or ‘bundle2,’ for instance.

If it is a scene asset bundle then basically it has everything all in one and cannot be split like that. But in that case you could make it two separate sub-scenes that are loaded additively and live in separate asset bundles, assuming the scene is structured such that it can be reorganized like that.

If you’re just talking about asset bundles containing random stuff, then you probably want to try and identify the use patterns and relative sizes of things before you make too much mayhem in your project. It might be useful to break assets out by type, i.e., texture, audio, etc. (Texture and Audio are almost always the biggest things anyway.)

Or the asset bundles might not benefit from that approach. It’s really kind of up to what your constraint problem is, and how the project uses the contents of these bundles. Either way, after you have rearranged things bundle-wise, you still have to make sure the runtime code looks in the correct bundle to find what it needs. Trivially, but at some performance cost, you could simply look in every asset bundle you have loaded until you find what you want, or else you can use a heuristic like ‘textures come from this bundle, etc.’

Hope this gives you some insight. Make sure you actually will benefit from this however. Make sure that asset bundle size really is your problem before tearing too much stuff up.

in my case, lets say i cant split them in a different assetbundles,

i have bundle1 that is 1g, i have a file splitter code and merger that works on unity4, but suddenly wont work on unity5,

the script split the file into chunks, (sceneChuk0.android.bundle, SceneChunk1.android.bundle etc…)

has anyone tried that approach before

1g = 1gb in size