I’ve been working on getting asset bundles up and running, which by now seems to work. I do have some questions about memory usage in the scenario we’re implementing though.
The approach we’re taking involves including all our gameplay scenes in an AssetBundle (possibly several), so that we can later change the scenes and then have them be updated through new AssetBundles. So what we do is to tag all the scenes as being part of an AssetBundle, then remove the scenes from the Build Settings list and load them from the bundle instead. All menu scenes, loader scenes, etc. will remain in the Build Settings and get included in the build. This seems to work just fine, but I’m worried about asset dependencies and multiple instances of various assets being generated.
First of all, removing all the scenes from the Build Settings also means that none of the stuff they reference will get included in the build - including engine code. We can get around this, even if it’s a bit cumbersome, by making instances of the engine components we need in one of the scenes we do include in the Build Settings. It just doesn’t seem elegant, but it’s doable. We can of course also choose to not strip engine code in Player Settings, but we don’t really want to do that.
Where it becomes troublesome is if we need to keep track of everything we use in these scenes, to make sure nothing ends up in multiple Asset Bundles. It’s okay if we only use one Asset Bundle for all our scenes, in which case we “just” have to make sure nothing is used both in our in game scenes and menus. But if we want to split up our gameplay levels into several Asset Bundles, we’d risk getting a lot of dependency issues, since many of the scenes will reference the same assets. The documentation state that in order to avoid multiple instances of an asset when using Asset Bundles, you have to explicitly include that asset in an Asset Bundle. So in order to avoid duplicates, we’d have to make sure that all our assets are explicitly part of an Asset Bundle?
I hope my explanation makes sense and that someone can offer a little bit of insight to this issue.