-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System.Reflection.Emit #45
Comments
The problem is that Jace is using System.Reflection.Emit for its dynamic compiler (to generate and compile dynamically .NET functions) which is what is not possible on Unity. A potential solution could be to use Jace in interpreted mode: it will be slower, but it will not rely on the dynamic compiler. Would you be able to test this workaround? |
Thanks for the reply |
See the first page of this github repository. But it heavily depends on how many times you reuse the same function. If you don't reuse compiles functions then there will not be a lot of performance difference |
@KoalaHao If you only need basic arithmetic you can use Math Expression Evaluator which doesn't user Reflection.Emit but still supports compiled mode |
I tried interpreted mode, and I am on the 0.8.5 version, i think it has bugs with interpreted version, will upgrade and try again later |
I am not aware of bugs with the interpreted mode of 0.8.5, but would it be possible to test a more recent version? In case you have issues, let me know and I will look to investigate it. |
I still havn'nt test the new version yet, but the bug of 0.8.5 is in interpreted mode, all variables gets converted into lower case, then it tries to match with a "not converted to lower case" string, which results in variable not found error |
version 0.8.5 is 5 years old, so I recommend to upgrade to the newest version. It contains a number of bug fixex. |
@KoalaHao Did you already had time to try a more recent version of Jace inside a Unity project? |
Hey there, I have a similar issue. I have a Unity project using the latest version of Unity and a version of Jace I downloaded in August. Performance is not critical for me, I am using Jace because it's nice to let non-programmers to edit game balancing formulas in text. It worked great for me until I switched the scripting backend from Mono (Unity default) to IL2CPP (which is required to make a x64 build for Android, which is required by Google Play Store since August 1st this year). Here's the error I get
Googling ExecutionEngineException I found this in the Unity manual Could you help me figure out a workaround like this for my project? |
After investigating further, I think a workaround won't be possible after all. The manual I linked specifically says namespace System.Reflection.Emit simply isn't supported. I will test Interpreted mode instead. |
I tried the interpreted mode and it works like a charm. Can I suggest adding a note in the readme for Unity projects (using IL2CPP) to consider using the Interpreted mode? |
@strangenoora I am happy to read that it solved your issue. I will document it in the readme. |
Sorry I didn't have time to try the new version. I've fixed the caps problem, force use interpreted mode, and it works |
I tried to use this project in Unity
but I found out that Jace uses System.Reflection.Emit
this is not allowed in most of the platforms as specified by Unity
https://docs.unity3d.com/Manual/ScriptingRestrictions.html
Is there any workaround to this?
The text was updated successfully, but these errors were encountered: