Efficient Asset Distribution

I have a project, that contains a good 400mb of textures so far, though this is likely to climb to double that. Even when made into an executable and compressed it results in a 150mb file. Its becoming an issue sending it online to the client as each minor change requires the whole thing to be uploaded/downloaded again.

I'm looking for ideas on how I can reduce the overhead of the assets, as frequently the updates are just made to code, so it seems pointless having to include all the textures each time. Unfortunately the project is a single scene or a single object that uses ALL of the 400mb texture assets, so its not like I can split it up to multiple scenes or the like.

I've considered using assetbundles, whilst that would probably work I can see it being very awkward for development as I assume in the editor each time I run the project to test it, the editor would have to import the assetbundle, taking up valuable time. Where as if the assets were kept lose in the project folder, Unity editor would only load them once?

I've also had a look at the Unity assetbundle/package format. Appears to be a simple zip wrapper around tar compressed files, with all the assets within in it. Though its tempting to think you could simply 'manage' these assets I doubt thats the case since everything seems to have the same generic names. So I couldn't for example delete all the texture assets from within it, send the file to the client and have them add the textures assets back in.

So anyone have any other ideas?

The main aim here is to send the client the textures once, and then be able to send future project updates without those assets, without increasing development time.

I guess if using assetbundles I could disable importing if running in the editor, but then assets wouldn't be loaded and would have to also be lose in the project folder, whic means removing them each time I make an update - I assume?

thx

AssetBundles are the way to go here. Create an editorscript in your project that does something like:

  • loop over Assets/MyTextures/*
  • Create an assetbundle containing all those textures

Then at runtime, you grab the textures from the assetbundle, instead of how you usually grab them. (You could even have two codepaths, one where you have references to the textures directly, and one where you grab them from the assetbundle).

You can then send the assetbundle to your client, and send him updates of the standalone player only.

I've found a workaround that whilst it works well for this project, would be awkward and convoluted for anything more complex. In the future I feel UT have address this address issue to make it more streamlined.

I had several issues with assetbundles, all of which stem from the fact that once you switch to them they are no longer in the project folder or hierarchy.

Loading time: In my case I currently have 40x4096x1024 textures (400m approx) that means every time I run the project it takes upwards of 10 seconds to load, even on my week old new PC (Quadcore i7 920 @ 4ghz). Thats just unacceptable in terms of debugging and testing, especially when with the assets in the project folder, you only incur that hit once when you load project.

Not in project/hierarchy: With the assets no longer in the main project I can no longer use one of the best features of Unity, the realtime Editor to tweak the assets. The project only contains a single model with all 40 textures on and it is still being updated, so I need it in-situ in order to tweak materials, lights, in conjunction with the rest of the scene/gui. As an assetbundle this is no longer possible.

My Workaround: I keep the asset in the project/hierarchy, but set its tag to 'editor only'. This allows it to still be tweaked in the real-time editor, but it is no longer exported during a build process.

I then select these assets in the project panel and create an assetbundle.

Finally in the project I add some code to an empty game object to load the asset bundle if not running in the editor.

This gives me everything I need. The ability to work on the assets in the editor within the rest of the scene/project. At the same time it means the massive texture file only needs to be sent to the client once, or when major revisions occur to them. So instead of sending 120mb files each time there is a change with anything in the project, even if its a single line of code, I now only send about 10mb.

Thats a massive saving, upload speeds i the UK are generally pretty low, average is 0.5mb, so 120Mb takes 30-40 minutes. Now its down to just a few minutes, meaning I can make code changes easily and quickly get updates to the client.

Of course this only works well as I have a single model model in the scene, a more complex project would be far more awkward to deal with.