flingengine / FlingEngine

A Vulkan game engine with a focus on data oriented design
https://fling-engine.site/
MIT License
408 stars 16 forks source link

Scripting language binding #11

Closed BenjaFriend closed 4 years ago

BenjaFriend commented 5 years ago

Eventually there should be a scripting language bound to the gameplay framework that makes it easier to iterate on games.

Right now I am leaning towards Python, because I think it would fit well into our object model.

Another option is Lua, but I don't like how easily lua can break typing or change global variables.

sel6606 commented 5 years ago

Lua Scripting Planning:

-I will be using sol for the lua binding https://sol2.readthedocs.io/en/latest/ -For debugging, I will be using Decoda https://unknownworlds.com/decoda/ -Script components attached to entities -One script per entity -Script Manager -Handles all the scripts -Assignment -Sol stuff -Unassignment? ----@benjafriend - Do we want to be able to dynamically do this? -Tick() -Basically just loops through the active scripts and makes them be a thing

MVP: -Be able to create and assign scripts to entities -Callbacks

Test Case: -Have a tick function that increments a variable then does a callback -Print out the variable in the callback

Next Steps: -Integrate sol into the project -Write first pass of ScriptManager -Write first pass of Script -Manually hook in a lua script and run it from the C++ -Code the script component for entities -Add functionality for running a lua function on initialization -Add functionality for running a lua function on update -Add callback functionality -Handle multiple entities at once -Implement test case -Reconvene with Ben to determine priority on additional functionality

sel6606 commented 5 years ago

We should also think about what features we want to be able to use Lua for. -Animation callbacks? -Config files? -Etc?

ArturoKuang commented 5 years ago

https://github.com/CapsAdmin/ffibuild/blob/master/vulkan/vulkan.lua Lua bindings for vulkan might be helpful

sel6606 commented 5 years ago

https://github.com/CapsAdmin/ffibuild/blob/master/vulkan/vulkan.lua Lua bindings for vulkan might be helpful

Let's not