Compiled Lua
2 posters
Compiled Lua
Hi there,
New on the block and all that. Had a quick search through the forum and the tutorials for this but couldn't find anything.
Was wondering if Sio2 supported compiled Lua files and if so what the work flow would be for creating compiled lua files and loading them in source.
Also I couldn't find any obvious functions on how to export C/C++ source to lua. For example an object made in C/C++'s functions exposed to Lua to be able to call functions on it.
Thanks in advance.
Hobsie
New on the block and all that. Had a quick search through the forum and the tutorials for this but couldn't find anything.
Was wondering if Sio2 supported compiled Lua files and if so what the work flow would be for creating compiled lua files and loading them in source.
Also I couldn't find any obvious functions on how to export C/C++ source to lua. For example an object made in C/C++'s functions exposed to Lua to be able to call functions on it.
Thanks in advance.
Hobsie
Hobsie- Posts : 4
Join date : 2009-10-13
Age : 39
Location : Oxford, UK
Re: Compiled Lua
Was wondering if Sio2 supported compiled Lua files and if so what the work flow would be for creating compiled lua files and loading them in source.
>> LUA scripts are compiled/run at run-time.
Also I couldn't find any obvious functions on how to export C/C++ source to lua. For example an object made in C/C++'s functions exposed to Lua to be able to call functions on it.
>> Check the sio2_wrap.c / swig / sio2.module, that should give you a good idea of how the scripting integration is done.
>> LUA scripts are compiled/run at run-time.
Also I couldn't find any obvious functions on how to export C/C++ source to lua. For example an object made in C/C++'s functions exposed to Lua to be able to call functions on it.
>> Check the sio2_wrap.c / swig / sio2.module, that should give you a good idea of how the scripting integration is done.
Re: Compiled Lua
Thanks for the response and advice.
I was really looking to see if the Lua could be compiled before hand instead of at run time for speed/size purposes. I'm assuming you cannot do this with Sio2 currently?
Regards
Hobsie
sio2interactive wrote:Was wondering if Sio2 supported compiled Lua files and if so what the work flow would be for creating compiled lua files and loading them in source.
>> LUA scripts are compiled/run at run-time.
I was really looking to see if the Lua could be compiled before hand instead of at run time for speed/size purposes. I'm assuming you cannot do this with Sio2 currently?
Regards
Hobsie
Hobsie- Posts : 4
Join date : 2009-10-13
Age : 39
Location : Oxford, UK
Re: Compiled Lua
I was really looking to see if the Lua could be compiled before hand instead
>> No need...
of at run time for speed/size purposes.
>> Its scripting, not a full program... so basically its like loading a texture.
I'm assuming you cannot do this with Sio2 currently?
>> I don't see the use really...
>> No need...
of at run time for speed/size purposes.
>> Its scripting, not a full program... so basically its like loading a texture.
I'm assuming you cannot do this with Sio2 currently?
>> I don't see the use really...
Re: Compiled Lua
sio2interactive wrote:I was really looking to see if the Lua could be compiled before hand instead
>> No need...
of at run time for speed/size purposes.
>> Its scripting, not a full program... so basically its like loading a texture.
I'm assuming you cannot do this with Sio2 currently?
>> I don't see the use really...
Well its pretty common place in production games to compile Lua scripts (and other types of scripts) before release so this does not occur at compile time. The file is obviously still treated like any texture etc but even assets like 3D models and animation are compiled into a more efficient format/encrypted form for production while a easier to debug version would be used for development. This just improves performance at run time reducing load times for example.
Can I suggest that this feature be added to Sio2 as this would be a great performance increase. Every little helps!
Regards
Hobsie
Hobsie- Posts : 4
Join date : 2009-10-13
Age : 39
Location : Oxford, UK
Re: Compiled Lua
Can I suggest that this feature be added to Sio2 as this would be a great performance increase.
>> Not really, In example, the biggest script in my game take 69ms to load + compile + run...
If you want to implement it, I would be pleased to integrate your code. Just send me a template project with your MODs and I'll test it and integrate.
Cheers,
>> Not really, In example, the biggest script in my game take 69ms to load + compile + run...
If you want to implement it, I would be pleased to integrate your code. Just send me a template project with your MODs and I'll test it and integrate.
Cheers,
Re: Compiled Lua
sio2interactive wrote:Can I suggest that this feature be added to Sio2 as this would be a great performance increase.
>> Not really, In example, the biggest script in my game take 69ms to load + compile + run...
If you want to implement it, I would be pleased to integrate your code. Just send me a template project with your MODs and I'll test it and integrate.
Cheers,
Hehe that may be the case but that number can certainly add up. I will be sure to send you any suggested improvements should I do so.
Regards
Hobsie
Hobsie- Posts : 4
Join date : 2009-10-13
Age : 39
Location : Oxford, UK
Permissions in this forum:
You cannot reply to topics in this forum