Is there a clean way of splitting games into code / assets when publishing?
If you have an iOS App in the App Store, which loads a HTML5 game, the Apple policy doesn’t allow to load (Java)Script files from external sources, because they might “change the functionality of the app after review”. So i want to pack the source files into the app, but load assets from an external server (Azure/Amazon/whatever), in order to don’t bloat the app size too much.
So one could set the ASSET_PREFIX from the “__settings__.js” to an external server, which already loads everything located files/assets from the specified URL instead. The problem is, that ammo.js, ammo.wasm.js and ammo.wasm.wasm are also stored in the assets, and not along with other source files.
Is there a simple way, to put those 3 source files outside of the assets folder (maybe under the root folder) and reference to it?
It would also be nice to have a similar solution for glsl, html, css and json files, since I don’t know how strict Apple sees them as “changing functionality after review” of the app.
@Leonidas We are not trying to manually load assets via the asset registry, we try to load assets from a different server during the initial loading process of the playcanvas app. Would we have to rewrite/monkey-patch the app initialization process to use pc.AssetRegistry#loadFromUrl? Is the AssetRegistry even available this soon?
Development of our game is already finished, we are just trying ship the build as 2 zipped folder and have the game load the assets from a different location than its own.
@yaustar Our game will run inside another app, one that provides a lot more HTML5 games than just ours. The app should be as small as possible for the appstore, but as @dexter_deluxe mentioned, Apple doesn’t allow code, binaries, scripts or anything that might alter the functionality of the app to be loaded afterwards. So the solution we are trying to accomplish is to ship the app with all the code necessary and load images/models etc from another server.
Ah, I see. I’ve been working on some scripts that embed files into a single HTML and this sounds very similar.
This is a bit tricky and you may want to use a custom/patched engine and loader for this that checks the asset type and if it is a script type or WASM module, to add an absolute URL prefix to load the file locally instead.