I’m working on script engine for my new game project.
The game allows user to create their own stage just like rolobox.
I don’t have enough time to make a game creation tool, So planning to let users use Unity Editor.
However, there’re some limitation with previous script engines,
C# script cannot be run on iOS
other scripts can be run on iOS, but I have huge stuffs to do (binding & writing API doc for users)
So my goal is
Running on iOS
Can execute all Unity’s API except blocked by policy (API blacklist is supported by UniScript)
Some sandbox-like features such as timeout.
This project is very early stage of dev, So may not be enough to use.
Currently, I’m working on implementing more syntaxs and writing more and more tests.
Right. But I know there was at least one C# embeded asset project, where code could be typed in a game within simple script editor and compiled real time like. That didn’t requires any DLLs. Most likely players could save scripts in txt format. Or similar. Game could read them and compile at startup for example.
Actually, runtime compilation is prohibited by iOS, even not possible with IL2CPP. because they all rely on Reflection.Emit.
So, the problem is not generating DLL or not.
Every scripts MUST be interpreted.
There’s only one C# script engine(maybe interpreter) named PaxScript which is not updated anymore. the last article was written in 2013.
What about lua? That would be more accessible to younger audience, and should work around such limitations. At least I think should …
Does it have to be C#?
In lua, methods need to be bound with something like RegisterMethod or AddClass.
(lua-users wiki: Binding With Members And Methods)
I have to provide hundreds of API for user modding and also documentations for each methods.
With my script engine, you can call native Unity APIs directly, because it’s already C# for both!
Please see my messy test code from the repository:
I’m already using Input, transform, Destroy, Resources.Load without any binding stuffs.
I’m not sure C# is friendly for non-developers, but one clear thing is there’re so many documentations, tutorials and StackOverflow questions for Unity/C#.
I don’t think Unity’s documentations are good, but I can’t do better than that as a personal developer
If your approach takes care for cross platform and works directly with most Unity APIs, that is good news.
So far I can just wish you persistence and all best
Wow. This is crazy!
The hot reloading feature is so good that makes me wonder, how’s performance? Because if it’s only somewhat slower, this is a game changer