Python or Lua for [game] scripting?

Started by
7 comments, last by abd9e4790f 19 years, 10 months ago
After reading this article on gamasutra.com, I think Python is the way to go. However, they never said Lua was bad either. And I definitely do not want to "roll my own." So which one can I get up and running the quickest? And which one has a fairly easy learning curve without sacrificing features and/or flexibility? Words of Wisdom:
"C# allows you to use DirectX very conveniently, but don't learn it instead of C++. Since C# programs require Microsoft's .NET system, the language is unlikely to become standard on console machines" (Ernest Adams).
"...many programmers believe that the programmer's main concerns should be correctness and clarity and that code optimization should be left to the compiler" (Stephen Prata).
"When you get into the game industry, don't accept the status quo to easily. Question things that seem questionable to you." (Ernest Adams), "Don't be arrogant about it, or insists that you know better than veteran developers, but don't blindly accept the prevailing wisdom just because 'this is the way we've always done it.'"
[edited by - DIRECTXMEN on June 3, 2004 10:46:25 AM] [edited by - DIRECTXMEN on June 3, 2004 10:52:59 AM]
Advertisement
I''ve tried embedding LUA but I''ve played with both languages. IMO they''re both perfectly capable for game scripting, though LUA does seem more ''lightweight''. LUA is nice and easy to embed, I''m not sure about Python I''ve heard conflicting things about how easy it is to embed.

I''d say have a play with both, have a look at the API each of them provides for embedding and decide which one you want to use.
I found this. It's on a lua users site so it might be biased. But still that's quite interesting.
Clicky

I already know Python and I like that language a lot. OTH, it seems that lua was made specifically for being embeded in other apps.

[edited by - Codexus on June 3, 2004 12:57:04 PM]
Personally I hate phyton in Blender.
It seems as if the scripts have to be rewritten for almost any new release.
And the developers have to grab the latest phyton version if they want complete phyton scripting functionality.
Not sure if that is because of the way it is implemented though ...
and no idea if it would work as well and better with lua ... ?

[edited by - Clueless on June 3, 2004 1:08:00 PM]
Writing errors since 10/25/2003 2:25:56 AM
How hard is it really to spell P-y-t-h-o-n? You know, like the comedy group and the snake?
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
Not easy when you have no respect and see it written differently all the time.

[edited by - Clueless on June 3, 2004 2:34:39 PM]
Writing errors since 10/25/2003 2:25:56 AM
embedding python is a little harder (use swig and other third parties). python allows you OOP which is available in lua5 with little tricks. python is maybe too much heavier (stackless version,...). python is to java what lua is to C. So I chose lua and I''m really happy with it.
I use lua to script game parts and characters behaviours.
quote:
"...many programmers believe that the programmer''s main concerns should
be correctness and clarity and that code optimization should be left to the
compiler" (Stephen Prata).


I have a hard time believing that many *GOOD* programmers put all their faith in a compiler to do things as optimally as possible. A compiler isn''t psychic, and it can''t possibly know what your program is actually doing. It can optimize some basic stuff, but ultimately a programmer can''t avoid doing optimizations of their own in many situations.
.

---------------------------Hello, and Welcome to some arbitrary temporal location in the space-time continuum.

quote:Original post by Etnu
I have a hard time believing that many *GOOD* programmers put all their faith in a compiler to do things as optimally as possible. A compiler isn''t psychic, and it can''t possibly know what your program is actually doing. It can optimize some basic stuff, but ultimately a programmer can''t avoid doing optimizations of their own in many situations.
.


It''s OK, because "good" was nowhere in the sig quote. So SOT. Although, I do like a good controversial signature.

Anyway, looks like Lua is the favorite, so I''ll look into. I only hope it is as well documented as say python is.

Thanks.


This topic is closed to new replies.

Advertisement