[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby and the XBox

Phlip

11/21/2004 7:22:00 PM

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.

Right?

--
Phlip
http://industrialxp.org/community/bin/view/Main/TestFirstUser...


7 Answers

Nikolai Weibull

11/21/2004 8:03:00 PM

0

* Phlip <phlip_cpp@yahoo.com> [Nov 21, 2004 20:30]:
> 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?

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

--
::: name: Nikolai Weibull :: aliases: pcp / lone-star / aka :::
::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden :::
::: page: www.pcppopper.org :: fun atm: gf,lps,ruby,lisp,war3 :::
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}


Francis Hwang

11/21/2004 8:53:00 PM

0

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.
>
> Right?
>
> --
> Phlip
>
> http://industrialxp.org/community/bin/...
> TestFirstUserInterfaces
>
>
>
>

Francis Hwang
http://f...



gabriele renzi

11/21/2004 11:57:00 PM

0

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

The scripting engine seem to be also available on rubyforge.

Ok, it's not Halo2 but it is a really cool application :)

Nathaniel Talbott

11/22/2004 2:09:00 PM

0

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

<:((><



Shashank Date

11/22/2004 2:26:00 PM

0

Hi,

Francis Hwang wrote:

> 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

Niklas Frykholm

11/23/2004 4:17:00 PM

0

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.

// Niklas

Tobias Luetke

11/23/2004 7:59:00 PM

0

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


--
Tobi
http://blog.le...