Scripting - good or bad?

Well, this isn’t exactly strictly SDL question, but I’ll ask anyway. I’m programming (or at least trying to) a 2D 3rd person shoot’em’up, a bit like Tapan Kaikki or Brutal Homicide.

Which is a better way, developing your own scripting language, using someone else’s (like Lua or Scheme) or not using scripting at all? As I understand scripting might slow down the game, but it would be easier to modify it (make new modules (capture the flag) and such). Then again I’d really like to develope my own language, just for the fun of it and so that I could say to myself “I can really DO something with that computer-thingie, not just play with it” ;-D. So, how’s it?

– Ville Koskinen
@Ville_Koskinen
Finland

I think that it is better to use a known scripting language.
It will speedup the development of your scripting engine, because
you wouldn’t have to worry developing a parser/scanner to handle
the scripting language. Just embed the interpreter in the game
engine. And you will get a feeling about which language features
you really need for your scripting engine.

But you should be carefull selecting the right language for your
engine. Each language has its memory requirement, so don’t choose
one that is a memory hog, like perl :)—
Paulo Pinto (aka Moondevil in demoscene)
The Linux philosophy is to laugh in face of danger.
Oops. Wrong one. ‘Do it yourself’ That’s it – L.Torvalds
pjmlp_pt at yahoo.comhttp://www.progtools.org

----- Original Message -----
From: viller.koskinen@iobox.com (Ville Koskinen)
To:
Sent: Wednesday, January 09, 2002 10:14 AM
Subject: [SDL] Scripting - good or bad?

Well, this isn’t exactly strictly SDL question, but I’ll ask anyway. I’m
programming (or at least trying to) a 2D 3rd person shoot’em’up, a bit like
Tapan Kaikki or Brutal Homicide.

Which is a better way, developing your own scripting language, using
someone else’s (like Lua or Scheme) or not using scripting at all? As I
understand scripting might slow down the game, but it would be easier to
modify it (make new modules (capture the flag) and such). Then again I’d
really like to develope my own language, just for the fun of it and so that
I could say to myself “I can really DO something with that computer-thingie,
not just play with it” ;-D. So, how’s it?

– Ville Koskinen
viller.koskinen at iobox.com
Finland


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

I think that it is better to use a known scripting language.
It will speedup the development of your scripting engine, because
you wouldn’t have to worry developing a parser/scanner to handle
the scripting language. Just embed the interpreter in the game
engine.

Yes, and it’ll also help other people to develope new modules for it, as there are at least some who already have used the language, but if I make my own language, everyone has to learn its syntax and other stuff first.

And you will get a feeling about which language features
you really need for your scripting engine.

On the other hand if I make my own language I can decide easily what I want from it. E.g. it’s useless to include class structures if they aren’t ever used.

But you should be carefull selecting the right language for your
engine. Each language has its memory requirement, so don’t choose
one that is a memory hog, like perl :slight_smile:

Huh? I’ve already embedded perl, took only 15 megs… :slight_smile: ;-D [laughs]. Any suggestions? Is Lua okay? I kind of like the syntax.

– Ville Koskinen
@Ville_Koskinen
Finland

Hi!

Well - my 2 cents!

If you think you will have fun implementing your own script language - do
that!

Dont care what is the most clever idea if you dont have a schedule :slight_smile:

Fun makes life good - not cleverness! :slight_smile:

Regards
Thomas> ----- Original Message -----

From: viller.koskinen@iobox.com (Ville Koskinen)
To:
Sent: Wednesday, January 09, 2002 2:17 PM
Subject: Re: [SDL] Scripting - good or bad?

Yes, and it’ll also help other people to develope new modules for it, as
there are at least some who already have used the language, but if I make my
own language, everyone has to learn its syntax and other stuff first.

Ville Koskinen wrote:

Well, this isn’t exactly strictly SDL question, but I’ll ask anyway. I’m programming (or at least trying to) a 2D 3rd person shoot’em’up, a bit like Tapan Kaikki or Brutal Homicide.

Which is a better way, developing your own scripting language, using someone else’s (like Lua or Scheme) or not using scripting at all? As I understand scripting might slow down the game, but it would be easier to modify it (make new modules (capture the flag) and such). Then again I’d really like to develope my own language, just for the fun of it and so that I could say to myself “I can really DO something with that computer-thingie, not just play with it” ;-D. So, how’s it?

Can I get away with saying “been there, done that?” The question you
have to ask yourself is whether you are writing a game or a scripting
language. A scripting language is a lot of fun to write, but it is a tar
baby. You keep finding things you didn’t think you’d need so you have to
change the language design and rewrite big parts of the implementation.
Then there is the fact that know elese knows your language so if you
want other people to use it you will have to document it and help people
learn it. If you goal is to write a game, write a game. If you really
think you need a scripting language use an existing implementation. If
you look around you can find the scheme repository which is just full of
implementations of scheme. Some of these will fit in a very small amount
of memory. One I used nearly 10 years ago is called ELK. It ran in less
than 2 Megs on a 386… And, it has all the features you could ever ask
for in a scripting language.

	Bob Pendleton> -- Ville Koskinen

viller.koskinen at iobox.com
Finland


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


±-----------------------------------+

  • Bob Pendleton is seeking contract +
  • and consulting work. Find out more +
  • at http://www.jump.net/~bobp +
    ±-----------------------------------+

Let me apologize in advance for posting a reply to my own reply to an
off topic post…

Another few other things to consider when thinking about implementing a
scripting language in your game.

  1. There are a number of scripting languages that already have SDL
    embedded in them. Look at http://www.libsdl.org/languages.html for a
    list. Rather than embed a scripting language in your
    game, why not write your game in a scripting language to start with?
    This avoids all the work
    of doing the embedding and gives you the same advantages as having a
    scripting language in your
    game. If you find that some code runs too slowly when written in the
    scripting language you
    can pull it out, rewrite it in C/C++, and embed it as a new "primitive"
    in the scripting
    language.

  2. To make use of a scripting language embedded in your game you have to
    have a clear idea
    of the interface between the internals of the game and the scripting
    engine. Once you have
    that you will most likely build and API to implement the interface. Once
    you have done that
    you can just use what ever your favorite programming language is to
    build .so or .dll files
    that your game loads at run time that use that API to interface with
    your game. The result
    is that your favorite programming language becomes your scripting
    language. And, if you do
    want to add an embedded scripting language later you can implement it as
    a .so or .dll file
    that uses the same API to access the internals of your game.

     		Bob Pendleton
    

Bob Pendleton wrote:>

Ville Koskinen wrote:

Well, this isn’t exactly strictly SDL question, but I’ll ask anyway. I’m programming (or at least trying to) a 2D 3rd person shoot’em’up, a bit like Tapan Kaikki or Brutal Homicide.

Which is a better way, developing your own scripting language, using someone else’s (like Lua or Scheme) or not using scripting at all? As I understand scripting might slow down the game, but it would be easier to modify it (make new modules (capture the flag) and such). Then again I’d really like to develope my own language, just for the fun of it and so that I could say to myself “I can really DO something with that computer-thingie, not just play with it” ;-D. So, how’s it?

Can I get away with saying “been there, done that?” The question you
have to ask yourself is whether you are writing a game or a scripting
language. A scripting language is a lot of fun to write, but it is a tar
baby. You keep finding things you didn’t think you’d need so you have to
change the language design and rewrite big parts of the implementation.
Then there is the fact that know elese knows your language so if you
want other people to use it you will have to document it and help people
learn it. If you goal is to write a game, write a game. If you really
think you need a scripting language use an existing implementation. If
you look around you can find the scheme repository which is just full of
implementations of scheme. Some of these will fit in a very small amount
of memory. One I used nearly 10 years ago is called ELK. It ran in less
than 2 Megs on a 386… And, it has all the features you could ever ask
for in a scripting language.

            Bob Pendleton

– Ville Koskinen
viller.koskinen at iobox.com
Finland


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


±-----------------------------------+

  • Bob Pendleton is seeking contract +
  • and consulting work. Find out more +
  • at http://www.jump.net/~bobp +
    ±-----------------------------------+

SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


±-----------------------------------+

  • Bob Pendleton is seeking contract +
  • and consulting work. Find out more +
  • at http://www.jump.net/~bobp +
    ±-----------------------------------+

Can I get away with saying “been there, done that?” The question you
have to ask yourself is whether you are writing a game or a scripting
language. A scripting language is a lot of fun to write, but it is a tar
baby. You keep finding things you didn’t think you’d need so you have to
change the language design and rewrite big parts of the implementation.
Then there is the fact that know elese knows your language so if you
want other people to use it you will have to document it and help people
learn it. If you goal is to write a game, write a game. If you really
think you need a scripting language use an existing implementation. If
you look around you can find the scheme repository which is just full of
implementations of scheme. Some of these will fit in a very small amount
of memory. One I used nearly 10 years ago is called ELK. It ran in less
than 2 Megs on a 386… And, it has all the features you could ever ask
for in a scripting language.

Bob Pendleton

Thank’s for your help and tips!

– Ville Koskinen
@Ville_Koskinen
Finland

I must say that I have played with pygame (SDL Python’s bindings)
yesterday and most of the games in the pygame site are really fast.

I used a PIII 700Mhz with 256Mb and a Matrox Productiva G100 AGP.
Most of the current PCs have better capabilities.

So I think that there are many 2D, and even 3D games that can be
fully coded in Python, or other scripting language, without any
great loss in speed.—
Paulo Pinto (aka Moondevil in demoscene)
The Linux philosophy is to laugh in face of danger.
Oops. Wrong one. ‘Do it yourself’ That’s it – L.Torvalds
pjmlp_pt at yahoo.comhttp://www.progtools.org

----- Original Message -----
From: bob@pendleton.com (Bob Pendleton)
To:
Sent: Wednesday, January 09, 2002 8:20 PM
Subject: Re: [SDL] Scripting - good or bad?

Let me apologize in advance for posting a reply to my own reply to an
off topic post…

Another few other things to consider when thinking about implementing a
scripting language in your game.

  1. There are a number of scripting languages that already have SDL
    embedded in them. Look at http://www.libsdl.org/languages.html for a
    list. Rather than embed a scripting language in your
    game, why not write your game in a scripting language to start with?
    This avoids all the work
    of doing the embedding and gives you the same advantages as having a
    scripting language in your
    game. If you find that some code runs too slowly when written in the
    scripting language you
    can pull it out, rewrite it in C/C++, and embed it as a new "primitive"
    in the scripting
    language.

  2. To make use of a scripting language embedded in your game you have to
    have a clear idea
    of the interface between the internals of the game and the scripting
    engine. Once you have
    that you will most likely build and API to implement the interface. Once
    you have done that
    you can just use what ever your favorite programming language is to
    build .so or .dll files
    that your game loads at run time that use that API to interface with
    your game. The result
    is that your favorite programming language becomes your scripting
    language. And, if you do
    want to add an embedded scripting language later you can implement it as
    a .so or .dll file
    that uses the same API to access the internals of your game.

Bob Pendleton

Bob Pendleton wrote:

Ville Koskinen wrote:

Well, this isn’t exactly strictly SDL question, but I’ll ask anyway.
I’m programming (or at least trying to) a 2D 3rd person shoot’em’up, a bit
like Tapan Kaikki or Brutal Homicide.

Which is a better way, developing your own scripting language, using
someone else’s (like Lua or Scheme) or not using scripting at all? As I
understand scripting might slow down the game, but it would be easier to
modify it (make new modules (capture the flag) and such). Then again I’d
really like to develope my own language, just for the fun of it and so that
I could say to myself “I can really DO something with that computer-thingie,
not just play with it” ;-D. So, how’s it?

Can I get away with saying “been there, done that?” The question you
have to ask yourself is whether you are writing a game or a scripting
language. A scripting language is a lot of fun to write, but it is a tar
baby. You keep finding things you didn’t think you’d need so you have to
change the language design and rewrite big parts of the implementation.
Then there is the fact that know elese knows your language so if you
want other people to use it you will have to document it and help people
learn it. If you goal is to write a game, write a game. If you really
think you need a scripting language use an existing implementation. If
you look around you can find the scheme repository which is just full of
implementations of scheme. Some of these will fit in a very small amount
of memory. One I used nearly 10 years ago is called ELK. It ran in less
than 2 Megs on a 386… And, it has all the features you could ever ask
for in a scripting language.

            Bob Pendleton

– Ville Koskinen
viller.koskinen at iobox.com
Finland


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


±-----------------------------------+

  • Bob Pendleton is seeking contract +
  • and consulting work. Find out more +
  • at http://www.jump.net/~bobp +
    ±-----------------------------------+

SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


±-----------------------------------+

  • Bob Pendleton is seeking contract +
  • and consulting work. Find out more +
  • at http://www.jump.net/~bobp +
    ±-----------------------------------+

SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Not terribly ontopic, except that it somewhat applies to SDL+scripting :)On Thu, 10 Jan 2002, Paulo Pinto wrote:

I must say that I have played with pygame (SDL Python’s bindings)
yesterday and most of the games in the pygame site are really fast.

I used a PIII 700Mhz with 256Mb and a Matrox Productiva G100 AGP.
Most of the current PCs have better capabilities.

So I think that there are many 2D, and even 3D games that can be
fully coded in Python, or other scripting language, without any
great loss in speed.

(note: references to MD2/MD3 == Quake 2 and Quake 3 models respectively :slight_smile:
Experience writing an MD2/MD3 loader under Python and then porting it -to-
C++ shows that:
you get about twice rendering rate under C than python roughly…
well on simple scenes and little optimization with OpenGL
(okay, so I didn’t optimize :slight_smile:
parsing the MD2/MD3 files was considerably faster under C/C++ but
perhaps that’s because I was using the endian-neutral
Python functions…
Python devel was -considerably- more rapid than C/C++ - even with
a working version it took a few days to get the C/C++
version completely stablized sigh

Now this wasn’t using PyGame, but I suspect the same would be true there
g. With current hardware, this could work for a final product I
suspect. If nothing else it’s a -great- prototyping language…

Umm this isn’t -terribly- ontopic other than if anyone wants I could dig
up the loader and redistribute…

oh and note for those who are perl-literate, perl+SDL should be
-excellent- for prototyping and some final as well… g

G’day, eh? :slight_smile:
- Teunis