Game Development Reference
In-Depth Information
The Lua virtual machine
The Lua virtual machine is represented by lua_State struct , which is defined in the
lstate.h header file. Lua states are self-contained structures without the use for any
global data, making them practical for threaded applications:
lstate.h
struct lua_State;
The sandbox runs multiple Lua virtual machines simultaneously. One main virtual machine
is assigned to the sandbox itself, while each spawned agent runs its own separate virtual
machine. The use of individual virtual machines comes to the sandbox at the cost of per-
formance and memory but allows for iterating Lua scripts in real time on a per-agent basis.
Search WWH ::




Custom Search