Diffing Unreal AssetsMichael Noland on | Tags featureslearningtutorials
So, source control is awesome, and you should be using it! One of the benefits of source control is being able to look at previous versions of files and compare or ‘diff’ them to see how things have changed. However, regular diff tools don’t work very well on binary files like Unreal .uasset packages. We’ve got you covered with support for exporting a text version of assets that can be diffed using your preferred tool, as well as a built-in specialized diff tool for Blueprints.
You’ll need to store your project in a supported source control system for the built-in tools to work. The editor currently has source control plugins for both Perforce and SVN. Perforce is what we use internally at Epic, and it is now free for up to 20 users (and 20 workspaces; you’ll probably end up using 2 or 3 per human user). SVN is totally free and there are a number of cloud SVN providers if you don’t want to host your own server.
Note: SVN binaries were not included in the 4.0 release, check out this thread for more details
You can tell if your editor is currently connected to source control by the little icon on the top right of the main frame, next to the [Enter console command] prompt. If the icon is green, you are already connected, but if it shows up as a red no sign then click on it to enter your server settings.
Next, you need to tell the editor where it can find your favorite text diff tool in Editor Preferences. It defaults to p4merge, but almost any diff tool should work (e.g., Beyond Compare, Araxis Merge, Tortoise Merge, etc…)
Once you are connected, you’ll see additional options in the context menu for Assets, such as ‘Check Out’, ‘History’, and ‘Diff Against Depot’. Any asset can be diffed, and the default handler will export the asset to a readable text format and launch your preferred text diffing tool (some assets have a more sophisticated viewer). Comparing your current version against depot before checking in is a useful habit to form; it will help you write better checkin comments and can also help catch changes you made to test something but didn’t intend to keep.
History gives you a full list of the previous checkins and their descriptions, and you can diff any two arbitrary revisions from the history window (select two revisions and right-click). This can be extremely useful when trying to track down a regression (be kind to future you and write good checkin comments).
Blueprints are a much more visual medium and a textual diff wouldn’t be very helpful. The editor has a built-in diffing tool for blueprints where you can look at differences in each graph or diff the default values. We’ll talk about this in more detail in a future blog post, but here’s a picture of the tool:
Do you have more questions about diffing Unreal assets? I’m over on Twitter at @joatski or head over to our forums!