lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I'm interested in hearing how you solve this problem too!  I think other people might be able to weigh in with better insight, but have you considered just assigning each robot (and all associated functions) their own environment table?  Would that possibly give you the isolation needed, while allowing you to maintain a single Lua instance for all?

On Fri, Jan 8, 2010 at 2:25 PM, Christopher Eykamp <chris@eykamp.com> wrote:

So I've been rethinking my original design, and am wondering if it might make sense to have the robots all running in a single process, which would get called once per event, with some sort of Lua management script calling the event handlers in each robot.  Furthermore, management of timers and keeping track of which robots implement which listeners might be easier, as there could be one timer management script for all robots, rather than the current practice of one-per-robot.  And it seems that keeping track of which robots implement which listener would be easier in Lua than in C++, which would also argue against the one-instance-per-bot design.

So the question is what is the best architecture for this sort of problem?  My two key goals are maintaining adequate performance, and making the bot scripting as simple as possible, which would seem to imply that each robot should feel like it has it's own global namespace.  How have others addressed this issue?

Thanks,

Chris



--
http://www.blar.net/kurt/blog/