[TOOL] RimworldConflictFinder

Started by bobisback, May 16, 2016, 12:25:32 AM

Previous topic - Next topic

bobisback

Hello all,

Was putting together my first rimworld mod list the other day. Started it up yesterday looking to play some rimworld. Only to have it consistently crash every 10 mins or so. So I set out on a mission, the result: The RimworldConflictFinder.

So what does RimworldConflictFinder do you might ask? Well this program is a command line windows application that will compare xml defName of elements between files on a mod by mod basis.

This program is not for the faint of heart. I literally just wrote it in the last 3 hours or so of my life so do not expect much. Then I spend the other 3 hours doing what this program cannot do, aka get the conflicts resolved. So far though I had a bug free/crash free game thanks to the load order issues and conflict issues that where shown by this program.

So how to use this program?
1. Extract the exe out of the zip file and put it somewhere you can get to it.
2. Make a copy of your mods folder (Not needed but recommanded) and I would put it somewhere close to the exe in fact I recommend you put the mods folder in the same directory as the exe.
3. Open command prompt from the start menu. If on windows 10 hit windows key and type cmd then hit enter.
4. Navigate to the extracted exe in the cmd. aka type in 'cd C:\pathToExe' into the command prompt
5. Now in your cmd windows type 'RimworldConflictResolver C:\pathToCopiedModsFolder\Mods' Hit enter. If the mods folder is in the same directory as the exe you can use 'RimworldConflictResolver Mods'
6. Open the file called 'RimworldConflictResolver.txt' that was created in the same directory as your RimworldConflictResolver.exe. (I recommend notepad++, looks bad in just regular notepad)
7. Find the conflicts at the bottom of the txt document and decide what to do with them.

Things to note:
1. I have a ton of garbage in the file atm. This is the first version, most people will only be interested in the text below 'Checking for Conflicts' in the file that is generated.
2. This program will not resolve your conflicts for you. This program will only find them and tell you about them. Which tag in which files in which mods. You have to then decide if you want to remove the mod, change the load order and pray, or merge the files manually/create a patch for them.
3. This program will not check and assemblies for issues.
4. This program is wrong most of the time, I had about 60 mods with 80 or so conflicts according to this program. Really though 30 or 40 were really an issue. Aka if you have CombatRealism, ExpandedProsthetics&OrganEngineering, and CombatRealism EPOE installed it will find conflicts with all of them, but in this case these are needed conflicts. It is up to you to decide what to do with the conflicts and if they are really a issue or not.
5. I do some filtering on the names. If the two mods contain the same names I ignore them. Aka if the mod 'CombatRealism' is compared to the mod 'High Caliber (CombatRealism patch)' then it will ignore this as a conflict as I assume this is a patch. For this to work the names have to contain each other. You can manually rename the mod folders to take advantage of this. For example I renamed 'CombatRealism EPOE' to 'CombatRealism ExpandedProsthetics&OrganEngineering' so it will ignore these as a conflict.

This is a super early version with very little features. I would recommend people that are not familiar with command line and xml  to steer clear for the time being until I can get some more things worked out. I figured I would release it anyway to get some early feedback and to help those who like me are having a problem getting 60+ mods to work together. Turns out the vegetable garden was the problem mod for me, had like 40 conflicts just by itself haha.

Code: https://github.com/Bobisback/RimworldConflictResolver


[attachment deleted by admin - too old]

Fregrant

It works!    :)

[attachment deleted by admin - too old]

biship

#2
Nice, this works pretty well (and is much needed now that there are 1000+ mods on steam!)

Not sure this detection is correct tho:
Conflict found with xml tag Farming in the file Storytellers.xml in mod 672718181 and the file Prefixes.xml in mod RimWorld-Infused

672718181 - Storytellers.xml:
<StorytellerDefs>
   <StorytellerDef>
      <defName>Farming</defName>


RimWorld-Infused - Prefixes.xml
<Defs>
....
  <Infused.InfusionDef ParentName="PrefixRare">
    <defName>Farming</defName>


EDIT: Also, don't conflicts also only occur when property tags conflict?
ie In the vegetable garden mod, it has <defName>PlantHops</defName>, but none of its properties are in its 'conflict' CCL Vanilla Tweaks defName.

Also, it would be helpful if the log had full paths to make opening and inspecting easier.
ie
OLD
Conflict found with xml tag SoilTilled in the file Terrain_TilledSoil.xml in mod 706426033 and the file Terrain_TS.xml in mod 725747149

NEW
(heading 'Conflicts' - as you don't really need to write conflict for every conflict)
<line>   <parentdef>       <def>          <defName>       <filename>
5            TerrainDefs        TerrainDef      SoilTilled           D:\SteamLibrary\steamapps\workshop\content\294100\706426033\Defs\TerrainDefs\Terrain_TilledSoil.xml
35          TerrainDefs        TerrainDef      SoilTilled           D:\SteamLibrary\steamapps\workshop\content\294100\725747149\Defs\TerrainDefs\Terrain_TS.xml

Otherwise, this does exactly what I was going to try to code :)
Is the code anywhere? I can try to improve it if that's ok

bobisback

Here is the code: https://github.com/Bobisback/RimworldConflictResolver

Quote from: biship on August 06, 2016, 07:45:35 AM
Nice, this works pretty well (and is much needed now that there are 1000+ mods on steam!)

Not sure this detection is correct tho:
Conflict found with xml tag Farming in the file Storytellers.xml in mod 672718181 and the file Prefixes.xml in mod RimWorld-Infused

672718181 - Storytellers.xml:
<StorytellerDefs>
   <StorytellerDef>
      <defName>Farming</defName>


RimWorld-Infused - Prefixes.xml
<Defs>
....
  <Infused.InfusionDef ParentName="PrefixRare">
    <defName>Farming</defName>


So here is the deal. I originally had it check the tag before it would compare the defname. When I did this though it was missing some conflicts that were still happening. After some research (Been a long time, cannot remember where I got this info) I found that there were cases where the tags were different, but the defnames were the same, and this was causing issues in the game. The game I am pretty sure puts everything into a giant list irreverent of the tags that are associated with them. I could be wrong here but this is what i remember. You are welcome to change it.

Quote from: biship on August 06, 2016, 07:45:35 AMEDIT: Also, don't conflicts also only occur when property tags conflict?
ie In the vegetable garden mod, it has <defName>PlantHops</defName>, but none of its properties are in its 'conflict' CCL Vanilla Tweaks defName.

I do not compare any tags atm. (not that I remember anyway have not looked at the code in some time)

Ya how it outputs the information is a bit rough atm. I do not really have a ton of time atm, but you are welcome to play with it. I added you to the github repo.

Let me know if you have any questions.

See ya,
Bob

deliveryservice

"This is a super early version with very little features. I would recommend people that are not familiar with command line and xml  to steer clear for the time being until I can get some more things worked out. I figured I would release it anyway to get some early feedback and to help those who like me are having a problem getting 60+ mods to work together. Turns out the vegetable garden was the problem mod for me, had like 40 conflicts just by itself haha."

It appeared in mine Vegetable Garden Has Problems for evry plants it has if loaded in incorrect order in mod list. It is critical mod to have in my opinion :P

biship

Yeah, VG has about 8 conflicts...
Thanks bobisback. If I can get away from playing I'll hack up your code to see if I can get it to do some more checks. I'll have to create a few dummy mods to test what parts of the class/defname/tag conflict. Thanks!

SpaceDorf

W0000t ..
it worked.
awesome tool, with the best userinterface ever :)
Maxim 1   : Pillage, then burn
Maxim 37 : There is no overkill. There is only open fire and reload.
Rule 34 of Rimworld :There is a mod for that.
Avatar Made by Chickenplucker

Sacru

So, I am feeling a bit blind and stupid here, but I cannot find an .exe to extract?

Some help? as I am a bit of a mod addict and I'm running into some conflicts and just taking guesses at the load order is a bit risky.

This game needs some sort of mod manager with built in conflict detection etc etc.

edit: nevermind, i see it now, but i SWEAR that link was not there earlier....though I wasn't logged in, so that might be it?

SpaceDorf

yeap, that might be it.
though I am always on, so I can't really tell :P
Maxim 1   : Pillage, then burn
Maxim 37 : There is no overkill. There is only open fire and reload.
Rule 34 of Rimworld :There is a mod for that.
Avatar Made by Chickenplucker