I'm studying the game industry now. The Lua language has a strong lead for
the scripting layer for games. Here's a great post from the Lua mailing
list:
The latest title from the German Company "BlueByte" called "Settlers V"
is about to be released. It consists of:
- 500.000 LoC written in C++
- 150.000 LoC written in LUA
LUA is used for all the mission scripting and they are very happy with
it since they started using it in Settlers IV. Settler V is one of the
major PC gaming titles to hit the stores for this Christmas.
Bernd
It appears that BlueByte has discovered how efficiently they can author
gameplay features, and the top level of their command-and-control code, in a
soft language.
But why do so many game shops use Lua?
- an early lead in game development
- pure C implementation
- works inside a game box
- "easy" to bond with C
- super-efficient VM opcodes
- dynamic typing, with block closures
- minimal standard library, with discardable components
I suspect I can humbly submit the indefensible opinion to this newsgroup
that Ruby has esthetic and technical advantages over Lua, but this doesn't
necessarily mean that Ruby can efficiently and responsively fit inside an
XBox and run games.
I just bought "Freedom Force", a silly-but-fun superheroes pseudo-RPG. A lot of the files are in Python. Also, I have read online that Quake is written in two layers: the bare-to-the-metal stuff, which is C++, and the game logic, which is in a higher level language that I believe was custom-developed for the engine. This is standard alternate-hard-and-soft-layers stuff, I suppose.
If you wanted to push Ruby into the world of gaming, I'd guess that the first place to do so would be on the desktop, probably on a Windows box. On a desktop machine, the overhead of the Ruby standard install wouldn't be so heavy.
BTW, at RubyConf Shashank showed me the very basics of a game construction set that is aimed at writing board-type games ... It'd be a good place to start thinking about the high-level domain specific language that might be suited to games. If Shashank releases it any time soon (hint, hint).
···
On Nov 21, 2004, at 2:23 PM, Phlip wrote:
Rubistas:
I'm studying the game industry now. The Lua language has a strong lead for
the scripting layer for games. Here's a great post from the Lua mailing
list:
The latest title from the German Company "BlueByte" called "Settlers V"
is about to be released. It consists of:
- 500.000 LoC written in C++
- 150.000 LoC written in LUA
LUA is used for all the mission scripting and they are very happy with
it since they started using it in Settlers IV. Settler V is one of the
major PC gaming titles to hit the stores for this Christmas.
Bernd
It appears that BlueByte has discovered how efficiently they can author
gameplay features, and the top level of their command-and-control code, in a
soft language.
But why do so many game shops use Lua?
- an early lead in game development
- pure C implementation
- works inside a game box
- "easy" to bond with C
- super-efficient VM opcodes
- dynamic typing, with block closures
- minimal standard library, with discardable components
I suspect I can humbly submit the indefensible opinion to this newsgroup
that Ruby has esthetic and technical advantages over Lua, but this doesn't
necessarily mean that Ruby can efficiently and responsively fit inside an
XBox and run games.
just to point out: a game engine exists that uses ruby has the language to define adventures, rpg maker .
Some screenshots from the italian community: http://www.brutiafin.it/sitonew/index.php?screen
The scripting engine seem to be also available on rubyforge.
Ok, it's not Halo2 but it is a really cool application
I think one thing that may hurt Ruby in this market is: it's not threadsafe. Being able to run multiple interpreters in the same process could be, to use gaming terminology, a PK-ing feature.
Nathaniel
Terralien, Inc.
<:((><
···
On Nov 21, 2004, at 14:23, Phlip wrote:
But why do so many game shops use Lua?
- an early lead in game development
- pure C implementation
- works inside a game box
- "easy" to bond with C
- super-efficient VM opcodes
- dynamic typing, with block closures
- minimal standard library, with discardable components
I suspect I can humbly submit the indefensible opinion to this newsgroup
that Ruby has esthetic and technical advantages over Lua, but this doesn't
necessarily mean that Ruby can efficiently and responsively fit inside an
XBox and run games.
I am an Xbox programmer and a Ruby enthusiast. As an application language I much prefer Ruby to Lua. However, as an extension language, and in particular, as a game scripting language, Lua has a number of advantages:
- It's small. The implementation is small. The syntax and semantics is
small and flexible. The standard library is small.
Being small is of course an advantage in terms of memory footprint.
But even more important -- being small makes the language easier
to hack. It is easier to get the language to fit with your existing
engine and do exactly what you want without having to deal with
a lot of excess baggage.
- Garbage collection. Garbage collection is scary for any real-time
application. Lua has (in the latest beta) incremental garbage
collection.
- Byte code. Lua compiles to byte code, so you don't have to run
an in-game parser.
- No conflicting object model. Interfacing Ruby with C++ (almost all
modern game engines are written in C++) is a bit hairy, because
you have to maintain two different object models: Ruby's and C++'s.
Since Lua has no inherent object model (objects are "simulated" with
tables) it is easier to build an object structure that exactly
mirrors the one on the C++ side.
I just bought "Freedom Force", a silly-but-fun superheroes pseudo-RPG. A lot of the files are in Python. Also, I have read online that Quake is written in two layers: the bare-to-the-metal stuff, which is C++, and the game logic, which is in a higher level language that I believe was custom-developed for the engine. This is standard alternate-hard-and-soft-layers stuff, I suppose.
If you wanted to push Ruby into the world of gaming, I'd guess that the first place to do so would be on the desktop, probably on a Windows box. On a desktop machine, the overhead of the Ruby standard install wouldn't be so heavy.
BTW, at RubyConf Shashank showed me the very basics of a game construction set that is aimed at writing board-type games ... It'd be a good place to start thinking about the high-level domain specific language that might be suited to games. If Shashank releases it any time soon (hint, hint).
Hint taken
It was one of those things which started off as a sudden brain wave while waiting at the airport on way to the conference and died down
when I got back into the daily rut of life ...
But the code is not utterly ugly and with a little bit of clean up,
will be release worthy. Watch out for this space.
If you want to see some heavy lua work in action check out the today
released World of warcraft. A massive multiplayer game by blizzard.
It comes with an interface.zip containing all graphics and source for
its ( enormous ) gui. Widgets, dialogs and forms are all declared as
XML with logic written in lua.
The entire gui is opensource and people have been doing great things
with it. For example during beta people deviced an ingame auction
system system which blizzard promptly adopted, beefed up and put in
the core game.
I would love to know what other parts of the game are written in lua
on the server side.
···
On Wed, 24 Nov 2004 01:18:02 +0900, Niklas Frykholm <niklas@kagi.com> wrote:
Phlip wrote:
> But why do so many game shops use Lua?
I am an Xbox programmer and a Ruby enthusiast. As an application
language I much prefer Ruby to Lua. However, as an extension language,
and in particular, as a game scripting language, Lua has a number of
advantages:
- It's small. The implementation is small. The syntax and semantics is
small and flexible. The standard library is small.
Being small is of course an advantage in terms of memory footprint.
But even more important -- being small makes the language easier
to hack. It is easier to get the language to fit with your existing
engine and do exactly what you want without having to deal with
a lot of excess baggage.
- Garbage collection. Garbage collection is scary for any real-time
application. Lua has (in the latest beta) incremental garbage
collection.
- Byte code. Lua compiles to byte code, so you don't have to run
an in-game parser.
- No conflicting object model. Interfacing Ruby with C++ (almost all
modern game engines are written in C++) is a bit hairy, because
you have to maintain two different object models: Ruby's and C++'s.
Since Lua has no inherent object model (objects are "simulated" with
tables) it is easier to build an object structure that exactly
mirrors the one on the C++ side.