[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: lua_State: Overhead and code retention
- From: "Mark Manyen" <mmanyen@...>
- Date: Tue, 7 Jan 2003 07:39:16 -0600
Hello all!
I am considering using Lua in my next game project. One of the approaches I
am exploring is to have multiple lua_States, one for each of the game
entities. This would allow my designers/script writers to have a private
namespace for each entity.
I can't seem to find the overhead cost for this implementation.
Also, I am intriqued by the way that that Lua retains function definations
after a lua_dofile call. Consider the following entity script:
-----------------------------------------
function entity_init()
-- some init code
end
function entity_update()
-- update handling code
end
function entity_event()
-- Some event handler here
end
print("Entity Init Script complete")
-----------------------------------------
When I run this script, I get the ("Entity Init Script complete") message,
and I can then call any of these Lua functions from the C++ code.
What is the overhead for this functionality?
Thanks in advance!
Mark Manyen
Magic Lantern Playware (www.mlantern.com)