TS4 XML Compare - Version 1.3.21

SCREENSHOTS
Downloaded 8,793 times 272 Thanks 93 Favourited 39,102 Views
 Say Thanks!
February 06, 2020 - Scumbumbo has passed on but his work and memories are still being kept alive by many of those whose lives he has touched. To download fixes for his mods, please check https://scumbumbomods.com/ and please direct any questions or concerns to the discord channel linked there.
Picked Upload!   This is a picked upload! It showcases some of the best talent and creativity available on MTS and in the community.
Uploaded: 16th Jan 2016 at 8:55 PM
Updated: 7th Jul 2018 at 1:04 PM - New Higher Performance Version 1.3.21
Update to 1.3.21 (July 7, 2018) - Two noteworthy changes prompted me to release an update after all this time, and I expect folks will be happy with the changes:
  • Huge performance increase indexing the two game XML folders used for comparisons. Measurements averaged between 75-85% faster (e.g. 2.5 seconds vs. 19 seconds).
  • When matching XML files are not located in either one or both of the XML folders, instead of popping up a message box for each missing file a single dialog is presented at the end of the process.

Bugfix (February 9, 2016) - The program was not properly saving the path to WinMerge, or enabling the other program buttons once it was manually located. Both of these bugs have been corrected.

Description

This is probably one of my favorite modding utilities when it comes time to update mods for a new game version. This will compare the XML from two versions of the game easily so you can see what has changed from the old version to the new version. You will be able to easily see exactly which game XML tuning files have been updated and what those changes are - which can be a massive time saver and help to find any inconsistencies your mod may be causing (for instance, an EA update to a tuning file that doesn't affect gameplay for you because you don't have the expansion or game pack, so you wouldn't notice it otherwise).

The program launches the WinMerge program to make the comparisons, so you will need to install it from SourceForge in order to use this program. Some of the command line options for WinMerge have changed from older versions - this is written to be compatible with version 2.14.0.0 of WinMerge.

The program requires .NET Framework 4 to be installed, which you likely already have. This can be installed from Microsoft's web site.

There is no installation program, this is just an EXE file, so you can place it anywhere on your system, create a shortcut to it, etc.

Usage

Read the Very Important Safety Tip from the outdated thread where this program was originally available before actually using this. Seriously read it!

You need to have your game XML extracts stored sensibly in separate folders for each game version. For instance:


The program will find WinMerge automatically when it is first started if the program is installed to the WinMerge folder of your Program Files. If it is not found, you will need to click the Browse button to locate it. The path will be stored for future use.

Next, set the old and new folders in the TS4 XML Extract Folders by clicking the browse buttons next to the respective entries. These folders will also be saved. All of the files in these folders and their subfolders will be indexed (in memory only, nothing is saved) for search speed. This indexing can take a few moments, particularly if you have a slower system.

For instance, if you look at the screenshot for the program you will see I am currently comparing the "2015-09-24" game version to the "2016-01-07" version.

Finally you can select the XML files you want to compare. Click the Browse button next to the Your XML File field, or drag and drop files from a Windows file Explorer window to the box. The files you want to compare are the ones from YOUR MOD. These files aren't even opened, it's just looking for all the filenames so it knows what to search for in your XML extracts.

So for instance, if I'm wanting to update Faster Gardening, I'll open up the folder I store all my XML for that mod in Windows Explorer and drag and drop all my XML files into the Your XML File box. The program would then know to compare all of the XML files used in Faster Gardening from the "2015-09-24" game version to those for "2016-01-07".

Again, it doesn't compare my mod to the existing XML (although you can set that up, more on that later) it compares the game's XML so I can see what EA has changed between the two game versions.

Once everything is filled in, you should be able to click Launch WinMerge. A new WinMerge window will open up for each comparison and if the files are identical (EA didn't change the XML) then it will close immediately. If any WinMerge windows remain open when the process is done, all changes will be highlighted - the old XML on the left, and the new XML on the right, like so:


You can now see exactly which file(s) need to be updated and precisely what has been changed - which can be a massive time saver and help to find any inconsistencies your mod may be causing (for instance, an EA update to a tuning file that doesn't affect gameplay for you because you don't have the expansion or game pack, so you wouldn't notice it otherwise).

Read the Very Important Safety Tip from the outdated thread where this program was originally available. Seriously read it!

Advanced Usage

You will want to set some options in WinMerge the first time you use this to make comparisons work more smoothly. I suggest the following, I'm not sure what the installed defaults are any more, so I'll highlight all of the options that really make a difference:
  • General
    • "Allow only one instance to run" should be OFF
  • Compare
    • "Whitespace" should be set to IGNORE ALL
    • "Ignore blank lines" should be ON
    • "Ignore case" should be ON
    • "Ignore carriage return differences" optionally on
    • "Enable moved block detection" should be ON
    • "Match similar lines" should be OFF
  • Any other options can be set as desired

Back to the compare program itself: the "Open all files in one instance of WinMerge" option can be used with care. This will make WinMerge compare all the files in tabs in a single WinMerge window rather than opening a separate window for each file. But and this is a BIG but -- WinMerge will not work properly if you are comparing a large number of files. I don't know the limit exactly, five or ten files are probably safe. I just leave the option off always and unless you've only got small mods you should probably do the same!

Another use of the program which can be handy is to compare YOUR mod's XML to that of a specific game version. If major changes are made to a game version and you have many files to update, fixing each one repeatedly can be extremely time consuming. The process here is as follows:
  1. For the OLD folder, use the game's XML folder for the comparison.
  2. For the NEW folder, use the folder you are storing your mod's XML files in. This may seem backwards, but this is because we want to...
  3. Turn off the "Read Only Right Side" checkmark. This will allow you to easily merge changes from the left pane (EA's files) into your XML files on the right side of the WinMerge window.
  4. Set the files for the comparison in the Your XML File field.
  5. Launch WinMerge, you should see a window(s) like this one. Notice there is a big chunk of code that needs to be added to the right-hand side to make the XML compatible with the current game.
  6. Since the right side is no longer Read Only, you can simply right click the highlighted text in the left pane and choose the "Copy to Right" option. This will merge those lines into your XML file, which can now be saved.
  7. Rinse and repeat, and use the time saved to do something in real life!
  8. Note that the "Read Only Right Side" option is NOT saved and will always be turned back on when you start the program. This is to ensure that you don't accidentally change your extracted XML files in a WinMerge window.

Additional Credits

Thanks to the makers of the WinMerge program! It's open source, so there would be far too many to name here, but thanks to all of you!

Also, thanks to everyone who has tested and suggested improvements for earlier versions of this program.