[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Using Lua for Video Games
- From: "Sebby " <beast@...>
- Date: Mon, 25 Sep 2000 17:33:11 -0000
> > Hi.
> >
> > I'm a software engineer for a video game company. We currently
need a
> > scripting language to control various parts of our next
generation of
> > games (AI, SFX, animation, GUI, ...). Oour original plan was to
write
> > our own compiler + VM (i have written some in the past so it's
not an
> > unfamiliar territory for me).
>
> Lua would be an excellent choice for that, especially if you use the
> upcoming Lua 4.0, which will be greatly enhanced over current
versions.
> Older versions of Lua have been used in other commercial game
product:
> Baldur's Gate and MDK, for example. (And Baldur's Gate being my
most
> favorite game, Windows-only or not, I'd be quite impressed with Lua
with
> that fact alone, even if I didn't know Lua was so excellent!).
Yes, i have read that Lua was used for such games. Since it was used
sucessfully in such projects, i'd assume we could do the same for our
projects. The only major difference is that most of the projects were
for the Windows platform as we also need to incorporate support for
other plateforms like PS2 and X-Box.
> Yes, it would. Truly, writing any kind of compiler/VM specifically
for
> one project in today's time is Just Plain Stupid (tm), looking at
the
> good assortment of excellent embeddable scripting language: Python,
> Ruby, TCL, Scheme, and (of course) Lua.
Well writing your own language has it's advantages. You have better
control over the features it contains. However, time being a big
constraint using a third party scripting language seems like a viable
solution.
> > * Lua can be extended through function calls. Unfortunateley, this
> > implies writing a stub function to grab the parameters from the
Lua
> > stack and call the actual function (this is pretty much the same
> > thing i did with a VM i did, except it could also call functions
in
> > objects in C++). Now, i'v heard mentioned somewhere in the mailing
> > list there was a more efficient way of extending Lua. Is that so?
And
> > how?
>
> There are many such ways (not sure which one you have heard of).
> Writing a simple "stub-function-interface" and merging it with Lua
and
> your engine should be a piece of cake, no more than an hour or two,
from
> my own experiences. For another language, I've written a set of C-
style
> macros that actually build the stub-function for me. A C++ template
> class could also be generated quite easily.
That's the apporoach that is mentioned in the Lua documentation and
is the same approach i had taken when i wanted to interface my own TM
to C++ code (for a project in college). Was mostly wondering if there
were other alternatives...
> > * Since our next generation game engine will work on a limited
set of
> > platforms (PC, Playstation 2, X-Box). How hard would it be to
write
> > optimized versions of the VM for such different plateforms?
>
> Look at the code. It's a matter of style really, and what you mean
by
> optimized versions... I shouldn't think it be too difficult,
though.
> Certainly easier than writing your own multi-platform VM from
scratch.
>
> And what's this? No Linux? No Indrema Entertainment System?
> Disappointing... I'd think that a Linux or Indrema port would be a
bit
> simple if you're developing for the PS2. Your loss... ~,^
Hehe. Well i am not the one who makes thoes decisions here. :)
Personally, PS2 has enough Linux in it to my liking :) However, i
guess depending on it's popularity, we might consider it when time
comes.
>
> Anyways, I hope I was able to assist you in your decision. Lua is
an
> excellent choice for a game engine, for sure.
Many thanks.