- Home /
How to download game content (DLC) for storage and use later
I'm considering how to make a mobile game that would involve packages of downloadable content for the game. The idea is that the game would include some small free content package (think additional images and sounds) with the initial app download, and then you would be able to purchase and download additional content packages later. I am targeting mobile devices, so in-app purchases would be ideal (as opposed to a bunch of separate apps on the app store).
Now, I know I could just put all of my content packages into the app and unlock them in code via a simple "if package purchased" check, and if I have to, I'll do that. However, I'd rather not because I expect to produce a lot of different content packages (each of non-trivial size) and think that many customers will only want a few of them. So, forcing all customers to download all packages would be a huge waste of space. Additionally, that would mean that I would have to do an app update every time I released a new package, and customers who don't want any new packages would be forced to download increasingly large app updates.
So, my other idea is that I would place these content packages out on a server somewhere. Then, I'd get an in-app purchase to trigger a download using the WWW class which would then download the package and store it permanently in the Resources folder. Then, every time the app starts it would scan the Resources folder for downloaded packages and present those packages to the user as options.
The idea sounds somewhat like what I've read about AssetBundles, but I only have access to the Basic version of Unity now anyway and AssetBundles are a Pro feature. I also don't see what AssetBundles offers over the basic WWW class if I'm just downloading images and audio. WWW already seems able to create AudioClips and Texture2Ds from downloaded web content.
Does this downloadable package idea sound possible without Pro? Has anyone else done it? Any thoughts on the specifics of how to do this? (tutorial would be awesome) Is there a better way to handle this than what I've thought of?
This was for a side project that has been on hold for a while. So, no, I haven't actually worked on it. I have done some more research since the original post though and I feel fairly certain now that I can do this with just the WWW class and Unity Basic.
Answer by DaveA · Aug 27, 2012 at 04:33 AM
Yes I have done this with basic. Asset Bundles basically provide you a pre-digested (imported) version of the assets. And scripts, btw. They just drop right in. With WWW you basically are writing importers for your assets, and hooking up scripts, well, that's another matter. It can be done, it's not easy or fun.
Nice! So, I'm curious. Did you package your assets up into some kind of single archive (ZIP) file that was then put on the server and then the app would process that file locally? Or did you host each asset as its own separate download?
At first I thought about doing a big ZIP file to $$anonymous$$imize download size, but then I realized that you'd need twice as much local space to be able to decompress it. Plus, with images and audio I wouldn't be able to get a great compression ratio anyway.
Individual resources zipped where it makes sense. Need to cache them in memory so they don't get redownloaded in the same session. Web player cannot cache such things to disk though.
Answer by DiebeImDunkeln · Feb 23, 2015 at 04:18 PM
I'm now in the same situation like casimps1 but I have the pro version available. I'm working on a round based board game for IPad and Android tablets.
My problem is, that I have to download the file with a kind of preloader and instantiate them later when they are needed.
All examples that I find instantiate them directly after the download and delete the assetbundle after doing this.
Next questions is, how can I make my testing with my editor and keep the prefabs inside the editor.
Your answer
Follow this Question
Related Questions
iOS open docx file from Application.persistentData 2 Answers
How to access my download I puchased 1 Answer
Webview for Android 1 Answer
Localization on mobile 0 Answers