• 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.
Aug 10, 2009
344
0
I suppose there was a need for a proper scripting language (those cute paradox style txt files only go so far :p) and lua was chosen, probably because it can be integrated easily into other projects (the game, that is). Take a look at wikipedia for an overview, I haven't used it before myself.
 

Kriegsspieler

Field Marshal
68 Badges
Feb 27, 2003
10.454
1.252
  • Europa Universalis IV
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Surviving Mars
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Battle for Bosporus
  • Hearts of Iron IV: No Step Back
It is a scripting language. I can't tell you why Paradox decided to use it, ask them. And .lua files are lua script files. Kinda self-explanatory don't you think? ;)
Indeed it would be, if one was in a position to know what lua was in the first place!
I did look it up, anyway, and Luka's reply put it in context too.
 

telesien

Grand Admiral
40 Badges
Aug 28, 2007
4.028
18.222
  • Commander: Conquest of the Americas
  • Semper Fi
  • Rome Gold
  • Magicka
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III
  • For the Motherland
  • Europa Universalis III: Chronicles
  • Deus Vult
  • Crusader Kings II
  • 500k Club
  • Crusader Kings II: Conclave
  • Hearts of Iron IV: Field Marshal
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Hearts of Iron IV Sign-up
  • 200k Club
  • Hearts of Iron IV: Death or Dishonor
  • Age of Wonders III
  • Hearts of Iron IV: Expansion Pass
  • Shadowrun Returns
  • Shadowrun: Dragonfall
  • Shadowrun: Hong Kong
  • Hearts of Iron IV: Expansion Pass
  • Prison Architect
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life
  • Mount & Blade: Warband
  • Crusader Kings II: Holy Knight (pre-order)
  • War of the Roses
  • Victoria 2
  • 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: Charlemagne
This kind of reminds me the time, when I asked if the goal oriented AI is now (or in any reasonable time in future) able to work properly :)
 
Aug 14, 2009
42
0
And there you go! I love playing 1.3 personally, it's great fun compared to 1.2. :D

What exactly do you love about the game vs. 1.2? I admit, I like to experiment with the units, but operationally and strategically the game is still broken (among other issues.) Other than being much faster than 1.2 I am just curious what fun are getting out of the game so far?
 

Scryder

Lt. General
104 Badges
Aug 2, 2009
1.271
3
  • King Arthur II
  • Magicka
  • Majesty 2 Collection
  • Europa Universalis III Complete
  • Naval War: Arctic Circle
  • Victoria: Revolutions
  • Europa Universalis: Rome
  • Semper Fi
  • Sword of the Stars
  • Rome: Vae Victis
  • Crusader Kings II: Conclave
  • Sword of the Stars II
  • Victoria 2
  • Age of Wonders: Planetfall - Revelations
  • Knights of Pen and Paper +1 Edition
  • Cities: Skylines - Green Cities
  • 500k Club
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Pre-order
  • Mount & Blade: Warband
  • Mount & Blade: With Fire and Sword
  • Crusader Kings II: Way of Life
  • Age of Wonders III
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Stellaris: Leviathans Story Pack
  • Cities in Motion 2
  • BATTLETECH
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Mandate of Heaven
  • Cities: Skylines - Snowfall
  • Cities: Skylines - Mass Transit
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Together for Victory
  • Cities: Skylines - Natural Disasters
  • Cities in Motion
  • Stellaris: Digital Anniversary Edition
  • Steel Division: Normandy 44
  • Tyranny: Archon Edition
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Stellaris
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Rights of Man
  • Surviving Mars
  • Hearts of Iron IV: Death or Dishonor
What exactly do you love about the game vs. 1.2? I admit, I like to experiment with the units, but operationally and strategically the game is still broken (among other issues.) Other than being much faster than 1.2 I am just curious what fun are getting out of the game so far?

Well OK, here goes. First, I haven't played any other HoI game before, so I don't know what the "ideal" game is. I'm currently liberating Europe as USA, with full manual control. In 1.2 I managed to defeat Germany without any sign of resistance in less than 2 months. In 1.3 as soon as my troops landed, I faced much stiffer opposition and I found it a struggle advancing every step of the way. I had to pull my defensive lines back a number of times and regroup before advancing forward. A couple of times I got ahead of myself and got a couple of Mechanized divs trapped behind enemy lines. I am aware that the AI is not perfect, but their troops did manage to cut off these divs quite well.

My troops have yet to run into supply problems either, even when they were fighting in the low infra parts of Italy.

I know there are still bugs, I report them in bugreports if I can reproduce them so they can be fixed in a later patch. Overall I'm getting a much better gaming experience with 1.3. I don't know, maybe I'm just easily pleased...
 

dublish

General
96 Badges
Apr 4, 2006
2.380
1
  • Sengoku
  • Heir to the Throne
  • Europa Universalis III Complete
  • Iron Cross
  • Knights of Pen and Paper +1 Edition
  • Leviathan: Warships
  • Magicka
  • Europa Universalis III Complete
  • Naval War: Arctic Circle
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Europa Universalis: Rome
  • Semper Fi
  • Hearts of Iron III: Their Finest Hour
  • Sword of the Stars
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Warlock: Master of the Arcane
  • 200k Club
  • 500k Club
  • Cities: Skylines
  • Crusader Kings II: Holy Knight (pre-order)
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Pre-order
  • Hearts of Iron IV: No Step Back
  • Darkest Hour
  • Hearts of Iron II: Armageddon
  • Cities in Motion
  • Cities in Motion 2
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Arsenal of Democracy
  • Deus Vult
  • Europa Universalis III
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • For The Glory
  • For the Motherland

mbb

Lt. General
7 Badges
Apr 25, 2003
1.338
816
  • Hearts of Iron II: Armageddon
  • Deus Vult
  • Europa Universalis III
  • Hearts of Iron III
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • 500k Club
Is this true? What can we do to fix this?
The post was really talking about the performance of the game. There may be some truth in there.

Scripted languages tend to be slower than compiled languages, often are designed with a specific purpose in mind and not good at performing certain tasks depending on the task and language. Whether this is true in this context or not - well, Johan has had his say.

There is also the added complication that the LUA script is interacting with the executable and it is impossible to judge the use of the LUA scripts without having a very good knowledge of the game engine itself.

I was surprised to learn that LUA was going to be used for parts of the AI.

I understand the requirement to make the AI moddable, but a scripting language was the last thing I expected to see for a part of the game that I think needs as much performance as it can get.

Are there any benchmarks for comparison?

But what was the true intention for making the AI moddable in this way? Was it for the modding community or for the developers (internal/external) themselves? Because if it were for the latter's benefit, then what was wrong with C++?

If there are certain LUA scripts that continue to be a problem performance wise then there is always the option of porting that functionality into C++; but that would be Paradox's call and one less thing for the modders to play with.

The community can point out inefficient LUA scripts - I'm sure that has been done already. But we can't change the nature of the game's construction. That's up to Paradox and I suspect it is pretty much set in stone by now.

But to say the game cannot be 'fixed' is just not true.
 

podcat

Game Director
Paradox Staff
12 Badges
Jul 23, 2007
12.793
38.305
  • Europa Universalis IV
  • Hearts of Iron III
  • Semper Fi
  • 500k Club
  • Europa Universalis III: Collection
  • Europa Universalis IV: Pre-order
  • Hearts of Iron II: Beta
  • Europa Universalis: Rome Collectors Edition
  • Mount & Blade: Warband
  • Paradox Order
  • Hearts of Iron IV Sign-up
  • Hearts of Iron IV: Together for Victory
It is a scripting language. I can't tell you why Paradox decided to use it, ask them. And .lua files are lua script files. Kinda self-explanatory don't you think? ;)

http://en.wikipedia.org/wiki/Lua_(programming_language)

Pretty much the standard reasons you pick a scripting language. Letting modders have more control and do things you didn't anticipate in advance and speeding up development of certain stuff that requires quick iterations. Most games use some for of scripting language for AI or other things (Civ4 uses python heavily for example).

Lua is popular because it is pretty minimal feature wise, simple to learn for people with little programming experience and pretty fast for a scripting language (lua is about 20 times slower than compiled C++ code for pure calculations), but we still put most heavy calculations outside lua code (in C++) and export them for easy calling from lua to speed things up and still keep the moddability.

oh yeah and as johan said the quote in the first post is just your regular mindless forum drivel. When someone claims to know "secret" tricks to doing something and doesnt explain, or even hint at it, its usually just bollocks.
 

Kriegsspieler

Field Marshal
68 Badges
Feb 27, 2003
10.454
1.252
  • Europa Universalis IV
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Surviving Mars
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Battle for Bosporus
  • Hearts of Iron IV: No Step Back
Lua is popular because it is pretty minimal feature wise, simple to learn for people with little programming experience and pretty fast for a scripting language (lua is about 20 times slower than compiled C++ code for pure calculations), but we still put most heavy calculations outside lua code (in C++) and export them for easy calling from lua to speed things up and still keep the moddability.
Podcat, what I don't yet understand is how the adoption of Lua has changed the realtionship between "text" files and the game engine. In all earlier P'dox games, you had .txt files that provided data to the parts of the engine where the calculating work was done. Here, though, it seems that the relationship has changed, with more of the actual crunching being done in moddable portions of the game. Is that right?
 

Chaingun

Field Marshal
47 Badges
Jul 15, 2002
3.796
2.513
  • Knights of Honor
  • 500k Club
  • Europa Universalis III: Collection
  • Europa Universalis IV: El Dorado
  • Magicka: Wizard Wars Founder Wizard
  • Mount & Blade: Warband
  • Mount & Blade: With Fire and Sword
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Rights of Man
  • Steel Division: Normandy 44
  • War of the Vikings
  • Europa Universalis IV: Third Rome
  • BATTLETECH
  • Surviving Mars
  • Age of Wonders III
  • Europa Universalis IV: Rule Britannia
  • Europa Universalis IV: Dharma
  • Imperator: Rome Deluxe Edition
  • Imperator: Rome
  • Prison Architect
  • Imperator: Rome - Magna Graecia
  • Crusader Kings III
  • Europa Universalis III Complete
  • Europa Universalis III
  • Europa Universalis III: Chronicles
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • Hearts of Iron III
  • Heir to the Throne
  • Crusader Kings II
  • Magicka
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Rome Gold
  • Supreme Ruler 2020
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
Podcat, what I don't yet understand is how the adoption of Lua has changed the realtionship between "text" files and the game engine. In all earlier P'dox games, you had .txt files that provided data to the parts of the engine where the calculating work was done. Here, though, it seems that the relationship has changed, with more of the actual crunching being done in moddable portions of the game. Is that right?

Yes, pretty much. When done right it should still only be an insignificant part of the execution time.

There's an old saying that 10% of the code accounts for 90% of the execution time. Most time will be spent inside inner loops, and if those loops are implemented in C++ and exported as functions to Lua, performance will not be hurt by much.

I think there was great pressure to get this game to market and LUA was choosen because of the ease to implement it quickly. It wasn't a practical choice. LUA has never been used in a ANY game for beyond simple configuration (WOW) simple pathfinding (Shooters) and simple NPC control (Baldur's gate- which BTW had horrible results

My favourite counter example here is Dawn of War 1, where the entire AI was written in Lua. As a result, modders could improve it to almost play as well as an experienced human. (The original unmodded AI was pretty lame.)

Also weird he mentions pathfinding because that's something you'd not put in Lua if you want performance.

Aside from that, the rest of his text is bull.
 
Last edited:

podcat

Game Director
Paradox Staff
12 Badges
Jul 23, 2007
12.793
38.305
  • Europa Universalis IV
  • Hearts of Iron III
  • Semper Fi
  • 500k Club
  • Europa Universalis III: Collection
  • Europa Universalis IV: Pre-order
  • Hearts of Iron II: Beta
  • Europa Universalis: Rome Collectors Edition
  • Mount & Blade: Warband
  • Paradox Order
  • Hearts of Iron IV Sign-up
  • Hearts of Iron IV: Together for Victory
means Moon on portuguese :D

yeah it was developed by some brazilians.

Podcat, what I don't yet understand is how the adoption of Lua has changed the realtionship between "text" files and the game engine. In all earlier P'dox games, you had .txt files that provided data to the parts of the engine where the calculating work was done. Here, though, it seems that the relationship has changed, with more of the actual crunching being done in moddable portions of the game. Is that right?

pretty much yeah. The history files with triggers we used for most stuff, and still do is pretty much a declarative scripting language itself, so the difference is really just syntax and how powerful/flexible the language is.
 

unmerged(148805)

First Lieutenant
8 Badges
Aug 6, 2009
253
0
  • Hearts of Iron II: Armageddon
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Semper Fi
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
For the record, Eagle Dynamics uses LUA to great effect in it's flight sims Lock On, it's expansion pack and a follow up product concentrating on the Ka-50 attack helicopter (Black Shark).

The latter is THE most complex and realistic flight sim I have ever come across with regard to flight model and dynamics. LUA causes no performance issues there and I seriously doubt that its responsible for any performance issues in HOI3 either.