freeablo
freeablo copied to clipboard
Scripting
We got working python so I think issue can be closed.
What will Python be used for? I was hoping for mods to be lua based.
Yup, current plan is lua, but we'll see what is best when the point comes
Lua has the ability to be flexible in that you can sandbox an environment very very easily especially inside itself without any C code. I'm a Lua person and I have the know how to do such things.
cling based C++ as scripting language / hot code reload Why? Able to run C++ script in runtime or compile it for max speed ( as in example https://github.com/derofim/cling-cmake ) Also: May be used to improve modules compile time
HOT code reload possible approaches:
store app state fix cling undo for files https://root-forum.cern.ch/t/loading-unloading-class-as-interpreted-macro-in-cling-multiple-times/32976/2
execute cling code to change callbacks & variables nested cling::Interpreter with multiple cling::MetaProcessor IDK how to do it, but you can create child cling::Interpreter
Copy discussion from PR:
there are some issues to work out with whatever scripting language we use. The primary use case for it will be scripting in mods, and mods scripts will need to be deterministic just like the rest of the game code, in order for multiplayer to work. This means they will need to use our FixedPoint class for maths. Given that, I'm not sure if we shoudl try to hack FixedPoint into an existing scriping language, or if we should just make our own simplistic langauge. In particular, since FixedPoints can be a bit slow, it would be nice to use a language that distinguished between integer and real number types, so people could only use FixedPoint operations when they actually needed them.