I was poking around the Stellaris folders, wondering about its modding capability—I've messed around with EU4 modding a bit, and contributed a small chunk to a CK2 mod, so I was hoping to see an improved version of PDS's in-house scripting language. But it's largely the same, with all the limitations that at times make modding Clausewitz games an exercise in frustration and make Captain Gars' job needlessly complicated.
I don't want to start on a diatribe agaisnt PDS's scripting language (if you code or are at least CS-saavy, you're already aware of its limitations). Because really, writing a scripting language is hard and I can't fault the Clausewitz dev team for the valiant effort. But I wonder why the decision to write an in-house language (and the continued decision to use it, apart from inertia) was made, especially when Lua exists and is an obvious alternative, for a few reasons:
- PDS has used Lua in the past, and there are vestiges of it in each of their games up to Stellaris. I'm guessing at least some of the PDS coders (and possibly scripters) are still proficient in Lua?
- Lua is generally very fast (particularly LuaJIT), and C++ to Lua API bindings are generally very fast (with some modern wrappers like Sol2 lightning fast).
- Lua syntax is clean and no more difficult to learn and grok than PDS syntax. In some cases, like data structuring, the two are similar.
- C++ to Lua bindings could easily expose Clausewitz functions and variables to game scripts. Without seeing the Clausewitz source, it's difficult to tell how this could improve event scripting and the like (I imagine the event processing code is very strict), but it "could." (See Civ V for the capabilities of modding strategy games via Lua)
I understand the inertia toward the in-house language is maybe insurmountably great, but why was the initial decision not to use Lua made?
I don't want to start on a diatribe agaisnt PDS's scripting language (if you code or are at least CS-saavy, you're already aware of its limitations). Because really, writing a scripting language is hard and I can't fault the Clausewitz dev team for the valiant effort. But I wonder why the decision to write an in-house language (and the continued decision to use it, apart from inertia) was made, especially when Lua exists and is an obvious alternative, for a few reasons:
- PDS has used Lua in the past, and there are vestiges of it in each of their games up to Stellaris. I'm guessing at least some of the PDS coders (and possibly scripters) are still proficient in Lua?
- Lua is generally very fast (particularly LuaJIT), and C++ to Lua API bindings are generally very fast (with some modern wrappers like Sol2 lightning fast).
- Lua syntax is clean and no more difficult to learn and grok than PDS syntax. In some cases, like data structuring, the two are similar.
- C++ to Lua bindings could easily expose Clausewitz functions and variables to game scripts. Without seeing the Clausewitz source, it's difficult to tell how this could improve event scripting and the like (I imagine the event processing code is very strict), but it "could." (See Civ V for the capabilities of modding strategy games via Lua)
I understand the inertia toward the in-house language is maybe insurmountably great, but why was the initial decision not to use Lua made?
- 2