Those scripts, which you write in EyeAuras, are actually full-blown C# programs, which have to be compiled to their intermediary form (CIL, intermediate language) before getting executed by .NET platform.
By default, scripts are stored in their source code form all the way up to their execution. Only when some action or node gets executed for the first time, the script gets compiled and then executed. This is how the system has worked for almost 3 years.
But. In many-many cases, this leads to noticeable delay for the first time when something gets called, be it some UI which gets drawn by the script or some C# action which presses a bunch of buttons - first call will always take much more time than all the rest. This is not a great UX and with two new features I'd like to solve that.
Important! Initially these changes will affect only C# Action
, but eventually they will be spread to all other places where you can use scripting, such as BT nodes, Overlays, etc.
EyeAuras tries to optimize compilation process by storing everything needed for that process in-memory - this allows to reduce compilation time to tens and hundreds of milliseconds in most cases. Unfortunately, in some cases this may take much more time - some dependencies are too heavy to hold them in ready-to-use state, meaning they have to be loaded/unloaded on demand and this increases compilation time to 2-5 seconds, which is definitely noticeable by the user.
With the new option, whenever the program loads the script for the first time, it will automatically try to compile it. This will prevent that delay when the script gets actually executed.
When the code gets compiled, its binary form could be stored and re-used for subsequent launches. This may bring some problems to the table, such as the compiled code no longer being valid after some EA infrastructure changes, but in most cases, previously compiled code should be compatible. This option allows to make it so EA will try to store not only the source code of your script, but its binary form as well. Best-case scenario - after the program is reloaded, there will be no re-compilation, meaning zero delay for end-user.
One of the next improvements in that area will be wiring both of these into Packing mechanism. Ideally, when you'll publish the Pack, EA server will compile everything for you and will include only the binary version of your code into the final package (ofc optionally you will be able to include source code as well, just like it currently does). This should end up improving overall end-user experience.