Why LUA?

WavesonicsWavesonics Join Date: 2006-12-02 Member: 58833Members
<div class="IPBDescription">Why not Squirrel or AngleScript?</div>I am currently investigating Scripting engines for my game, and I discovered a bunch out there:

LUA - <a href="http://www.lua.org/" target="_blank">http://www.lua.org/</a>
GameMonkey - <a href="http://www.somedude.net/gamemonkey/" target="_blank">http://www.somedude.net/gamemonkey/</a>
AngleScript - <a href="http://www.angelcode.com/angelscript/" target="_blank">http://www.angelcode.com/angelscript/</a>
Squirrel (The programming language) - <a href="http://squirrel-lang.org/" target="_blank">http://squirrel-lang.org/</a>

And Squirrel & AngleScript seem quite a bit better than LUA to be honest, so what influenced your decision to go with LUA?

Comments

  • KungFuDiscoMonkeyKungFuDiscoMonkey Creator of ns_altair 日本福岡県 Join Date: 2003-03-15 Member: 14555Members, NS1 Playtester, Reinforced - Onos
    I can't answer on behalf of UWE but I know LUA is more of an industry standard. This is the first time I have ever heard of the other three.
  • WavesonicsWavesonics Join Date: 2006-12-02 Member: 58833Members
    edited January 2009
    Yes, LUA is certainly the most widely adopted.

    But Beta was still better than VHS <img src="style_emoticons/<#EMO_DIR#>/wink-fix.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink-fix.gif" />

    Like, Squirrel has a JIT compiler to native x86! How damn cool is that!

    AngleScript is run time compiled to fast byte code, also much easier on the application programming side than LUA.
  • RadixRadix Join Date: 2005-01-10 Member: 34654Members, Constellation
    Not to rain on your parade but there's a big difference between consumer markets' buying habits and those of corporations who actually pay attention when shelling out money. Generally they have a good reason for the tools they use (an example would be Microsoft Office over Open Office).
  • WavesonicsWavesonics Join Date: 2006-12-02 Member: 58833Members
    Well saying "big companies use it there for it must be good" doesn't cut it for my analytical mind <img src="style_emoticons/<#EMO_DIR#>/wink-fix.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink-fix.gif" />

    But I know for a fact that Charley is a brilliant programmer, so I was interested in why he specifically chose it.
  • MaxMax Technical Director, Unknown Worlds Entertainment Join Date: 2002-03-15 Member: 318Super Administrators, Retired Developer, NS1 Playtester, Forum Moderators, NS2 Developer, Constellation, Subnautica Developer, Pistachionauts, Future Perfect Developer
    <!--quoteo(post=1697380:date=Jan 9 2009, 12:26 PM:name=Wavesonics)--><div class='quotetop'>QUOTE(Wavesonics @ Jan 9 2009, 12:26 PM) <a href="index.php?act=findpost&pid=1697380"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I am currently investigating Scripting engines for my game, and I discovered a bunch out there:

    LUA - <a href="http://www.lua.org/" target="_blank">http://www.lua.org/</a>
    GameMonkey - <a href="http://www.somedude.net/gamemonkey/" target="_blank">http://www.somedude.net/gamemonkey/</a>
    AngleScript - <a href="http://www.angelcode.com/angelscript/" target="_blank">http://www.angelcode.com/angelscript/</a>
    Squirrel (The programming language) - <a href="http://squirrel-lang.org/" target="_blank">http://squirrel-lang.org/</a>

    And Squirrel & AngleScript seem quite a bit better than LUA to be honest, so what influenced your decision to go with LUA?<!--QuoteEnd--></div><!--QuoteEEnd-->
    We chose Lua because we know Lua is solid. It's been used in tons of projects (including games) and there's lots of support around it including binding libraries, add-on libraries, patches to mod it, etc. Since our entire game is basically written in Lua (only the engine is C++), we didn't really want to get 75% of the way through the project and discover a fundamental issue with the scripting language.

    I briefly considered GameMonkey, but I don't see any real benefit to it over Lua and as far as I know hasn't really been proven. I also considered Python, but ultimately chose Lua because it always wins performance shoot outs. There's also a JIT compiler for Lua btw (LuaJIT).

    If I had to make the decision today, I'd also favor Lua because there's a <a href="http://www.unknownworlds.com/decoda" target="_blank">kickass debugger</a> for it! I'd also consider JavaScript in the mix if I was deciding today as well.

    I will say that I also spent some time creating a scripting language (not for work, just as a side project) because I thought there were some things I could improve about Lua. After a little bit for effort I came to realize that the way Lua is designed is really great and it's like that for a reason. The only thing I'm not crazy about with Lua is the Pascal-like syntax, but that could be modified quite easily I think (we've made a few changes to vanilla Lua for NS2).
  • WavesonicsWavesonics Join Date: 2006-12-02 Member: 58833Members
    edited January 2009
    Awesome, thanks for the reply max!

    That's what I was looking for. Sorry for assuming Charley made the decision.

    Btw, I posted a while back, not sure if you saw it, but I'd be very interested in some of how you implemented your shadowing and volumetric lighting: <a href="http://www.unknownworlds.com/ns2/forums/index.php?showtopic=105253" target="_blank">http://www.unknownworlds.com/ns2/forums/in...howtopic=105253</a>

    Keep up the good work, it's inspiring to see a small indie team doing some fantastic AAA work.
  • RadixRadix Join Date: 2005-01-10 Member: 34654Members, Constellation
    <!--quoteo(post=1697388:date=Jan 9 2009, 03:56 PM:name=Radix)--><div class='quotetop'>QUOTE(Radix @ Jan 9 2009, 03:56 PM) <a href="index.php?act=findpost&pid=1697388"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->big companies use it there for it must be good<!--QuoteEnd--></div><!--QuoteEEnd-->
    <!--quoteo(post=1697390:date=Jan 9 2009, 04:32 PM:name=Wavesonics)--><div class='quotetop'>QUOTE(Wavesonics @ Jan 9 2009, 04:32 PM) <a href="index.php?act=findpost&pid=1697390"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Well saying "big companies use it there for it must be good" doesn't cut it for my analytical mind <img src="style_emoticons/<#EMO_DIR#>/wink-fix.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink-fix.gif" /><!--QuoteEnd--></div><!--QuoteEEnd-->
    <!--quoteo(post=1697392:date=Jan 9 2009, 05:10 PM:name=Max)--><div class='quotetop'>QUOTE(Max @ Jan 9 2009, 05:10 PM) <a href="index.php?act=findpost&pid=1697392"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Big companies use it therefore it must be good.<!--QuoteEnd--></div><!--QuoteEEnd-->
    <!--quoteo(post=1697393:date=Jan 9 2009, 05:23 PM:name=Wavesonics)--><div class='quotetop'>QUOTE(Wavesonics @ Jan 9 2009, 05:23 PM) <a href="index.php?act=findpost&pid=1697393"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Awesome, thanks for the reply max!

    That's what I was looking for.<!--QuoteEnd--></div><!--QuoteEEnd-->

    lol.

    Thanks Max. <img src="style_emoticons/<#EMO_DIR#>/nerd-fix.gif" style="vertical-align:middle" emoid="::nerdy::" border="0" alt="nerd-fix.gif" />
  • aNytiMeaNytiMe Join Date: 2008-03-31 Member: 64007Members, Constellation
    edited January 2009
    KungFu - Big companies use it so it must be good.
    Wave - That's not what I'm looking for.
    Max - Big companies are using it so we're using it too.
    Wave - That's what I was looking for, thanks Max.

    <img src="http://i217.photobucket.com/albums/cc15/Domining/Emots/emot-psyduck.gif" border="0" class="linked-image" />

    Edit: Beaten by a couple of hours, had this window open for a while. XD
  • steppin'razorsteppin'razor Join Date: 2008-09-18 Member: 65033Members, Constellation
    edited January 2009
    pretty sure Max had a few more points on the matter then just that radix, "not to rain on your parade"
  • RadixRadix Join Date: 2005-01-10 Member: 34654Members, Constellation
    Yeah but the psyduck was crucial.
  • goblingoblin Join Date: 2004-09-05 Member: 31412Members
    Lua is from my country <img src="style_emoticons/<#EMO_DIR#>/smile-fix.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile-fix.gif" />
  • EmanonEmanon Join Date: 2003-05-13 Member: 16254Members, Constellation
    edited January 2009
    <!--quoteo(post=1697497:date=Jan 11 2009, 03:11 PM:name=Radix)--><div class='quotetop'>QUOTE(Radix @ Jan 11 2009, 03:11 PM) <a href="index.php?act=findpost&pid=1697497"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Yeah but the psyduck was crucial.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Your point was terrible and didn’t require the smart ass response you gave it... Only reason you were right was because a large amount of the industry uses it, no reasons or logical thought process other than follow the leader.


    Only Chime in on discussions that you can add value to.




    Max, like most of UWE's discussions; a well thought out process went into this. Nice to see this holds true throughout the process.
  • BacillusBacillus Join Date: 2006-11-02 Member: 58241Members
    Max's responses are really informative indeed. Keep up the good work.
  • Killer RicochetKiller Ricochet Join Date: 2008-12-03 Member: 65639Members
    <!--quoteo(post=1697519:date=Jan 12 2009, 08:16 AM:name=goblin)--><div class='quotetop'>QUOTE(goblin @ Jan 12 2009, 08:16 AM) <a href="index.php?act=findpost&pid=1697519"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Lua is from my country <img src="style_emoticons/<#EMO_DIR#>/smile-fix.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile-fix.gif" /><!--QuoteEnd--></div><!--QuoteEEnd-->
    Yay <img src="style_emoticons/<#EMO_DIR#>/tounge.gif" style="vertical-align:middle" emoid=":p" border="0" alt="tounge.gif" />, BR-power
  • RadixRadix Join Date: 2005-01-10 Member: 34654Members, Constellation
    <!--quoteo(post=1697526:date=Jan 12 2009, 09:58 AM:name=Emanon)--><div class='quotetop'>QUOTE(Emanon @ Jan 12 2009, 09:58 AM) <a href="index.php?act=findpost&pid=1697526"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Your point was terrible and didn’t require the smart ass response you gave it... Only reason you were right was because a large amount of the industry uses it, no reasons or logical thought process other than follow the leader.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Well of course I had no logical thought process such as the fact that they've invented an in-house debugging tool to handle it, or that they already have themselves invested to a degree of some depth. I certainly wasn't thinking about how reliable it's proven itself to be in multi-million dollar projects with people whose jobs rest on determining the most effective language frontends.

    Clearly the only reason I posted was because I wanted to cheer on the hive mind mentality. Thank you for pointing out my mistake Emanon.
  • HarimauHarimau Join Date: 2007-12-24 Member: 63250Members
    <!--quoteo(post=1697556:date=Jan 13 2009, 07:14 AM:name=Radix)--><div class='quotetop'>QUOTE(Radix @ Jan 13 2009, 07:14 AM) <a href="index.php?act=findpost&pid=1697556"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Well of course I had no logical thought process such as the fact that they've invented an in-house debugging tool to handle it, or that they already have themselves invested to a degree of some depth. I certainly wasn't thinking about how reliable it's proven itself to be in multi-million dollar projects with people whose jobs rest on determining the most effective language frontends.

    Clearly the only reason I posted was because I wanted to cheer on the hive mind mentality. Thank you for pointing out my mistake Emanon.<!--QuoteEnd--></div><!--QuoteEEnd-->
    Pure gold.
  • WitchLordWitchLord Join Date: 2009-01-13 Member: 66073Members
    <!--quoteo(post=0:date=:name=Wavesonics)--><div class='quotetop'>QUOTE(Wavesonics)</div><div class='quotemain'><!--quotec-->Wavesonics - And Squirrel & AngleScript seem quite a bit better than LUA to be honest, so what influenced your decision to go with LUA?<!--QuoteEnd--></div><!--QuoteEEnd-->
    Thanks for spreading the word about AngelScript. It's greatly appreciated.

    Hopefully one day AngelScript will obtain the same widespread use as Lua.

    <!--quoteo(post=0:date=:name=goblin)--><div class='quotetop'>QUOTE(goblin)</div><div class='quotemain'><!--quotec-->Lua is from my country <img src="style_emoticons/<#EMO_DIR#>/smile-fix.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile-fix.gif" /><!--QuoteEnd--></div><!--QuoteEEnd-->
    AngelScript is also from Brazil. <img src="style_emoticons/<#EMO_DIR#>/smile-fix.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile-fix.gif" />

    ---

    When choosing a scripting library that is going be a major part of your product you have to choose carefully. And when millions of dollars is at stake you have to try to eliminate as many unknown risks as possible. For that reason alone I believe Max made a wise choice when going for Lua.

    I humbly believe AngelScript has more potential than Lua, but it has not reached the same maturity yet, and probably won't do so for several years. It is already used by developers all over the world, but there is still many more features that I need to implement.

    Regards,
    Andreas

    PS. I look forward to playing NS2.
  • EmanonEmanon Join Date: 2003-05-13 Member: 16254Members, Constellation
    <!--quoteo(post=1697556:date=Jan 12 2009, 06:14 PM:name=Radix)--><div class='quotetop'>QUOTE(Radix @ Jan 12 2009, 06:14 PM) <a href="index.php?act=findpost&pid=1697556"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Well of course I had no logical thought process such as the fact that they've invented an in-house debugging tool to handle it, or that they already have themselves invested to a degree of some depth. I certainly wasn't thinking about how reliable it's proven itself to be in multi-million dollar projects with people whose jobs rest on determining the most effective language frontends.

    Clearly the only reason I posted was because I wanted to cheer on the hive mind mentality. Thank you for pointing out my mistake Emanon.<!--QuoteEnd--></div><!--QuoteEEnd-->


    Good points, glad you thought things out. Just wish you had the maturity to post this previously and in a way not to belittle anyone.
  • RadixRadix Join Date: 2005-01-10 Member: 34654Members, Constellation
    I would never belittle anyone Emanon. There are more than enough jaded vets to do the job for me.
  • PricePrice Join Date: 2003-09-27 Member: 21247Members
    <!--quoteo(post=1697392:date=Jan 9 2009, 05:10 PM:name=Max)--><div class='quotetop'>QUOTE(Max @ Jan 9 2009, 05:10 PM) <a href="index.php?act=findpost&pid=1697392"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->We chose Lua because we know Lua is solid. It's been used in tons of projects (including games) and there's lots of support around it including binding libraries, add-on libraries, patches to mod it, etc. Since our entire game is basically written in Lua (only the engine is C++), we didn't really want to get 75% of the way through the project and discover a fundamental issue with the scripting language.

    I briefly considered GameMonkey, but I don't see any real benefit to it over Lua and as far as I know hasn't really been proven. I also considered Python, but ultimately chose Lua because it always wins performance shoot outs. There's also a JIT compiler for Lua btw (LuaJIT).

    If I had to make the decision today, I'd also favor Lua because there's a <a href="http://www.unknownworlds.com/decoda" target="_blank">kickass debugger</a> for it! I'd also consider JavaScript in the mix if I was deciding today as well.

    I will say that I also spent some time creating a scripting language (not for work, just as a side project) because I thought there were some things I could improve about Lua. After a little bit for effort I came to realize that the way Lua is designed is really great and it's like that for a reason. The only thing I'm not crazy about with Lua is the Pascal-like syntax, but that could be modified quite easily I think (we've made a few changes to vanilla Lua for NS2).<!--QuoteEnd--></div><!--QuoteEEnd-->
    lua is great, far cry used it and garry mod.
    but im a but im be on edge about virus.
    garry mod have one of them, the problem is, if you join a server, you never know what lua script the server is using.
Sign In or Register to comment.