• 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.

BladeOfSharpness

Corporal
73 Badges
Jun 3, 2016
32
4
  • Victoria: Revolutions
  • Cities: Skylines - Snowfall
  • Stellaris: Synthetic Dawn
  • Cities: Skylines - After Dark
  • Pillars of Eternity
  • Europa Universalis IV: Pre-order
  • Warlock 2: Wrath of the Nagas
  • Warlock 2: The Exiled
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Supreme Ruler: Cold War
  • Sword of the Stars II
  • Semper Fi
  • Europa Universalis IV: Res Publica
  • Majesty 2 Collection
  • Magicka
  • Hearts of Iron III Collection
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II
  • 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 Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Lead and Gold
  • Steel Division: Normandy 44
  • Cities: Skylines - Mass Transit
  • Crusader Kings III
  • Hearts of Iron IV: Together for Victory
  • Cities: Skylines - Natural Disasters
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • BATTLETECH
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Common Sense
  • Mount & Blade: Warband
  • Magicka: Wizard Wars Founder Wizard
  • Europa Universalis IV: El Dorado
  • Cities: Skylines
  • Warlock: Master of the Arcane
  • Victoria 2
  • Teleglitch: Die More Edition
Stellaris modding is already rather powerful. It could have been better with a simple change.

The problem: you can't replace or edit an existing entry with another. Say I want the administration building to produce energy. If I want that, I must edit 00_buildings.txt. It means that I prevent any other mod from retouching this file. That's why we now have a lot of mods that are not compatible with one another.

There are two solutions to this problem. One is that Paradox does some extra coding so we can override an entry and that it replaces the original entry, without having to touch upon the vanilla file.

The other is less powerful and ask some discipline from modders, so is much more a work-around than a final solution. That would be to delete the entire content of a vanilla file, and produces child files each with a few entries (from the original file) in it. Taking the example of 00_buildings.txt, the planetary administration building exists no more in 00_buildings.txt you use in your mod (as the file is empty), but it is cited in say 00_AdminBuildings.txt. And if you want to edit it, then only administrative buildings are 'reserved' by your mod and others modders can touch on others buildings (if they respect the same convention!!).

As I said, it means all major modders switch to this system...If enough mods adopt that, then it can work and would result in much less mod incompatibility.
 
  • 3
  • 1
Reactions:
We'd basically have to break out all vanilla files into one-object-per-file.

The granularity would otherwise still lead to conflicts.

It's a major problem with modding this game. Personally: I think Stellaris / Clause game engine designers need to fix this. It's not a minor issue, and has plagued this system since day one (in all of Paradox's games that use this fundamental approach).

I assume there's some complexity in providing a fix from Paradox. Do you merge multiple references to the same object (I believe that's the current approach - based on the definitions .lua files), or do you overwrite an existing object definition entirely?

I would think both would be ideal to have as modders, though I could live with either (I think).
 
  • 2
  • 1
Reactions:
I'm all for easier modding. Wouldn't help me much due to my mass modding (balancing means doing lots of changes all over the place), but having means to do surgical changes while leaving the rest intact and available for other modders is a must. We have tons of mods and compatibility between them is a major issue.
 
Many will still be incompatible, though. If you take, say, the Beautiful Battles mod and any of the 5 or 6 weapons rebalance mods, then they're still altering the same values. Or my own mod and Foravens will never, ever be compatible with each other; or either of them with More Technologies. Not to mention the balance implications of attempting to run many of these at once.

Basically, you have 'additional content' mods, which add completely new stuff and don't need to impact on the base game files already, and then you have 'adjusted content' mods, which by definition will be extremely invasive, won't work with each other, and probably won't work correctly with any additional content mods designed and balanced around vanilla. If additional content is added to an adjusted content mod, then it needs to be reworked to fit with the new system anyway, and so should just be adopted into the rebalance mod as the basis of a working subsystem.

I don't really see how some kind of code injection system is likely to improve on this state of affairs, tbh.
 
  • 2
Reactions:
Adding a mod load order system could do a lot to alleviate this problem IMO. Basically each successive mod will overwrite conflicting changes made by the mod loaded before it. This system wouldn't magically solve all mod compatibility issues, but would make it much easier to make certain mods that might conflict in some (but not all) areas compatible with each other.

For example, ZBeautiful Battles and a weapon rebalance mod. By loading the weapon rebalance mod after ZBeautiful Battles, conflicting files will be resolved by using the weapon rebalance versions of them while leaving the non-conflicting files untouched. This, of course, assumes (and requires) an effort on the part of the modder to make his/her mod compatible with another specific mod.
 
  • 1
Reactions:
Is it certain that the simple filename ordering doesn't dictate ordering of mod files?

i.e. I notice that many/most of Pdx files are 00_xxxx.txt. That screams "load this first due to alphabetical ordering."
So, 01_xxxx.txt would be loaded after 00.xxxx.txt. If the game looked at a composite of all files in a given folder from all active mods (or builds a single file structure for all active mods during load time) then this approach can be made to work, maybe. Certainly, with no more / less effort than a mod-ordering tool would offer, but without the need for end-users to know anything...
 
  • 1
Reactions:
Is it certain that the simple filename ordering doesn't dictate ordering of mod files?

i.e. I notice that many/most of Pdx files are 00_xxxx.txt. That screams "load this first due to alphabetical ordering."
So, 01_xxxx.txt would be loaded after 00.xxxx.txt. If the game looked at a composite of all files in a given folder from all active mods (or builds a single file structure for all active mods during load time) then this approach can be made to work, maybe. Certainly, with no more / less effort than a mod-ordering tool would offer, but without the need for end-users to know anything...
I hadn't thought of that. If that works, then it would be a good tool for modders who want to ensure compatibility with a specific other mod. It could make it somewhat complicated though for the modder and cause mods not to work in some cases. e.g. if multiple mods use 01_ or 02_ it could cause unintended consequences.

However, that is a very interesting idea and I will try it out tonight with a test mod to see if it works.
 
I don't know the forum policy on posting again when you are the last poster. I consider a new post warranted because the content of this post differs significantly from the last post. However, if I am mistaken, please let me know and I will delete and edit as necessary.

@Mordachai So I have run some test with some very interesting results.

I ran my tests using a very simple edict mod. I created two mods that were very similar. Test Mod 1 gave you an edict that boosted your physics tile output by 100%. Test Mod 2 gave a similar edict that boosted by 50%. Localisation was slightly different so that the two could be told apart.

Renaming the file names from 00_ to 01_ or 02_ causes no negative effects. In fact, it might be good modding practice to name your files starting with 01_ because doing this makes the game load both the vanilla files and the mod files. Duplicating vanilla file names in your mod causes the game to ignore the vanilla files and load just your mod files. This would cut down on mod file size (a little bit) and also just makes for less hassle because there is no need to copy over the entire contents of the vanilla file into your mod.

I also learned some important info about how Stellaris handles mod load order. It appears that the game will attempt to merge (to the best of its ability) files that have different names but have conflicting content. e.g. with my edicts, keeping the file names different but having the edict names within the files be identical led to the game loading both edicts but only using the localisation for one. So having a higher numbered file name does not, according to my tests with edicts, mean that the higher file number will be loaded after the lower one and any conflicts overwritten.

However, there does appear to be a built in mod load order system in Stellaris. Stellaris seems to load its mods in reverse alphanumeric order, starting at the bottom of the list of selected mods in the launcher and progressing up. That means that my Test Mod 1 would be loaded after my Test Mod 2 because Test Mod 1 appears above Test Mod 2 in the launcher. I tested this by naming the edicts file of both mods the same thing and loading both of them. Test Mod 1 won every time. When I renamed Test Mod 2 to A Test Mod 2 (so that it was higher than Test Mod 1 in the launcher), A Test Mod 2 won.

While not as good as a dedicated mod load order tool that would allow us to specify exactly the order the mods should be loaded in, this is very important and useful information for modders. As a disclaimer, I only tested this with edicts because they were very easy to write. The results could be different and may not apply with other, and especially more complex, features.
 
  • 2
Reactions: