Archived Boards > Windows Phone 8 Help

Serialization/De-serialization issue of FsmVar on window Phone 8

(1/2) > >>

ashwini:
Playmaker dll used: Windows Add-on
Unity Version: 4.5.3

Issue:
The serialization/deserialization of the FsmVar object fails on windows-phone(the same works on unity-editor & Android-phone).
Same playmaker.dll works for Android & Unity-Editor but fails for windows target.

With the help of our the simple recreate[attached], we identified that the problem is happening due to ‘mismatch in HashCodes  values returned(for a string) by Monodevelop(used for serialization of scenes etc. by unity compiler) and by windows-supportive-playmaker dll while de-serializing the scenes etc’.
 
So, when Unity compiler serialize a scene(while building for a target), it uses  Hashcode values returned by Monodevelop string.GetHashCode(). Now while running the target build in window phone, the playmaker dll (before populating FsMVar Fields)compares the stored Hashcode with the hashcode returned by ‘ActionData.GetActionTypeHashCode (actionType)’ API. Since the value returned by ‘ActionData.GetActionTypeHashCode (actionType))’ is different than the one that was used for serialization by Unity, the Hashcode match fails, and hence it doesn’t deserialize the field correctly( and make it Float by default), and hence loading of Scenes fails.
 
The playmaker does this de-serialization in ‘CreateAction’ method of ‘HutongGames.PlayMaker.ActionData’ Class, in the following lines:
 
CodeSnippet: ( from CreateAction’ method of ‘HutongGames.PlayMaker.ActionData)
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>               int num = this.actionHashCodes [actionIndex];     -----Gets the hash-code value used by Unity Compiled.
               if (num == ActionData.GetActionTypeHashCode (actionType))  -----Compare the above hash-code value with the one returned by ‘GetActionTypeHashCode’ for that actionType.
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
For example: for  "System.StringHutongGames.PlayMaker.FsmVarSystem.Boolean".GetHashCode();
Monodevelop returns:  -951609300
While Visual Studio(using Playmaker.dll) returns:  -1941977249
 
Hence, it is clearly identified as playmaker issue.

Hi Playmaker team, could you please look into this at the earliest?

Alex Chouls:
Hi, we found this issue in the latest beta. We changed to a custom hash function that behaves the same on every platform.

I sent you an invite to the beta. Beta 15 has some problems on WP8. Beta 14 should work, but doesn't pass certification yet. Replace b15 with b14 in the download link to get the older version to test... Beta 16 should be out soon...

ashwini:
Could you please provide the ETA for Beta 16?
Meanwhile we can try with Beta 14(but seems from your comment, that it the issue is NOT fixed in Beta 15 & Beta 14).

ashwini:
We tried with the Beta-14 version. Getting the following exception -

Internal compiler error. See the console log for more information. output was:
Unhandled Exception: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.
at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)

which shows the playmaker.dll does not support windows phone.

Alex Chouls:
Did you import the wp8 beta?

Navigation

[0] Message Index

[#] Next page

Go to full version