Compiled Lua

View previous topic View next topic Go down

Compiled Lua

Post  Hobsie on Tue Oct 13, 2009 5:47 am

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

Hobsie

Posts : 4
Join date : 2009-10-13
Age : 32
Location : Oxford, UK

View user profile

Back to top Go down

Re: Compiled Lua

Post  sio2interactive on Tue Oct 13, 2009 6:52 am

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.

_________________
SIO2 Interactive
Free Open Source 3D Game Engine for iPhone and iPod Touch
http://sio2interactive.com
avatar
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 38
Location : Shanghai

View user profile http://sio2interactive.com

Back to top Go down

Re: Compiled Lua

Post  Hobsie on Tue Oct 13, 2009 7:06 am

Thanks for the response and advice.

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 : 32
Location : Oxford, UK

View user profile

Back to top Go down

Re: Compiled Lua

Post  sio2interactive on Tue Oct 13, 2009 2:31 pm

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...

_________________
SIO2 Interactive
Free Open Source 3D Game Engine for iPhone and iPod Touch
http://sio2interactive.com
avatar
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 38
Location : Shanghai

View user profile http://sio2interactive.com

Back to top Go down

Re: Compiled Lua

Post  Hobsie on Tue Oct 13, 2009 3:13 pm

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 : 32
Location : Oxford, UK

View user profile

Back to top Go down

Re: Compiled Lua

Post  sio2interactive on Tue Oct 13, 2009 3:26 pm

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,

_________________
SIO2 Interactive
Free Open Source 3D Game Engine for iPhone and iPod Touch
http://sio2interactive.com
avatar
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 38
Location : Shanghai

View user profile http://sio2interactive.com

Back to top Go down

Re: Compiled Lua

Post  Hobsie on Tue Oct 13, 2009 3:36 pm

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 : 32
Location : Oxford, UK

View user profile

Back to top Go down

Re: Compiled Lua

Post  sio2interactive on Tue Oct 13, 2009 3:42 pm

Looking forward to it...

_________________
SIO2 Interactive
Free Open Source 3D Game Engine for iPhone and iPod Touch
http://sio2interactive.com
avatar
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 38
Location : Shanghai

View user profile http://sio2interactive.com

Back to top Go down

Re: Compiled Lua

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum