Web Player Streaming

I am currently evaluating the Unity Web Players streaming ability.

My requirement is to be able to stream levels in as needed and maximize resource sharing. So given a game with 5 levels, during one game session a player may play levels 0,1,2 and in another session play levels 0,2,3,5. I do not want the unused levels to be streamed as this impacts bandwidth costs.

From what I am reading in the docs / forums is that while I can control which levels are loaded (ie run), I cannot control which levels are streamed, the fact being that they are all streamed.

The two techniques I see that are available are :

  1. to use asset bundles – which means I have to do my own asset management

  2. to have multiple games, where each game represents a level and use the WWW class to load and run the new levels

The second option would be okay as long as assets that are shared between the current “level” and the new “level” are not re-streamed – which I don’t think is the case unfortunately

Is there a known solution for this issue?

Thanks

Your “best” bet is to either use per-level streaming or Asset Bundles as that will minimize the streaming of assets repeatedly (as will be the case with separate web player files). Given your concerns over bandwidth costs it seems best for you to go with AssetBundles via the WWW class.

You can actually use asset bundles to stream in individual levels including all their dependencies.

You can use the BuildOptions.BuildAdditionalStreamedScenes option for that.

Please see this sample project for an example:
http://unity3d.com/support/resources/example-projects/assetbundles

It basically allows you to load in any level in any order. Additionally you can setup sharing between the assets used by the different levels using the pushdependencies call.