• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Hakuromatsu

Major
25 Badges
May 1, 2013
703
434
  • Crusader Kings II: Charlemagne
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Sengoku
  • Victoria: Revolutions
  • Europa Universalis IV: Res Publica
  • March of the Eagles
  • Hearts of Iron III
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II
  • Europa Universalis IV
  • Victoria 2
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Stellaris Sign-up
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?
 
  • 2
Reactions:
I aint a coder so take this for what it's worth, but if it ain't broke don't fix it.
 
The AI in HOI3 was run though Lua scripts, but we decided to abandon these for several reasons in HOI4 (lack of lua knowledge at the company and low performance was the big ones).

We are not using LUA for HoI4. This was a decision made before I started working at PDS, and was based primarily on lack of in house LUA skills and performance cost.
 
  • 2
Reactions:
I'd really like to see them re-evaluate those decisions for upcoming games/expansions. The UI in particular is an area where being able to use a full api with a language like Lua or Python would be incredibly helpful to the community with a minimal potential performance impact. This is really apparent in Stellaris, which shipped with a UI that is, frankly, lacking some critical features and has many points of unnecessary friction.
 
Last edited:
  • 2
Reactions: