|
From: Serge S. <se...@lx...> - 2004-02-11 06:28:24
|
Hello flois, Tuesday, February 10, 2004, 4:20:54 PM, you wrote: fmc> Hi Serge, we are going to use LUA in fact to simplify the Lua work take a fmc> look at LuaBind www.sourceforge.net/projects/luabind. Thanks, I have already evaluated luabind and tolua. Right now there is little need to use them (lua binding takes only a few dozens lines of code currently). When we start adding bindings for classes (AI API for example), some tool to simplify this work will be required though. But luabind depends on boost library which is 30MB download, ouch. We try to keep the game lightweight, maybe we will even try to use some simplier binding mechanisms like some C++ binding examples found on lua wiki. fmc> And for a live example take a look at Oasis fmc> www.sourceforge.net/projects/oasis, if you are using it, you fmc> should consider use it. It is heavily based on templates fmc> but it looks like sort of new language inside C++, it is a very fmc> nice piece of work. Thanks for a link. fmc> About XML we are using it to store data entities (not executable code) so fmc> in that case XML sounded the best approach, how had been your experience fmc> with only data in LUA? I have only positive impressions so far. Lua has a nice data oriented syntax, it is possible to create heavily nested tables, represent trees and graphs. The idea to use Lua as a replacement of XML was somewhere in Lua mailing list. There was a discussion of how some XML constructions can be represented in Lua, and there were not found any problems with it. But they way, I even tried 2 somewhat different approaches. The first one: describe the needed data in lua and call Lua function to fetch the needed information ('init-scripts/filecheck.lua', only GetDataFileName function is called from C++ code). The second one: define lua function 'AddXcomTerrain' that preprocesses some data (calls to this function are in 'init-scripts/standard-maps.lua' and 'init-scripts/user-maps.lua' ) and stores in in Lua state, all the information is fetched directly from lua state in C++ code. Both are quite functional. -- Serge Semashko ufo2000 development team http://ufo2000.sourceforge.net |