I'd like to learn how to make a good modkit from scratch

I’ve spent the last few weeks looking for ways to add mod support to a single-user Unreal 5.2 application I’m working on, and while I did find a few example projects about the topic, none of them really explain how they managed to achieve that goal in detail.

Official UGC Example Project

There is of course the official UE4 UGC example project and plugin by Epic Games, which implement a workflow for creating and loading mods for an Unreal game based on the Robo Recall modkit, but it was never officially updated to Unreal Engine 5, which it fails to compile with. The amazing community members @Hellcat and @debellica have taken it upon themselves to make it compatible with Unreal 5.0 to 5.3 in their successive forks of the project (here and here), but at the time of writing the usage guide wasn’t yet updated to reflect Hellcat’s changes and in UE 5.2.1 the mod loading didn’t seem to work for me. Would’ve been a great reference, but unfortunately I have neither enough knowledge nor time on hand to start bugixing the project and updating its documentation.

modio Unreal plugin

Another neat project I found is modio’s Unreal plugin, whose source code is publicly available on GitHub. Among other things it features editor extensions for creating, packaging, and uploading mods, though I can’t seem to find the code that actually does that for some reason (I might just be to blind to see it), and even if I were to find it, there isn’t a guarantee that I could learn a whole lot from it because the plugin comes without any sort of explanation for how it works under the hood anyway, which is to be expected for a component of a commercial product.

Pak Patching

Last but not least I’ve stumbled across this concept called pak patching in which a mod author can add replace existing content in a base game with modded content by copying a pak file with modded content from one project’s packaged build over to another project’s packaged build and renaming it to end in _P.pak (it doesn’t matter what comes before it, only the ending is important). This will apply the modded pak file as a patch on top of the base game’s original pak file(s). I tried it and it seems to work well with both maps and assets. For this to work, both the original Unreal project and the one used to generate the pak patch need to have the same project name, and be packaged with the same minor Unreal Engine 5 version and the same packaging-related project settings. It is, however, not necessary for the Unreal project used to generate the patch pak file to contain all assets from the original Unreal project, which enables the creation of user-generated content for existing Unreal applications in what is basically empty project (this is how most modkits work).

I haven’t yet found a good way to add new maps to an existing game through pak patching. One that technically works but is problematic in practice is to create your pak patch by packaging a complete Unreal project (that’s what I do in the video tutorial above). That patch will contain a file called AssetRegistry.bin, which is necessary for making the base game aware of the new content, but it also contains the project settings of the Uneral project the custom content was created in, which will override the default game’s project settings and potentially cause all sorts of issues. The exact same thing happens if you package your game into different chunks and create a patch out of pakchunk0.pak, as that also contains both the AssetRegistry.bin and a Config folder.
If you package your custom content into pakcunks greater than 0, they will not contain a Config folder and therefore not override any project settings, but they will also be missing the AssetRegistry.bin file required for the addition of entirely new maps that weren’t in the base game to begin with.


Anyway, since I’m quite new to the topic it’s likely that I’m missing a crucial piece of information, which is why I wanted to ask you all if you have any more ideas or things I could check out.

1 Like