Playmaker Forum

PlayMaker Help & Tips => iOS Help => Topic started by: jeanfabre on February 09, 2013, 02:35:34 AM

Title: IOS publishing notes
Post by: jeanfabre on February 09, 2013, 02:35:34 AM
Hi Everyone,

Publishing for IOS can be tricky sometimes. This is especially true if you are using "Get Property" and "Set Property" as it uses reflections and this cause problems depending on your IOS publish settings.

General IOS publishing settings:

Script call optimization
IN ALL CASES: do check the publish option "Script call optimization" to  "Slow and Safe" when you tests your games, because if you get an error, the app will less likely crash, and you will be able to have more logs to pin point the problem in xCode console. Only select the option "Fast but no Exception" when you have a game that runs without any errors in Xcode console.

Symlink
Check "SymLink" on. This feature is not very well documented, so I am not sure myself what it exactly do, but if I don't check it, all attempt fails when I use "Get Property" and "Set Property" actions.

Stripping
Stripping is a one way to optimize your final application size:
http://docs.unity3d.com/Documentation/Manual/iphone-playerSizeOptimization.html

And depending on your stripping option you may not be able to compile or have errors when you play leading to crash or bugs.

DO NOT select the "micro mscorlib", it's too optimized when using "Get property" and "Set property" actions.

link.xml
There is way to explicitly define what class not to strip so that reflection work, but so far I failed to find proper documentation as to how to fill that link.xml for a monobehaviour. There is a Wizard (http://j.mp/1EYDjUl) that will help you setup this link.xml without any effort on your end.


This post is very much a work in progress. Don't hesitate to share your knowledge, expertise, findings and thoughts to make this guideline as accurate and helpful as possible.

Bye,

 Jean
Title: Re: IOS publishing notes
Post by: julius on February 11, 2013, 11:22:06 PM
Just a few things,

Symlink Unity libraries means that Xcode project generated by Unity will directly reference Unity iOS runtime library from Unity Editor install location. It saves your disk space (runtime lib is ~300 MB) and Unity Editor can faster generate Xcode project, because it does not need to copy additional 300 MB.

You should not use it when:
a) you are exporting Xcode project which you are going to share with somebody else
b) you are exporting Xcode project to make final build and you want to archive it for backup purposes.

As for why you are getting errors with useing "Get Property" and "Set Property" actions when its unchecked is quite strange, re-install unity perhaps to get a clean  iOS runtime library.


As for the micro mscorlib what do you mean by it's too optimized? Does it generate errors or cause actions/scripts to be run out of order?
Title: Re: IOS publishing notes
Post by: jeanfabre on February 12, 2013, 12:18:47 AM
Hi,

 Yes, this is very odd. People are also helping me on UnityAnswers, but I fear this issue is twisted...

http://answers.unity3d.com/questions/397136/linkxml-for-a-monobehaviour.html

yes, Simlink  is odd. The problem is no one seems to host a definite clear answer, and I seem to have to trial and error all this, where really some definite step should be there. On UnityAnswer they seem to say link.xml is not required, but without simlink, it just doesn't even compile to begin with...

I really doubt reinstalling Unity would solve the problem. but I will upgrade anyway, so we'll see.

Hopefully, this is just because of my ignorance. Have you tried to compile the photon demo yourself?


bye,

 Jean
Title: Re: IOS publishing notes
Post by: julius on February 12, 2013, 10:19:31 PM
Quote
Have you tried to compile the photon demo yourself?

Nope I haven't yet but I'll grab it and let you know my findings.
Title: Re: IOS publishing notes
Post by: Tochas on February 21, 2013, 11:02:35 PM
Hi

Any considerations for performance under iOS? may be something like:
limit the number of active FSMs?
limit the number of states within a FSM?
limit the number of actions within a state?
use InvokeMethod instead of a series of actions? insted of SendMessage?
Title: Re: IOS publishing notes
Post by: escpodgames on February 21, 2013, 11:13:06 PM
Why would you want limits ... makes no sense to me.
Title: Re: IOS publishing notes
Post by: doppelmonster on September 09, 2013, 05:08:03 AM
I use a ton of get/set properties and didnt have a problem yet. I tested my game on about 10 different devices without a problem. My game is now in review and i hope i dont get in trouble when its going public....

I have another strange issue: My game is only 16MB on Android but inflates to 32 MB on iOS. I already checked my texture overrides but there is no difference. Has someone an idea why that is happening?
Title: Re: IOS publishing notes
Post by: gecko on October 19, 2013, 04:01:37 PM
I am having trouble getting Set/Get Property to work on iOS. I've set everything as advised above, but it's still not working. My FSM actions change the externalAcceleration and randomAccleration on an Interactive Cloth. Is there another way to do that, or any other tips to get this to work?
Title: Re: IOS publishing notes
Post by: jeanfabre on October 21, 2013, 02:48:19 AM
Hi,

 The other way is to create custom actions to control what you need.

Could you share a repro scene with a interactive cloth? I'll work on adding access to the externalAcceleration and random accelration. Also, you can file a bug on this, I'll follow within this bug ticket ( it will help being organized).

bye,

 Jean
Title: Re: IOS publishing notes
Post by: gecko on October 21, 2013, 11:49:26 AM
I'll file a bug, and here is a test scene: http://www.eduweb-labs.net/FlagTestScene.zip

thanks much!
Dave
Title: Re: IOS publishing notes
Post by: jeanfabre on October 22, 2013, 03:33:26 AM
Hi,

 Can you export this as a Unity package, I can't open this zip file in Unity.

 Bye,

 Jean
Title: Re: IOS publishing notes
Post by: gecko on October 22, 2013, 09:50:38 AM
Oh, sorry. Here is the unity package: http://www.eduweb-labs.net/FlagTestScene.unitypackage
Title: Re: IOS publishing notes
Post by: jeanfabre on October 23, 2013, 03:41:40 AM
Hi,

 it runs fine actually, maybe I am not looking at the right thing? but get and set property do not cause any trouble or produce errors.

Can you define what you mean by "not working"?


bye,

 Jean
Title: Re: IOS publishing notes
Post by: gecko on October 23, 2013, 09:26:17 AM
It works fine in the editor, but in an iOS build, on the device, the flag acceleration properties do not changes -- they always stay at the initial settings. (Sorry, I never said that explicitly, but I thought that was the premise of this thread.) You can only see the problem in a build.
Title: Re: IOS publishing notes
Post by: jeanfabre on October 24, 2013, 05:45:44 AM
Hi,

 It works fine, I double check doing the following:

 I set to 0 all acceleration on the component itself, so external acceleration and random acceleration are both 0,0,0

then I don't do anything in the "start low" state, I wait for 5 sec and then set big values and it works.


Bye,

 Jean
Title: Re: IOS publishing notes
Post by: gecko on October 24, 2013, 10:15:06 AM
Thanks, I'll try that.
Title: Re: IOS publishing notes
Post by: gecko on October 29, 2013, 06:28:31 PM
Quote
I set to 0 all acceleration on the component itself, so external acceleration and random acceleration are both 0,0,0

then I don't do anything in the "start low" state, I wait for 5 sec and then set big values and it works.

I finally tried this in a build, but no improvement. Now the flag is drooping (zero acceleration of any kind), and it never changes. No errors in the editor, nothing in xcode console. Here's the FSM:
Title: Re: IOS publishing notes
Post by: jeanfabre on October 30, 2013, 01:20:04 AM
Hi,

 Can you create a new topic on this? this thread is actually about generic notes, thanks.

 Bye,

 Jean
Title: Re: IOS publishing notes
Post by: thinias1900 on January 15, 2014, 01:22:16 PM
Hi.  Sorry to revive an old thread, but I am getting this same error when attempting to use the GetProperty method:

ExecutionEngineException: Attempting to JIT compile method '(wrapper delegate-invoke) System.Reflection.MonoProperty/Getter`2<Interaction, UnityEngine.GameObject>:invoke_GameObject__this___Interaction (Interaction)' while running with --aot-only.

  at System.Reflection.MonoProperty.GetterAdapterFrame[Interaction,GameObject] (System.Reflection.Getter`2 getter, System.Object obj) [0x00000] in <filename unknown>:0
  at System.Reflection.MonoProperty.GetValue (System.Object obj, System.Object[] index) [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.ReflectionUtils.GetMemberValue (System.Reflection.MemberInfo member, System.Object target) [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.ReflectionUtils.GetMemberValue (System.Reflection.MemberInfo[] memberInfo, System.Object target) [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.FsmProperty.GetValue () [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.Actions.GetProperty.OnUpdate () [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.FsmState.OnUpdate () [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.Fsm.UpdateState (HutongGames.PlayMaker.FsmState state) [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.Fsm.Update () [0x00000] in <filename unknown>:0
  at PlayMakerFSM.Update () [0x00000] in <filename unknown>:0
 
(Filename:  Line: -1)


I have verified all of the properties mentioned, except for SymLink... which no longer exists.  Does this mean I can't use PlayMaker on iOS anymore?  Is there a new workaround?

Any assistance would be greatly appreciated!
Title: Re: IOS publishing notes
Post by: thinias1900 on January 15, 2014, 08:35:42 PM
I was able to resolve the previously described issue with JIT reflection by setting my Api Compatibility level from .NET 2.0 to .NET 2.0 Subset.
Title: Re: IOS publishing notes
Post by: memetic arts on March 30, 2016, 03:28:42 PM
Hi all -

Bumping this thread as it has gone a bit stale, given that Unity, XCode and iOS have progressed . . . wondering if anyone knows of any build optimization tips that might be helpful.  I'm submitting an app in approx. two weeks, and any final optimization tweaks would be gladly welcomed.

Bonus points for tips on optimizing assetbundles in iOS.

Thanks very much!
Title: Re: IOS publishing notes
Post by: jeanfabre on March 01, 2017, 12:59:16 AM
Hi,
 
What exactly in this thread is at stale? Publishing to IOS works well, if you have trouble don't hesitate to create a dedicated post with your issue and ping me after few days if you haven't got any replies :)

as for optimization tips, prefer using custom actions over actions such as "SetProperty", "GetProperty","InvokeMethod", etc they use reflection and could be a bottleneck if your game is already reaching limits in terms of graphics and shaders. Apart from that, refer to Unity own tips really, there isn't much within PlayMaker for optimizing, the real deal is to profile oftento detect perfs issues as soon as possible, else it's a nightmare... with or without PlayMaker :)

Bye,

 Jean