DBPF Compare is a utility for helping to identify the differences between two .package files.
Conventional applications such as Beyond Compare and WinDiff struggle with .package files as
a) the contents are binary not text,
b) the order of resources (BHAVs, BCONs, TXMTs, et al) within the .package file is not important, and
c) resources can be compressed in one file and not the other.
DBPF Compare understands the internal format of .package files and overcomes these peculiarities.
DBPF Compare can be used to answer questions such as
- What did I change between backup version X and Y?
- There are two places to download the same mod, but the .package files are different sizes, are there any real differences between the two download sites?
- These two mods are described as doing very similar things, but what exactly do they do differently?
- This translation I've been sent, did they really only edit the Text Resources?
DBPF Compare compares the uncompressed data for a resource at the byte level to decide if the two resources are different. It is still possible to create functionally identical resources that differ at the byte level. For example, reordering instructions within a BHAV does not (necessarily) change the functionality of the BHAV, the names of screne graph resources are case insensitive, and the order of entries in a TTAB is not significant. Additionally, CPF based resources can be stored in one of two formats (binary or XML), a functionally identical resource that changes formats between .package files will show as different. You will still have to apply your brain to the displayed results!!!
From the File menu, select "Select Left Package..." and choose a .package file. This is the readonly file we are working from, we can only copy resources from this file. For a backup pair, it would typically be the earlier file. For a translated/master pair, it would typically be the translated file.
From the File menu, select "Select Right Package..." and choose a .package file. This is the updateable file we are working towards, we can copy resources into this file. For a backup pair, it would typically be the later file. For a translated/master pair, it would typically be the master file.
Alternatively, drag-and-drop the .package files from Windows Explorer onto the left and right hand panes.
If you have the files the wrong way around, use the "Switch" icon to swap them around.
With both files loaded the utility displays a tree view of all the resources within each .package file, matched to their corresponding resource in the other .package file. Identical resources are shown in gray, resources only in one file and not the other in blue, and resources in both files that are different (at the byte level) are shown in red.
As we are typically only interested in differences, from the Options menu, select "Exclude Same".
To copy a resource in the "from" (left) file into the "to" (right) file, right-click the resource in the left pane (typically a blue resource) and select "Copy To Right".
As we have the "Exclude Same" option checked, this resource will "vanish" as it's now the same in both the left and right hand trees.
Uncheck the "Exclude Same" option to verify the resource is now in the right tree.
Then recheck the option.
Because we have changed the "to" (right) file, its path is now highlighted in pale red and the "Save" icon is enabled. As is the "Save Right Package" option on the "File" menu.
To copy all resources of one type that are in the left file but not the right, right-click the resource tag in the left tree and select "Copy All Missing To Right".
Again, they will "vanish" if you have the "Exclude Same" option checked.
For some resources (see list below) you can compare the differences by double-clicking a "red" resource. This will open a popup window with further details of the differences.
For string resources, a drop-down switches between languages.
The "Use Left" button copies the resources from the left package into the right package, while the "Keep Right" button removes the resource from the tree view.
Closing the application with unsave changes will propmt you.
Resources supported by "double-click compare"
- 3IDR
- AGED
- BCON
- BHAV
- GLOB
- NREF
- OBJD
- OBJf
- SLOT
- SHPE
- TXMT
- Simantics label resources: TPRP and TRCN
- STR based resources: CTSS, STR# and TTAs
- CPF based resources: BINX, COLL, GZPS, MMAT, SDNA, VERS, XFCH, XFLR, XFNC, XHTN, XMOL, XOBJ, XROF, XSTN, XTOL and XWNT
- Light resources: LAMB, LDIR, LPNT and LSPT
Reload Packages: Reloads the packages, useful if you've used SimPe to change one or other.
Select Left Package: Displays the Select Package dialog for the left/from pane.
Select Right Package: Displays the Select Package dialog for the right/to pane.
Save Right Package: Saves any changes to the right/to package file.
Configuration: Display the standard Sims2Tools configuration dialog; not needed by this utility.
Exit: Exit the utility; if there are unsaved changes a prompt appears.
Exclude Same: Excludes resources from the tree views that are identical at the (uncompressed) binary level, or have been marked by the user as being equivalent.
Exclude Left Only: Excludes resources that only appear in the left/from package file.
Exclude Right Only: Excludes resources that only appear in the right/to package file.
Auto-Backup: If checked, backup files are created before changes are saved.
- Alt+F - File menu
- Alt+H - Help menu
- Alt+M - Mode menu
- Alt+O - Options menu
- Alt+F4 - Exit
- Ctrl+R - Reload Packages
- Ctrl+S - Save Right Package
- F1 - Help (about)
Source code can be downloaded from GitHub
- Fixed issue with BHAV instructions incorrectly reporting the OpCode/Primitive
- Added support for diff'ing AGED resources.
- Added lights (LAMB, LDIR, LPNT, LSPT) to supported diff resources
- Added SHPE to supported diff resources
- Right-click context menu entries to select two different (but same type) resources to compare - for when the TGIR values are different but the resources were originally the same
- Mouse-over tooltip for BHAV diff gives node number
- Diff grid column widths saved
- Fixed bugs in BHAV compare.
- Added support for diff'ing NREF, GLOB, SLOT and 3IDR resources.
- Added support for diff'ing BHAVs.
- Added "Save As CSV" (on File menu) action.
- Can select two .package files in Windows Explorer and open both as one drag/drop action. Use the Switch icon if need be.
- Initial release
DBPF Compare compares the uncompressed data for a resource at the byte level to decide if the two resources are different. It is still possible to create functionally identical resources that differ at the byte level. For example, reordering instructions within a BHAV does not (necessarily) change the functionality of the BHAV, the names of screne graph resources are case insensitive, and the order of entries in a TTAB is not significant. Additionally, CPF based resources can be stored in one of two formats (binary or XML), a functionally identical resource that changes formats between .package files will show as different. You will still have to apply your brain to the displayed results!!!
This is a tool to assist in comparing two .package files. You still need to know what you are trying to achieve, why you are trying to do it, and if what the tool is showing you makes sense in that context. While you can drive-home a nail with a screwdriver ...
- Version 1.8 DbpfCompareV1.8.zip
- Version 1.6 DbpfCompareV1.6.zip