AngelScript vs Lua

Discussion in 'Game Development (Technical)' started by Pogacha, Sep 16, 2009.

  1. vjvj

    Indie Author

    Joined:
    Sep 25, 2004
    Messages:
    1,732
    Likes Received:
    0
    That's the thing, though. The whole idea behind all of this (IMHO) is to serve the specific needs of specific people on your team:

    • Who are the team members who generally prefer the simpler programming interface of scripting languages? Technical artists and designers.
    • Who are the team members who most greatly benefit from fast, runtime reloading? Technical artists and designers. They do far more tweak something->re-test->repeat-style programming than anyone else.
    • Who are the team members least likely to be running Visual Studio, and therefore most likely to not be interested in Edit and Continue? Technical artists and designers :)

    Again, I don't intend to sound heavy-handed here because I know every team works differently, I'm just wondering where we are headed with this discussion... Do any of us really know any programmers that decided to adopt a scripting language only to massively regret it later? Or maybe chose Lua and then beat themselves up over not choosing Angelscript? I guess I'm just failing to see where the life-or-death risk assessment is here. Adoption is generally a few days' work, tops, and most of the popular languages are robust enough to handle any task satisfactorily enough to avoid requiring a painful, mid-project tear down.
     
  2. gekido

    Original Member

    Joined:
    Aug 23, 2004
    Messages:
    2
    Likes Received:
    0
    angelscript

    we've been using angelscript for a number of years with GameCore and have been pretty impressed with it to date.

    The integration was straightforward, and allows us to very easily bind new functionality into the scripting system. All told, we have over 1000 different scripting functions across dozens of classes and no matter what, it significantly increases the speed of development across the board.

    implementing game logic in c++ is simply not logical, even if you are the only programmer working on the code. being able to instantly rebuild your scripts without even needing to restart the application means that you can iterate very rapidly - and tied into a flexible UI system and other components means a very flexible development environment.

    Most of our programmers had worked with lua in the past and ran screaming from it due to extremely high overhead, very convoluted syntax and many other reasons.

    The biggest reason to avoid something like lua or python is the simple fact that designers or junior-programmer-types should be able to pick up the scripting system and actually do something useful with it without much difficulty - and python / lua's syntax just doesn't make sense to most people out of the box - even experienced C++ programmers.

    Angelscript is similar enough to C / C++ that we've had junior programmers up and running in literally a day or two, producing shipping code.

    when we first implemented it, there were definitely some features that weren't present (classes etc) but in practice, we've found that 99% of our users (who are very non-technical and are probably much more typical of who would / should be using a scripting language) simply do not need or want the advanced 'object-oriented' features of a language. Over the years, the language has matured (with proper class support, additional platform bindings etc) and we have been very impressed with it.
     
  3. Pogacha

    Original Member

    Joined:
    Jan 21, 2005
    Messages:
    605
    Likes Received:
    0
    Thanks for sharing your experience.
     
  4. cyodine

    Original Member

    Joined:
    Jun 22, 2005
    Messages:
    169
    Likes Received:
    0
    I think it might be fun some day to make my own World of Warcraft addons, since I play the game enough. I'm pretty sure the addons require Lua though. But I sure do like the idea of a near C++ scripting language of Angelscript. Decisions decisions.
     
  5. jpoag

    jpoag New Member

    Joined:
    Mar 15, 2008
    Messages:
    806
    Likes Received:
    0
    I use Lua, and although I contemplate switching to another language from time to time, Lua has been good to me.

    Now, I recommend LuaBind and the Call Dispatcher from Lua++ (a single header file). Luabind helps get the Lua objects into the C++ safely while allowing you to do type checking and manipulation. Luabind also lets you register whole classes and engine types (Point, Matrix, Sprite, Particle, etc..).

    Lua++ helps get the C++ functions into Lua. It has methods for registering class member functions with a this pointer. Really, I only use the call dispatcher (a single header file) with a macro to make sure I set the name of the class method I'm registering.

    Between the two of those libraries, I never have to mess with the Lua Stack.

    Pluto is another must-have. It allows you to save and load a lua table to a string. I don't even fuss with the C++ side of pluto; I have a serialization function that returns the string.

    Lua has some really cool features that makes it great for a scripting engine. One is the closure that Lua supports. When I return a function from a lua method, any values that it refers to is stored with the function.
     
  6. vjvj

    Indie Author

    Joined:
    Sep 25, 2004
    Messages:
    1,732
    Likes Received:
    0
    Ok seriously... "Extremely high overhead"? I've worked in optimization groups for years, and guys on the CPU side (I'm on the GPU side) have often recommended Lua to me, partially due to its performace. So I'd be interested in hearing how these programmers of yours could not find performance where others have done just fine on platforms like PS2, which had an extremely underpowered CPU. How did they determine this?

    I've got nothing against Angelscript at all, so don't take this as a knock on it. I just don't like to see claims that fly in the face of common knowledge without some details to accompany them :p
     
  7. vmgames

    vmgames New Member

    Joined:
    Nov 30, 2006
    Messages:
    10
    Likes Received:
    0
    lua with luabind is very nice.

    there is a a few hours to become familiar with the syntax (especiallty if you re not familiar with boost syntax) but when you re done, it is incredibly fast to add features like whole class binding with (near all) C++ features like :
    constructors, methods, member variables reading/writing, operator overloading, override classes in lua with base classes in C++.
     
  8. Pogacha

    Original Member

    Joined:
    Jan 21, 2005
    Messages:
    605
    Likes Received:
    0
    Lua lovers :/ you are making it harder to decide ...
     
  9. Maupin

    Original Member

    Joined:
    Jun 28, 2006
    Messages:
    1,183
    Likes Received:
    0
    If your programmers can't pick up Python or Lua in a day or two, you have bigger problems than you realize...

    Actually, the biggest reason to avoid Python / Lua is that after two days of using it, going back to all those curly brackets is painful. Especially when you have to work with someone or some project that uses a weird, nonstandard coding style. With Python or Lua, no matter who codes a function, it tends to look the same.
     
  10. Bad Sector

    Original Member

    Joined:
    May 28, 2005
    Messages:
    2,742
    Likes Received:
    5
    I disagree with the second part (even if i use Python regularly, i still prefer the curly braces :) but i agree with the first part.
     
  11. vjvj

    Indie Author

    Joined:
    Sep 25, 2004
    Messages:
    1,732
    Likes Received:
    0
    I've been avoiding the syntax side of this discussion since it's so subjective, but honestly, the only complaint I've ever heard regarding Python or Lua is Python's use of whitespace. And that really only affects programmers that are used to whitespace being ignored; technical artists and designers never seem to mind this.

    Really, Python and Lua both have such drop-dead easy scripting syntaxes that it's hard for me to even fathom people complaining about them. Maybe the detractors are Perl fans? :p
     

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer