Closed BLKTower closed 1 year ago
Ok, seems I missed something when editing assetbundle asset's raw data. After fixing that, the rebuild assetbundle can be loaded in AssetStudio, and the removed assets are gone. However, the rebuild assetbundle size doesn't change. Shouldn't it get smaller since I removed assets?
I tried to remove some assets and save, but the assetbundle asset in the assetbundle doesn't change
That's normal, UABEA doesn't edit that asset unless you explicitly edit it yourself.
However, the rebuild assetbundle size doesn't change. Shouldn't it get smaller since I removed assets?
It does get smaller. What you're probably seeing is the decompressed bundle size offsetting the size of the assets you removed.
Thanks for your reply.
It does get smaller. What you're probably seeing is the decompressed bundle size offsetting the size of the assets you removed.
Is there a way I can remove this offset?
What I meant was that when you opened the file, it became decompressed (therefore, larger size.) You then removed some assets which made the size go down and be about the same as the compressed bundle. What you want to do is compress the bundle again so that it's smaller.
What I meant was that when you opened the file, it became decompressed (therefore, larger size.) You then removed some assets which made the size go down and be about the same as the compressed bundle. What you want to do is compress the bundle again so that it's smaller.
I've already tried, but it only decreases the size to the original compressed assetbundle size. See the original assetbundle is LZ4 compressed (Image 1/2, 320kb); after I load the bundle (decompressed), remove the assets and save, the new assetbundle is (Image 3/4, 612kb); then re-compress the new asset bundle with LZ4, still 320kb (Image 5/6).
AssetStudio is slightly misleading here. The size in the Texture2D includes the resS size which is never modified by UABEA (rebuilding this every time would be slow). In reality, by removing the other assets, you probably only save 700-800 bytes by removing the other two. The reason why the resulting bundle is bigger could be that Unity's LZ4 compression settings are higher than mine are set for.
Sorry, I don't quite get it, could you please explain more? That would be a great help.
I know the size display in AssetStudio is misleading and confusing, so I'm not counting on it. But the file size on disk the OS telling me is that the size is not changed. This assetbundle only contains 2 images (bundle_centaurarcher
and bundle_wolfhuntress
, size of each image are very close), how could it only saves 700-800 bytes by removing one of the two? Shouldn't it reduce the size by nearly half?
As I said before, the resS is not modified by UABEA and the resS probably contains the bulk of the data in the bundle. Feel free to click export raw on the Texture2Ds in UABEA and you can see their true asset size in a hex editor.
As I said before, the resS is not modified by UABEA and the resS probably contains the bulk of the data in the bundle. Feel free to click export raw on the Texture2Ds in UABEA and you can see their true asset size in a hex editor.
Oh ok, I got what you mean, thanks for your patient explanation. So there is no way to actually remove the asset data from resS file?
Besides manual edits, UABEA (nor any other tool like UABE or UnityPy) have no way to automatically remove resS data and edit all Texture2Ds to point towards the new offsets.
Besides manual edits, UABEA (nor any other tool like UABE or UnityPy) have no way to automatically remove resS data and edit all Texture2Ds to point towards the new offsets.
Got it. Issue closed.
Instead of replacing assets, is it possible to just remove some assets (guarantee no dependency issue), then rebuild the asset bundle? I tried to remove some assets and save, but the assetbundle asset in the assetbundle doesn't change. Also tried to edit the assetbundle asset's raw data and save, which causes the assetbundle corrupted.