Unity builds AssetBundles with data ordered in a deterministic manner. This allows applications with custom downloaders to implement differential patching.
The documentation says that binary data in AssetBundle is ordered, but without any more details. From my point of view, what differential patching does is, knowing the assets list in two bundles (say bundle A is older and bundle B is newer), we could calculate the offset of the different assets.
Particularly, just like git merge, we could modify or create a new bundle from local bundle A, and download just part of bundle B to merge the results.
Is there any infomartion about internal structure of AssetBundle file to help implement differential patching?
The format of an AssetBundle is not a deep secret and has been quite stable in past version. We have not released documentation of the format yet. I think that there may be some third party libraries that demonstrate the format, although they may not be accurate.
I think differential patching can work without deep understanding of the format. My main advice is to be sure NOT to use LZMA compression, because that compresses the content as a single unit. LZ4 compression uses fixed size chunks, which will be a bit more patch friendly. And of course uncompressed AssetBundles would work for more fine grained patchig, however the files and patches themselves may be a lot larger (depending on the content).
It’s clear from the documentation that using LZ4 over LZMA would be advantageous for patching. However, I still don’t know how to approach it so that we can do differential patching while using AssetBundle.
As far as I know, the contents of the AssetBundle are binary. Is it correct that I need to compare the binary value of AssetBundle in Custom Downloader and do a manual differential patching here?
I don’t know how to start differential patching of AssetBundle.