Upgrading editor caused .uassets to not load

Yikes! the Unreal Editor doesn’t see my content assets anymore within the content browser. If I look within windows explorer, the .uassets are still there.

Here’s what happened:

  1. I downloaded the 4.7.0 engine source code back when it was released in March.
  2. I then switched to the “master” version of the engine source, which was still 4.7.0, but had a few more bleeding edge updates. One of those updates changed the “version.h” file so that the engine was 4.8.0. Okay cool, no big deal…
  3. I stopped updating my editor version, so 4.7.1-3 were released later.
  4. Yesterday, I decided to upgrade my editor to 4.7.3 and I downloaded the latest source files from the “Release” branch and built it.
  5. I add in my engine mods (because I don’t quite know the right process for creating a pull request on github) and recompile the engine. No issues.
  6. I change my games uproject file to point to the new version of the compiled engine, which is now 4.7.3
  7. I try to open my game, but the editor complains that all of my uassets were created in a newer version of the engine, so are not compatible with this older version. Okay, fine. So I go back into the source code and change the version.h file to 4.8.0, recompile and retry.
  8. The editor still thinks my assets are newer than my current engine version.

How do I get all of my .uassets back into my game? how do I get my editor version to match or exceed the internal version number of the uasset?

I’m really hoping I don’t need to go into each .uasset via a hex editor and manually change the internal version number by finding its byte.

Alright, I’ve managed to fix 95% of my issues.

Here’s what to look for:
Within the visual studio output log, look at the “debug” output. Copy and paste this info to an external text document, because UE4 will open and close threads which cause your scroll position to reset to the bottom. Within the output log, look for something that looks like this:

[FONT=Lucida Console][2015.04.02-22.49.03:344] 0]LogLinker:Warning: Unable to load package (…/…/…/…/…/…/Unreal Projects/MageMaster2/Content/Assets/GameData/Skills.uasset) PackageVersion 439, MaxExpected 434 : LicenseePackageVersion 0, MaxExpected 0.
[2015.04.02-22.49.03:345] 0]LogLinker:Warning: The file ‘…/…/…/…/…/…/Unreal Projects/MageMaster2/Content/Assets/GameData/Skills.uasset’ contains unrecognizable data, check that it is of the expected type.
[2015.04.02-22.49.03:345] 0]LogUObjectGlobals:Warning: Failed to find object ‘DataTable /Game/Assets/GameData/Skills.Skills’
CDO Constructor (MageMaster2Instance): Failed to find /Game/Assets/GameData/Skills
[2015.04.02-22.49.03:345] 0]Error: CDO Constructor (MageMaster2Instance): Failed to find /Game/Assets/GameData/Skills

If you’re lucky, you’ll get these warnings. What’s happening behind the scenes?

When the unreal editor launches for the first time, it will go through your games content directory and try to load all of the uasset files. As a part of this loading process, it will try to verify that the uasset file package was created with an editor build which is within the max expected value. In my case, my files had tags within the binary which said “439” and the editors maximum file version was “434”, so the files were newer than the editor, so the linker loader skipped loading these files. In other words, if you create an asset in UE 4.7.0 and then send that to someone using UE 4.6.1, they won’t be able to load it.

For those of you who are really curious, this is done in “LinkerLoad.cpp” at line 911:



// Don't load packages that were saved with package version newer than the current one.
if( (Summary.GetFileVersionUE4() > GPackageFileUE4Version) || (Summary.GetFileVersionLicenseeUE4() > GPackageFileLicenseeUE4Version) )
{
	UE_LOG(LogLinker, Warning, TEXT("Unable to load package (%s) PackageVersion %i, MaxExpected %i : LicenseePackageVersion %i, MaxExpected %i."), *Filename, Summary.GetFileVersionUE4(), GPackageFileUE4Version, Summary.GetFileVersionLicenseeUE4(), GPackageFileLicenseeUE4Version );
	return LINKER_Failed;
}


The fix isn’t as straight forward as you’d think.

I found that the “MaxExpected” value was being pulled from “ObjectVersion.h”. There is a great big enumeration of version values which is used internally to track engine changes. The last enum value is used as an automatic versioning number. I initially tried to manually set the last values to a hard coded version number (439) to act as a temporary but dirty hack so that my game assets would get loaded by the linker. Surprisingly, this didn’t work. What did work was going to the github source, finding the latest “ObjectVersion.h” file, and manually copy/pasting some of the latest entries into the enum file. I added about 20 more entries here, and this pushed the “MaxExpected” value beyond 439 and all of my assets loaded properly (except for the levels). The thing to watch out for will be synchronizing to future version updates.