adriengivry / Overload

3D game engine with lua scripting
https://overloadengine.org/
MIT License
1.79k stars 226 forks source link

Add more Lua libraries #246

Open SolarcGit opened 1 year ago

SolarcGit commented 1 year ago

We should consider adding the following libraries to the ScriptInterpreter.cpp:

adriengivry commented 1 year ago

Good point. We should also evaluate the consequences of adding these libraries:

SolarcGit commented 1 year ago

What these libraries add to the making of a game outweights the consequences In my opinion. (I am pretty new though please keep that in mind) Having these libraries, especially table, coroutine, string and os, would greatly help in developing a game.

adriengivry commented 1 year ago

What these libraries add to the making of a game outweights the consequences In my opinion. (I am pretty new though please keep that in mind) Having these libraries, especially table, coroutine, string and os, would greatly help in developing a game.

That's for sure! But it's important to gather factual data about the consequences of making such a change in order to make a more informed decision.

SolarcGit commented 1 year ago

Yes opinion is not all. Sadly I dont know how to gather the data to find out if it would be detrimental to the performance. Is there any way I can push this?

adriengivry commented 1 year ago

Yes opinion is not all. Sadly I dont know how to gather the data to find out if it would be detrimental to the performance. Is there any way I can push this?

We should look into sol2 and see how they implemented lua libraries. Are these libraries dynamic loaded? Are there any requirements to include these libs? Compatibility issues? Maybe having some profiling data about compilation time and runtime performance with/without these libs would be good to have too. We should document all that in the pull request adding these libraries to Overload.

SolarcGit commented 1 year ago

Is there any way I can help do that?

adriengivry commented 1 year ago

Is there any way I can help do that?

For sure! You can do this investigation process, do the change first (include the libs), and measure the performance impact (compilation and runtime), and document all that 👌

SolarcGit commented 1 year ago

using sol2?

adriengivry commented 1 year ago

Overload is using sol2 for lua scripting yes

SolarcGit commented 1 year ago

ok ok got it but where do I start?

adriengivry commented 1 year ago

ok ok got it but where do I start?

Make the requested change in ScriptInterpreter.cpp, and get some profiling data with VS. Dig into sol2 and investigate the implications of such a change.

SolarcGit commented 1 year ago

can you show me how I can do the change?

adriengivry commented 1 year ago

https://github.com/adriengivry/Overload/blob/a56596b45935660cd5d8e0e61f52f04adf756931/Sources/Overload/OvCore/src/OvCore/Scripting/ScriptInterpreter.cpp#L32

Read the documentation of the open_libraries function in sol2.

SolarcGit commented 1 year ago

will do!