Ruby and the XBox

P

Phlip

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.

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.

Right?
 
N

Nikolai Weibull

* Phlip said:
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.

Probably right. Ruby doesn't aim to be only an extension language.
Lua's target is a simple VM to include in your application to allow for
software scripting, such as in a game, text editor, or perhaps CAD
software. Ruby aims to be more than that. It targets script writing,
alleviating the need to use /bin/sh, software scripting, and actual
software development. It has a sizable standard library that makes it
easy to use out of the box for many tasks, but this of course makes it
harder to include it in something targeted at the XBox or such. That's
not to say that one can't make a stripped down version of Ruby, but I
don't think anyone has tried either. It depends greatly on how
interdependent the various classes of the standard library are. When
(the then) Scriptics was trying to port Tcl to embedded systems, they
had great troubles with this. The design of Tcl and its sole
implementation prooved to contain too many interconnections to be easily
ported to an embedded environment.
nikolai
 
F

Francis Hwang

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).

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:





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.

Right?

--
Phlip

http://industrialxp.org/community/bin/view/Main/
TestFirstUserInterfaces

Francis Hwang
http://fhwang.net/
 
G

gabriele renzi

Phlip ha scritto:

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 :)
 
N

Nathaniel Talbott

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 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.

<:((><
 
S

Shashank Date

Hi,

Francis said:
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.

Thanks,
-- Shashank
 
N

Niklas Frykholm

Phlip said:
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.

// Niklas
 
T

Tobias Luetke

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top