I know I could spend hours upon hours researching on the internet, but in doing that I feel I might just be scratching the surface and I thought this might be a good topic for discussion.
I have never used lua so, please forgive me if this seems like a stupid post. So tell me about lua.
How are you using it? What it everything you thought it would be? Are there other things you can envision it being used for that you haven't taken advantage of yet?
Why lua?
Moderator: Coders of Rage
-
- Chaos Rift Junior
- Posts: 200
- Joined: Mon Feb 22, 2010 12:32 am
- Current Project: Breakout clone, Unnamed 2D RPG
- Favorite Gaming Platforms: PC, XBOX360
- Programming Language of Choice: C#
- Location: San Antonio,Texas
- Contact:
- LeonBlade
- Chaos Rift Demigod
- Posts: 1314
- Joined: Thu Jan 22, 2009 12:22 am
- Current Project: Trying to make my first engine in C++ using OGL
- Favorite Gaming Platforms: PS3
- Programming Language of Choice: C++
- Location: Blossvale, NY
Re: Why lua?
I'll most likely be using Lua myself, either that or Ruby.
It's used as a scripting engine for your game.
For example, NPCs would use Lua scripting and other things like that.
It's used as a scripting engine for your game.
For example, NPCs would use Lua scripting and other things like that.
There's no place like ~/
Re: Why lua?
Allrighty, I'm not quite sure what your question is asking...
Do you want to know "Why use a scripting language period?" or "Why use Lua as my scripting language as opposed to others?"
Or do you just think "Lua" is a person, and you're consulting him about the wonders of life? ("Why, Lua...? Why?")
^ All of the above are legitimate points of discussion.
Do you want to know "Why use a scripting language period?" or "Why use Lua as my scripting language as opposed to others?"
Or do you just think "Lua" is a person, and you're consulting him about the wonders of life? ("Why, Lua...? Why?")
^ All of the above are legitimate points of discussion.
<qpHalcy0n> decided to paint the office, now i'm high and my hands hurt
-
- Chaos Rift Junior
- Posts: 200
- Joined: Mon Feb 22, 2010 12:32 am
- Current Project: Breakout clone, Unnamed 2D RPG
- Favorite Gaming Platforms: PC, XBOX360
- Programming Language of Choice: C#
- Location: San Antonio,Texas
- Contact:
Re: Why lua?
It's a combination of your questions. Why use a scripting language and why use lua over say perl or some other scripting language.
- Falco Girgis
- Elysian Shadows Team
- Posts: 10294
- Joined: Thu May 20, 2004 2:04 pm
- Current Project: Elysian Shadows
- Favorite Gaming Platforms: Dreamcast, SNES, NES
- Programming Language of Choice: C/++
- Location: Studio Vorbis, AL
- Contact:
Re: Why lua?
I'm not going to answer the question "why embed a scripting language into an engine." I have posted entire 2 page philosophies in response to this question and I'm sure you'll be able to find them by doing a forum search. It all boils down to extensibility.
I will, however, answer the question as to why we chose Lua in particular.
Lua is fast, lightweight, and was designed specifically to be an embedded scripting language. The entire interpreter compiles natively with ANSI C, and comes with its own full-fledged C API. Other scripting languages (Perl, Python, Ruby, etc) are full-blown standalone programming languages that are all waaay larger and way slower than Lua. While they can be embedded into C/++ applications, this wasn't their purpose (whereas Lua was designed for this) and take quite a bit of glue code to get C/++ communicating with them.
I will, however, answer the question as to why we chose Lua in particular.
Lua is fast, lightweight, and was designed specifically to be an embedded scripting language. The entire interpreter compiles natively with ANSI C, and comes with its own full-fledged C API. Other scripting languages (Perl, Python, Ruby, etc) are full-blown standalone programming languages that are all waaay larger and way slower than Lua. While they can be embedded into C/++ applications, this wasn't their purpose (whereas Lua was designed for this) and take quite a bit of glue code to get C/++ communicating with them.
-
- Chaos Rift Junior
- Posts: 200
- Joined: Mon Feb 22, 2010 12:32 am
- Current Project: Breakout clone, Unnamed 2D RPG
- Favorite Gaming Platforms: PC, XBOX360
- Programming Language of Choice: C#
- Location: San Antonio,Texas
- Contact:
Re: Why lua?
so riddle me this...does lua act like a "wrapper" around your code that allows you to call your code external to the application?
Re: Why lua?
You can call C/C++ functions from Lua and Lua functions from C/C++.mattheweston wrote:so riddle me this...does lua act like a "wrapper" around your code that allows you to call your code external to the application?