- Home /
Is it possible to use LUA or JS to bypass AOT limitations on iOS?
Hi guys!
Just got an idea of using LUA or JS to bypass(partly) AOT limitations on iOS for situations when you stream AssetBundle from server which will include TextAssets with scripts.
I see it in this way:
Create folder for your AssetBundle
Create a GameObject
Attach a special c# script component "LUA_JS_Behaviour.cs" with empty "LUA/JS Script" public property (this component will be compiled with main assembly)
Build AssetBundle
Load AssetBundle and Instantiate loaded GO
Set "LUA/JS Script" public property of GO to loaded TextAsset.text
Call something like ItsAlive();
So does anybody knows a solution for LUA or JS (or any other) interpreter that can be compiled with Game in very beginning and then it should be used as "some kind" GameObjects logic? And could my app be banned for that on App Store? :)
Thanx for any liks or materials!
Hi, did you end up using this technique.
I'm trying to find a way to update the contents of my app without updating to iTunes app store all the time. I'm was planing to do this using Asset bundles. But I can't have executable code in asset bundles. And putting executable code inside DLL's won't work because Assembly.Load does not work on iOS (due to AOT nature of the system). So this might be a great fix.
Answer by mviuk · Aug 03, 2013 at 09:56 AM
The issue with downloading scripts on iOS isn't so much a technical issue, it's that Apple just don't allow it.
If you check the iOS App Review Guidelines it states:
Apps that download code in any way or form will be rejected
Even if your application passes review, it can still get pulled when it's live, which is even worse. The more successful your application, the more possible it is to get scrutinised, so you may end up with a scenario of your application getting banned at the worst possible time.
Yes, @mviuk , after some investigation of couple games (Order&Chaos and Clash of Clans) i came up to conclusion that they pulling something like C$$anonymous$$L or JSON for content&game-design updates i guess. Can't vote up - not enough karma (
Hi guys, do we know for a fact that this happens. Getting rejected if we download lua scripts. I know that apple specifies "Apps that download code in any way or form will be rejected" but lua scripts are just that, scripts, nothing more. It's not like a C# script that gets compiled. It's interpreted. Just wanted to know if some one has tried this, before I commit to this kind of an approach.
Apple's not interested in how the code is represented (compiled or interpreted). The reason for the restriction is to make sure all functionality (and updates to functionality) goes through Apple's review process. If they didn't have this restriction they wouldn't be able to stop people creating things like application portals (their own app stores within the app store) and emulators.
It's much better to go the data route as artfabrique said, represent key parts of the game through JSON or asset bundles, this is actually a very flexible approach. From a quick google it looks like Apple have rejected applications in the past for downloading code (I'm assu$$anonymous$$g they have some automated tools for detecting this), so while you might get lucky and sneak it past them, there's obviously some risk involved.
Your answer
Follow this Question
Related Questions
AOT Runtime Problem: Variable of type IMyInterface changes type to String(impossible..??) 0 Answers
PtrToStructure with array fields on iOS (ie AOT only mode) 0 Answers
Loading scripts dynamically in AoT compilers 1 Answer
Add lightmap at runtime has problem on iOS 0 Answers
My Generic function using LINQ(orderBy thenBy)Not working on IOS 1 Answer