- Home /
Any idea on how to speed up assetbundles loading ?
Hello community =)
Let's sum up my application a bit: Someone creates a scene using a part of my software, then he shares it with his friends and they can play it with the other part of my software.
When the creator decides that his scene is finished, he asks for a bundle in wich a server will place the assetbundles containing the differents objects of his scene, the client will then download it and reconstruct the scene.
An average scene is ~20-30Mo, large ones can be up to 70Mo.
Currently, a client takes ~35 seconds to reconstruct the scene.
Does anyone have an idea on how to reduce the size of an assetbundle and/or any trick to fasten downloading ?
I'm currently using Unity 3.5, I've read that 4.2 has a bit of troubles with another kind of assetbundles, are they lighter ?
Answer by pitimoi · Aug 05, 2013 at 01:06 PM
Hi,
Do you allow your friends to add their own assets to your project, or do they all should use the same assets ?
If they all use the same pack of assets, you can diminishing your scenes size using assetsbundle dependencies :
http://docs.unity3d.com/Documentation/Manual/managingassetdependencies.html
Create a bundle with all available assets for the scenes, and use BuildPipeline.PushAssetDependencies before building your new scene asset bundle. Then, players will only have to download the main assetbundle once, and they will have all needed assets to show any of your friend's scenes.
Almost, split your main assetbundle into smalls assetbundle to allow easy small updates to the players or to allow you to add new assetbundle to provide new assets to your friends.
Your help is appreciated pitimoi !
Actually, the creator can only use our objects, but I can't pack them all (we got over 1To of 3D objects).
In the link you gave, something has captured my attention:
For example, a model may incorporate materials which in turn make use of textures and shaders. It is possible to include all an asset's dependencies along with it in its bundle. However, several assets from different bundles may all depend on a common set of other assets (eg, several different models of buildings may use the same brick texture). If a separate copy of a shared dependency is included in each bundle that has objects using it, then redundant instances of the assets will be created when the bundles are loaded. This will result in wasted memory.
It is the exact problem i'm trying to fix, but ins$$anonymous$$d of wasted memory, it is wasted bandwidth.
However, I'm not sure it is possible to use this in my case, for the following reason:
the bundles aren't created when the creator publishes his scene, they are created by the infography departement and just copied into the bundle folder.
Does it mean that we'll have to reconstruct the bundles each time a creator publishes a scene ?
We managed to deploy without a Unity instance running on the server, but that'll be required if we need to rebuild bundles, won't it ?
Did you mean user will have to download 1To data to play your game ?
If not, even with 1To of 3D objects, you should have some ready assets that creators are using when they are creating levels. This is thoses assets you should put into bundles in order to re-use them in all your scenes.
If you manage correctly your bundle and know which asset is in which bundle, you can fond a way to push and pop any needed bundle before building a Scene.
The only moment you should rebuild a bundle (or create a new one) is when one of your creator use an asset who is not already in a bundle and should be shared between different scenes.
In that case, you will probably have to keep a Unity instance to build any new bundle.
I don't see any other way to reduce your scene size. Using bundle to avoid redundant assets is the only way I see to fix this problem...
I hope it help you a bit.
Your answer
Follow this Question
Related Questions
Using asset bundles as DLC content (additional maps and levels)? 0 Answers
Caching Unity Web Request downloaded Asset Bundles denied by iOS 0 Answers
How to download an asset bundle to local hard drive? 1 Answer
Asset Bundles download at runtime 1 Answer
How to download an animation from my server, and add it to my avatar on mobile device? 0 Answers