LuaVerge: Take Two
Posted by Overkill on January 11, 2009 at 1:43 am under UncategorizedHey there.
This week, I didn’t get to work on shmuptroidvania just yet. But this was because there were other pressing issues to tend to.
The big priority was starting to fix LuaVerge so it’d work again. We used to have luabind do the dirty work, but it was too limited and wasn’t very maintainable. A rehaul was justified.
Zeromus and I discussed ways to tackle this, and we figured the cleanest way to make functionality shared by both VC and Lua is to make the bindings call the same internal functions for dealing with builtins.
I’ve added builtin function calls, through a bit of Lua glue and prodding at vc_builtins.cpp which handles the function glue. I also added reading of constants from Lua (HDEFs).
Zeromus has been working on the raw variable (HVAR) binding code, which will use methods like v3.get_systemtime() and v3.set_entity_x(ent, x). The variable-like access for these has yet to be defined though, and is bound to be much slower. But at least THIS time around, the functions that are called are visible to those who need the extra access speed.
These changes called for a lot of stuff being moved from the vc_core.[h/cpp] files to the ScriptEngine class (defined in g_script.[cpp|h]). There’s also a ton of methods in ScriptEngine that no longer need to be there now that luabind is gone, but refactoring that is gonna be hairy.
I am planning to get a packfile loader working with lua sooner or later, and then people can use vpk for lua scripts.
It is my hope that the vx library stays the same to the outside user. But the new variable binding crap should definitely speed things up a tad.
Oh! There was another neat idea being thought of, which while low-priority and possibly difficult at the moment, would be awesome: A bridge betwen VC and Lua directly, so that Lua and VC scripts can talk together. This would lower the barrier to entry, since old VC code could be used in new Lua projects. This means that written game scripts could make a gradual movement to Lua while still working in the meantime, encouraging reuse of old stuff, and giving a boost towards wanting dynamic scripts instead.
Anyway, this was my week. Catch you folks around!
Tags: gruedorf, lua, LuaVerge, verge
Andrew G. Crowell (Overkill). I am awesome.
[
Trackback