|
From: Ben C. <cro...@ne...> - 2000-02-12 21:58:28
|
Comrades, Here's an e-mail from one of the guys I asked (about Lua scripting). Later, Ben -- "The ultimate measure of a man is not where he stands in moments of comfort and convenience, but where he stands at times of challenge and controversy." -- Martin Luther King, Jr. ---------- Forwarded message ---------- Date: Fri, 11 Feb 2000 00:17:27 +0100 From: Vincent Penquerc'h <ly...@ke...> To: Ben Crowder <cro...@ne...> Subject: Re: [AGP] Lua scripting On Wed, Feb 09, 2000 at 04:44:10PM -0700, Ben Crowder wrote: > Since you've actually used Lua, would you be willing to answer a few > questions? Yup > 1. What kind of game(s) have you used it for, and how did you use it? Only one, a RPG. I expose my game internals in a form that Lua can call (it has a custom way to pass parameters most notably) and then a Lua script can call them directly. The other way round is possible too. > Did you notice any limitations that would be an obstacle in its use > with any certain type of game or any gaming feature? Well, not *that* much :) But I did not get too far with it anyway. I have it running in my game, but this is a simple implementation for now. I still have to do something more complex. But the good thing is that Lua offers a way to enhance its semantics: you can write routines to handle cases not originally handled by Lua (a little like C++ operator overloading, but much more powerful). This really helps in building complex Lua scripts, altough I did not write those in conjunction with my game. > 2. How well does it integrate with C? Are the scripts runtime > (interpreted) or compiled? Will I be able to control most of my game > logic with Lua? Once wrappers are written for your game's internals, those can be used in Lua scripts as easily as if they were builtins. There is a tool (toLua) that can be used to generate those wrappers from a cleaned C++ header file. Lua is higher level than C++, and provides a general purpose hash table facility, that can be used to simulate OOP, in parallel to game classes. Lua scripts are interpreted, but can be precompiled as Lua byte code. There is no such thing as a direct machine code compilation. It is fairly fast though, as long as you don't try to do too much with it :) > > 3. Are there any open source games you're aware of that use Lua? I know > Grim Fandango and Baldur's Gate do, but not having the source available > -- you get the idea. ;) I knew of these two too. I think the port of MDK 2 by Bioware will use it more extensively than BG. I know of no open source ones though. Try asking on lua-l :) > Thank you very much! You're welcome. -- Vincent Penquerc'h Windows NT - Nuke That ! |