Implement a Paradox-style defines.lua system for editing engine variables
Posted: Wed Dec 11, 2024 8:43 pm
In Paradox games like Europa Universalis IV, the game has all in-engine variables stored in a file called defines.lua. In this file are all variables that are central to how the game operates, including variables that determine the aggressiveness of AI, the way that being ahead of time in technology affects technology cost, and the amount of money that AI players will keep in reserves at all times. Modders have the ability to write lua files that make changes to defines.lua before any other content in the game loads. https://eu4.paradoxwikis.com/Defines
In Factorio, there are certain hardcoded variables that modders have no way of changing, such as how quality affects machine speed and turret/enemy range, and how the maximum velocity of ships is calculated. There aren't as many hardcoded variables as in the typical Paradox game, but they still exist.
If Wube offered a predetermined defines list that mods would be able to modify, including currently hard-coded engine variables such as "quality-range-modifier" and "quality-speed-modifier", variables which would be non-performant to expose to the current modding API, that would greatly increase the number of tools available to modders. I'm sure the developers have a better idea of which in-engine variables would be suitable candidates to be exposed to modders.
One possible issue with doing this is two mods which modify the same define would conflict with each other if both of them make an absolute instead of relative change, but that problem already exists when modifying vanilla prototypes.
In Factorio, there are certain hardcoded variables that modders have no way of changing, such as how quality affects machine speed and turret/enemy range, and how the maximum velocity of ships is calculated. There aren't as many hardcoded variables as in the typical Paradox game, but they still exist.
If Wube offered a predetermined defines list that mods would be able to modify, including currently hard-coded engine variables such as "quality-range-modifier" and "quality-speed-modifier", variables which would be non-performant to expose to the current modding API, that would greatly increase the number of tools available to modders. I'm sure the developers have a better idea of which in-engine variables would be suitable candidates to be exposed to modders.
One possible issue with doing this is two mods which modify the same define would conflict with each other if both of them make an absolute instead of relative change, but that problem already exists when modifying vanilla prototypes.