Dominions 5

Dominions 5

Honor Jan 31, 2019 @ 8:53am
Detecting mod conflicts
Is there an easy way to see if the mods I play with are conflicting with each other? If not, what would one have to do to create a program that automatically detects conflicts? As in which files to look in and what kind of strings to look for in those files...
< >
Showing 1-8 of 8 comments
ÆtherNomad Jan 31, 2019 @ 10:42am 
Some conflicts can be automatically detected, but not all of them; they are in fact, by very, very far, the minority. People often forget that there are several kinds and sources of incompatibility.

The easiest thing to detect and to fix is ID conflicts. I think that some automated programs for that already exist, but I can't help you more than that to find them, sadly. Still, even by hand that kind of conflict is neither difficult nor long to fix.

But most of the time, especially with big mods and mods that modify vanilla things (instead of just adding new things), other much more insidious and hard (or even impossible) to fix kinds of conflicts can arise.

For example, two mods like Dominions Enhanced and Hellenika can both attempt in a different way to rebalance some vanilla things such as pretenders. It means that these mods will NEVER be compatible, whatever you do, because they modify the same things (for example pretenders) in different ways. If for example one of them gives a given pretender an additional path and the other one makes that pretender much cheaper, the combination of both is a detrimentally excessive buff; in other cases, some abilities can enter in contradiction or cancel each other out. Making such mods compatible with each other is absolutely impossible to automatize; a conscious game design decision is required from the person that works on making them compatible. It is necessary to choose what you want to keep and what you want to change.

And lots of other balance problems can arise, some even harder to detect, for example if one mod adds a new spell accessible to all nations and that this spell interacts in a broken way with a nation added by another mod. It is very important here to note that the problem isn't just about balance, but about the intention of the authors. For example, I created the nation Karanaac with the clear intention of making it unable to pick monster expander pretenders without suffering huge drawbacks. This isn't just a question of balance, it also completely alters the nation's playstyle. Therefore, if a mod like Dominions Enhanced adds a monster expander pretender and that it is by default accessible to Karanaac, this will stealthily but utterly break the nation, not only balance-wise, but also when it comes to its intended playstyle. As another example, in the first mod a nation could be intended to receive a vanilla item or monster or spell, but the second mod might completely change how this item, monster or spell works, and there is no obvious way to see that it's a problem just by checking the mod files.

But even when leaving balance aside completely, other very insidious incompatibilities are frequent. For example, montags, restricted items and forbidden spells are a HUGE source of conflicts, because all involve modding commands that can only be used ONCE per monster/item/spell. Thus, if for example a given monster must be able to use a given restricted item from mod A and also a restricted item from mod B, and if the first restricted item must be usable by lots of other monsters while the second one must not, then it is purely and simply IMPOSSIBLE to make these mods compatible. Again, whatever you do, you WILL have to choose what you keep and delete the rest. This kind of incompatibility is MUCH more common than most people think.

Yet another kind of incompatibility can arise when two mods use the same name for different monsters/spells/items/sites. Sometimes, this can't be fixed without changing the names completely, as there are modding commands that do not accept IDs as their arguments.

I can't even begin to make an exhaustive list of possible conflicts, what I just described is only the beginning. Most of the time it's simply impossible to automatize the compatibility process because what defines an incompatibility is the author's intention. Sometimes, mechanics that we would usually consider as incompatibilities when they arise from two separate mods are in fact used INTENTIONALLY within a given mod to obtain a certain effect. Thus, a conscious mind must be there to decide what is good to keep and what isn't.

Another issue is that not all interactions between mods are bad. Some are actually good and you WANT them. For example, in Hellenika, nearly ALL female monsters received the ability to use a special category of items, then defined as female-only items. But if you combine Hellenika with another mod, female monsters from that mod won't automatically receive that ability. You will have to add it manually. It is an interaction that you WANT, not one that must be avoided; but if someone made a mod with the intention of it being compatible with Hellenika and thus using the same modding command on all of its own female monsters, then an automated program would detect an incompatibility, while in fact there is none.

And I haven't even yet spoken about events. Events can be a HUGE source of incompatibilities, but I won't detail that here because it would get extremely complicated very quickly, and because there's A TON to say about it.

Also, other conflicts can arise from hard coded limits from the game. The game can only accept new monsters, items, spells, sites, events, etc, up to a certain limit. If two mods, when combined, go beyond that threshold, then they won't be compatible with each other and there's NOTHING you can do about it besides purely and simply deleting some monsters, items, spells, etc. In the very same way, mods can give new magic paths only to a limited number of monsters. Etc.

But by very far, the biggest problem for incompatibilities is how seemingly completely unrelated things can actually interact with each other in a completely game-breaking and entirely unexpected way. Yet another example (but that's a drop in the ocean): some commands like shrinkhp, growhp, xpshape, etc will become completely and utterly bugged if you displace even a single ID, even though they don't use IDs as their arguments. As another example, simply changing the ORDER in which monsters, spells, items or events appear in the mod files can have huge consequences (which can make it a real nightmare to work on compatibility between two mods: sometimes, fixing an issue just creates a new issue or makes another issue worse, and creative thinking is very much required in some cases to invent complicated work arounds that preserve both mechanics in their original state).

Some things here are very hard to predict or even remember, especially when events are involved; sometimes their interactions give rise to such incredibly broken and obviously unintended things that you could just as well consider that they make the game completely unplayable - except that they don't cause the game to actually crash, which means that detecting them is harder by several orders of magnitude. And again, it is impossible to determine automatically wether these interactions are intended or not. It might even be that a huge and obvious issue happens in game without its source being identifiable by anyone for a very long time, even with a very good understanding of modding mechanics. Ensuring compatibility between mods - especially big mods - is therefore an extremely complicated process, and it requires human intervention and good modding skills at nearly every stage.
Last edited by ÆtherNomad; Jan 31, 2019 @ 11:25am
Honor Feb 1, 2019 @ 4:12am 
ÆtherNomad, thank you for your response. I have been enjoying your mods - especially Hellenika.

I understand your very valid points. All that other stuff aside, though, I think it might be possible to write a simple algorithm to at least detect ID and name conflicts between two or more mods. The user might then decide to combine the mods together or delete items selectively. Is this feasible?

Another question is, if you were to undertake such a project, what would a list of priorities look like in terms of addressing what types of conflicts in what order?

As in:
1. detect ID conflicts
2. detect name conflicts
3. for mods that alter vanilla things, duplicate each altered object (pretender, nation, unit, etc) and delete the reference to the vanilla object.
4. ???

Modding standards could then be developed to further discourage conflicts and identify what comes from which mod inside the game, which is something I would appreciate as a player.

For example, when naming mod-added items, a 3-character mod handle at the start of every naming string could be added. For example, your nation U would become AEN: U, or Zun -> AEN: Zun, or Thalamanth -> AEN: Thalamanth. All your new spells would be named AEN: <spell name>, as well as all newly added units, pretenders, events, everything.
Last edited by Honor; Feb 1, 2019 @ 4:17am
ÆtherNomad Feb 1, 2019 @ 5:52pm 
Thanks, I'm glad you like my works :D

Yes, making a software that at the very least detects and fixes ID conflicts is very feasable. It MIGHT sometimes create new bugs, but most of the time it should work. As I said at the beginning of my previous answer, I think that such a software already exists somewhere, but I don't know where to find it. The easiest way might be to ask on the modding channel of Althaea's server, where I think I heard about it first.

Detecting and automatically fixing ID and name conflicts might be doable. However:
3. for mods that alter vanilla things, duplicate each altered object (pretender, nation, unit, etc) and delete the reference to the vanilla object.
This is something I would rather avoid. I think that such an automated task would cause bugs very frequently. Sometimes it is GOOD that two mods change the same monster and they don't really enter in conflict by doing so - mostly when both modify said monsters in very light ways. However, automatically warning the user that two mods modify the same monster (without attempting to fix it automatically) would be useful.

I am not sure of what else we could add to your list of automated fixes. In most cases, only detecting potential issues would be much better than attempting to automatically fix them. For example, an automated software could warn the user if some spell has two occurrences (with different values) of the #notfornation command. Same thing with #montag and #userestricteditem for a monster. But I would advice against attempting to fix these issues automatically; only a human could determine the right course of action in such cases, especially since work arounds might be necessary, and sometimes complicated by other parts of the involved mods.

Another thing that an automated software could do is automatically putting all sprites in a single folder and then automatically changing the sprite pathing everywhere in the merged mod.

About your last suggestion - in merged mods, that could be useful, yes. However, it's not something I would do, for example, in the main version of Hellenika: it would be immersion breaking and it would most of the time be useless (since Hellenika isn't intended to be used with other mods, unless they're very simple utility mods such as Rebirth or Omniscience).
Last edited by ÆtherNomad; Feb 1, 2019 @ 5:55pm
Red_Rob Feb 2, 2019 @ 2:09am 
There is already a tool that does some of what you are describing here:

http://dominionsmods.com/index.php?showtopic=3842

I haven't tried it myself, but the description suggests it has some of the features you are looking for.
gonadic io Jul 7, 2019 @ 1:35am 
I've spent a bit of time on this: https://github.com/djmcgill/domingler/
I already detect more than that Python script does because it doesn't consider #selectX commands.

I still hope to automate a lot of the remapping work, warning on vanilla collisions and changing names as discussed, leaving the user to make the design decision changes themselves.
Last edited by gonadic io; Jul 7, 2019 @ 1:35am
Captain Tofu Aug 5, 2019 @ 1:01pm 
Originally posted by gonadic io:
I've spent a bit of time on this: https://github.com/djmcgill/domingler/
I already detect more than that Python script does because it doesn't consider #selectX commands.

I still hope to automate a lot of the remapping work, warning on vanilla collisions and changing names as discussed, leaving the user to make the design decision changes themselves.

I am using domingler and it is very useful! Ingenious idea! Can you add a note about the domingler.dm modpacks it creates? Some mods seem to be included - factions / civilizations for example. Others are not, like visible sites or unlimited bodyguard mod. Right now I am trying to find out, which mods are 'missing' now by trial and error.
gonadic io Aug 16, 2019 @ 7:43am 
Originally posted by Captain Tofu:

I am using domingler and it is very useful! Ingenious idea! Can you add a note about the domingler.dm modpacks it creates? Some mods seem to be included - factions / civilizations for example. Others are not, like visible sites or unlimited bodyguard mod. Right now I am trying to find out, which mods are 'missing' now by trial and error.

Hi, only just saw your message. The intent is for all DM file mods to work, I will check out your examples and see why they aren't and hopefully fix it.
Note thst there are some limitations - that if the visible sites mod changes all vanilla sites, but then some mod nations are added, then their sites won't have the changes. Similarly, if one mod increases strength of giants and one mod decreases strength of giants it's not clear which one will take effect.
Captain Tofu Apr 19, 2020 @ 5:05am 
Originally posted by gonadic io:
Hi, only just saw your message. The intent is for all DM file mods to work, I will check out your examples and see why they aren't and hopefully fix it.
Note thst there are some limitations - that if the visible sites mod changes all vanilla sites, but then some mod nations are added, then their sites won't have the changes. Similarly, if one mod increases strength of giants and one mod decreases strength of giants it's not clear which one will take effect.
Have you found anything?
< >
Showing 1-8 of 8 comments
Per page: 1530 50