FYI: Lua on the Dreamcast

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

FYI: Lua on the Dreamcast

Dave Bollinger
Steve Dekorte wrote:
 >>at Sega on the Dreamcast project...just told me that they have Lua
running on it

   Well that's pretty cool.  Lua does seem to be a hot embedded language
for games right now, have noticed quite a few postings about such use
(including my own ;).  Who'd've thought that learning Lua would turn out to
be a marketable skill in the games industry?!  Thanks for the info.

   I assume the contents of their SDK is under a strict NDA, yes?  Would
this include Lua?  Or rather, Sega's *modifications* to Lua - ya think
they'll consider those mods proprietary?

Chris Trimble wrote:
 >> Is this on top of WinCE?

   My understanding is that the DC's OS is _based_ on Windows CE, but has
been modified a bit.  Still, the development environment is supposed to be
Microsoft VC and Direct-X, so it can't be TOO modified.  The base DC
system, I believe, comes with 16M RAM, so plenty of room for Lua.  :)

   Regarding other messages re: porting to CE and unicode characters, I
guess they must've solved that issue.  Perhaps Sega could be convinced to
share those results with TeCGraf for possible future incorporation into the
official language.

   Cheers,

   Dave

Reply | Threaded
Open this post in threaded view
|

Re: FYI: Lua on the Dreamcast

Ken Rawlings
>(including my own ;).  Who'd've thought that learning Lua would turn out
>to be a marketable skill in the games industry?!  Thanks for the info.

   No doubt! Out of curiosity, what are most games developers using Lua for? 

> My understanding is that the DC's OS is _based_ on Windows CE, but has
> been modified a bit.  Still, the development environment is supposed to be

   It's been a little while since I looked into Dreamcast development,
   but my understanding is that the Dreamcast has 2 OSes. The first is
   a Dreamcast specific OS(much like the Saturn and Genesis had) that 
   lets you squeeze speed out of the hardware, and the second is a
   modified version of CE that has DirectX and speed improvements.

> Regarding other messages re: porting to CE and unicode characters, I
> guess they must've solved that issue.  Perhaps Sega could be convinced

   I'd be surprised if they actually modified Lua for full Unicode. You
   can easily write programs for CE that use "char *" for all internal
   strings and then call some conversion function to Unicode whenever you
   want to make an OS call.

   Speaking of porting to CE, if anyone knows of an open-source equivalent
   of a vsprintf implementation that is fairly standalone(i.e. it doesn't
   require big parts of the rest of stdio and doesn't make any internal
   compiler function calls), please let me know. 

_Ken



Reply | Threaded
Open this post in threaded view
|

Re: FYI: Lua on the Dreamcast

David Jeske-3
On Sat, Jul 10, 1999 at 07:26:14PM -0300, Ken Rawlings wrote:
>    Speaking of porting to CE, if anyone knows of an open-source equivalent
>    of a vsprintf implementation that is fairly standalone(i.e. it doesn't
>    require big parts of the rest of stdio and doesn't make any internal
>    compiler function calls), please let me know. 

See if this will fit your need:

http://www.fiction.net/blong/programs/#snprintf

-- 
David Jeske (N9LCA) + http://www.chat.net/~jeske/ + [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: FYI: Lua on the Dreamcast

Dave Bollinger
In reply to this post by Dave Bollinger
Ken Rawlings wrote:
 >> Out of curiosity, what are most games developers using Lua for? 

   I can only speak for myself, but I'm currently using Lua for various
"Event Handlers" within an Edutainment title.  The main "game loop" is
still handled by the host, but at various key moments little snippets of
Lua are executed.  The advantage for me is that this program consists of a
large number of mini-games, each of which is just a different set of Lua
code which redefine the event handlers as appropriate for that game.

 >> if anyone knows of an open-source equivalent of a vsprintf
implementation

   You could check the license on the library included with the Small-C
compiler.  I remember that it includes a subset of stdio including
printf/fprintf and all the "itoa"-type support routines.  It may be free
for non-commercial use.  But I believe it was part of a book though, so if
you need truly open-source code it may not be suitable.  I don't know for
sure.

   Cheers,

   Dave

Reply | Threaded
Open this post in threaded view
|

RE: FYI: Lua on the Dreamcast

Vincent PENQUERC'H
In reply to this post by Dave Bollinger
> >(including my own ;).  Who'd've thought that learning Lua 
> would turn out
> >to be a marketable skill in the games industry?!  Thanks for 
> the info.
> 
>    No doubt! Out of curiosity, what are most games developers 
> using Lua for? 

I use Lua in scripts called from the main C++ code at specific
times: whenever events are triggered (someone making an action
triggers a Lua chunk, someone dying triggers a Lua chunk, etc)
and at regular time intervals to compute a character's AI. The
Lua chunks involved have a default (the default chunk can just
do nothing at all) that can be overriden for a specific entity
(a character, but also objects (when they are taken...) spells
(when they are cast....), map locations (when they are entered
by a character...), etc. This way I have a set of standard
behaviors (for example, for characters, a fighter always seeking
fights, a peasant working and fleeing when attacked, etc...) and
I still can assign a specific behavior to any important character
in the game.
The main benefit from this is that all these behaviors (this is
what actually 'makes' a game) can be stored in data files, thus
changed at will without recompiling the code, allows for more
modularity (add-ons, sequels....).

Vincent Penquerc'h

"4 GB ought to be enough for anybody."

Reply | Threaded
Open this post in threaded view
|

Re: FYI: Lua on the Dreamcast

Ken Rawlings
In reply to this post by David Jeske-3
   Thanks! That's easily the most accessible implementation i've seen.
   Unfortunately, it doesn't handle "%g", which Lua favors, but it does
   handle "%f", which should be close enough.

On Sun, 11 Jul 1999, David Jeske wrote:

> On Sat, Jul 10, 1999 at 07:26:14PM -0300, Ken Rawlings wrote:
> >    Speaking of porting to CE, if anyone knows of an open-source equivalent
> >    of a vsprintf implementation that is fairly standalone(i.e. it doesn't
> >    require big parts of the rest of stdio and doesn't make any internal
> >    compiler function calls), please let me know. 
> 
> See if this will fit your need:
> 
> http://www.fiction.net/blong/programs/#snprintf
> 
> -- 
> David Jeske (N9LCA) + http://www.chat.net/~jeske/ + [hidden email]
> 
>