Where to Inject Custom Engine Versioning?

While I’m looking for the best way to do this as well, I can give you some insight:

ObjectVersion.h is used to version your data formats. As you can see Epic adds a new enum each time they change the format, so that serialization code can handle each version differently. You can look for checks against Ar.UE4Ver() in the code how that’s made.

To avoid conflicts with Epic’s versioning when you change the serialization of your own data, you use the VER_LIC_ enums instead, and check the corresponding property Ar.LicenseeUE4Ver() when serializing.

So, the data serialization is related to the editor version, but it’s not the same thing. You would expect the Version.h to change whenever ObjectVersion.h changes, but the reverse is not required.

Version.h would be the place to modify, as far as I can tell. Set ENGINE_IS_LICENSEE_VERSION to 1, change the branch name to whatever suits you, and check that into your own repo. The binary build comes with BUILT_FROM_CHANGELIST set to the actual Perforce change list of the build, so I assume this is something Epic modifies at build time, but never checks into the depot.

The UnrealVersionSelector maps a GUID to an Engine folder. There’s no way, that I can see, to get it to use the actual version of your local build, it will always generate a GUID if the folder has not been registered before. You can, however, modify the registry (PC) or Install.ini-file (Mac), replacing the GUID with the version specifier of your liking, but everyone on your team has to manually set this up, and the first one will have to re-save the .uproject file with the new reference name.

/axl