We have a game that spans across the web and iOS devices, I wanted to ask anyone who has worked on downloading of asset bundles to the iOS devices what pitfalls or issues they have run into so far with Unity, Apple or other.
Our game has a market in it, and we will over time add new content to it, and ideally the game can query the asset server to look for new assets, download them and make them avail on the iOS game.
any thoughts on this, is this pretty straight foward, do you just download an asset bundle and save it to the game folder? Does apple reject apps that do that, aka are you always left with uploading a new build each time u add a bunch of new stuff?
The largest pitfall is planning unrealistically like using the same bundles for mobile and web, which you don’t want to do due to optimization and download size. Also I’m not fully sure desktop asset bundles work on iOS at all and vice versa.
Otherwise there isn’t much to do wrong aside of forgetting that pcs have 10-100 times as much cpu power and multi cores to pull of asset loading without impacting the realtime performance while iOS / mobiles are single core and will get to feel the hit independent of what you do.
also you can not save to the game folder at all. nothing about rejection here, iOS will just not accept it.
You have to write it into the applications documents / cache folder when you download them. works without any problem on that end.
as for the question you asked on your other threads (developers that crosspost the same thing in different places normally don’t get answers aside of flame so I would recommend to post it more focused next time): DO NOT USE PLAYERPREFS FOR VERSION HANDLING! Use a file which you can request information from if you need them.
On iOS PlayerPrefs use NSUserDefaults which are premanentely in RAM and cause a raised loading time as they are loaded at application startup by iOS automatically.
On the webplayer you won’t need it, either they are in browser cache and handled by it (version handling here should be done through dummy additions to the url like ?version=XXXX just so its different url which makes the browser to update it) or handled by the asset caches version handling system.
thanks for the quick reply, btw we arnt planning on using web assets for iOS devices, each asset we build we go though a LOD stage during modeling, and hit each LOD we create is for the various platform, also we compress the texture down to and of course assign the proper shader.
so player prefs are a big no no… hmm, ok thanks, so we should just have a flat file on our iOS device, maybe similar to a small flat db file that we place like asset name, timestamp, id of asset. etc… and then we can use Unity to look at that, query the db for anything new past such asset.
so the applications documents folder, is their a limit Apple has per game on this, does this get cleared out?
thanks , cheers
The applications documents folder is backed up when you backup in itunes, the applications caches folder isn’t backed up.
but neither is cleared out unless the application is deleted or you manually delete files.