[aquaria] Patch to run Lua scripts as threads

Andrew Church achurch+aquaria at achurch.org
Mon Jul 5 02:16:36 EDT 2010

>Having one lua_State per script rather than per entity would be huge memory
>It doesn't seem like that'd be much of a waste at that point. The waste is
>loading the same scripts multiple times.

Fair enough. (:  I was worried about the ~60k/state just from registering
all the interface functions, but entityinclude by itself looks like it
takes up 20k/instance, so that could cancel out the loss all on its own.
I've implemented the code for your suggestion locally, and I'm working
through the scripts now (which are going to be a gigantic commit, heh).

On a tangent, and mostly out of curiosity:  What's the state of the
ParticleEffectScript stuff in ScriptInterface.cpp?  It's all inactive
as far as I can tell; I had to comment it out for the new Lua state
code because I wasn't quite sure how it was intended to work.  Is it
something that could be useful if I integrated it into the new code, or
should I not worry about it?

  --Andrew Church
    achurch at achurch.org

More information about the aquaria mailing list