Page 1 of 1

General Question: Why Lua?

Posted: Tue Sep 25, 2018 2:30 pm
by snarlynarwhal
I do not know much about integrating scripting languages and hence became curious about why the Dialogue System uses Lua both in general and as supposed to say C#. A couple of specific questions:
  • Without third-party support, C# used JIT which takes time making it unfavorable as a scripting language, right?
  • What about third-party C# script execution engines like CS-Script?
  • If CS-Script is a feasibly alternative, does it have any notable pros and cons in comparison to Lua?
  • For example, does Lua's dynamic capabilities offer more functionality or flexibility than C#'s dynamic capabilities?
Thanks ahead for any explanations! Just looking to satisfy my curiosity about scripting engine integrations. Any information or links to articles where I can learn more would also be much appreciated.

Thanks!

Re: General Question: Why Lua?

Posted: Tue Sep 25, 2018 3:39 pm
by Tony Li
Hi,

The Dialogue System started life as a Unity front-end for a third party authoring tool called Chat Mapper. Chat Mapper uses Lua because:

1. It's a popular language that's familiar to many modders and game developers, and is one of the easier languages to learn, and

2. It's easy to integrate into existing engines.

When Chat Mapper was designed, Lua was the de facto standard for this type of scripting interface. It's still widely used and in fact might still be the most commonly-used modding language.

So when the Dialogue System was designed, there was really no choice. In order to support Chat Mapper, it had to support Lua. Some devs use the Dialogue System's Lua environment very extensively, even exposing it as an in-game dev console and as a player modding interface that ties into their own C# code. Most, however, never touch a single character of Lua and instead just use the Dialogue System's dropdown to automatically generate Lua statements.

Re: General Question: Why Lua?

Posted: Tue Sep 25, 2018 6:13 pm
by snarlynarwhal
Thanks for the thorough reply! I love the Lua scripting integration and the visual tools you created for it btw, really excited to integrate this into my game.

Re: General Question: Why Lua?

Posted: Tue Sep 25, 2018 7:59 pm
by Tony Li
Thanks! Have fun with it. If any questions come up, you know where to post. :-)