Adding mod support to your Unreal Engine 4 project

Hi guys!

For the early adopters of modding with ue4 I’ve set up the first basic sample project, freely available on github to tinker with and use as a reference for your own projects.

&stc=1

Guide: Modding Support on WIKI

It’s a very basic example of how you could cook and load a user mod into your game and is intended for early adopters. The pipeline is still a work in progress and some of the pain points you might experience now will be improved upon (that is one the reasons this project was set up)

Cheers!

Tom

Mod tools hype!

What does this mean for game creators who would like to bundle the editor with their game (to allow their players to make custom maps)? Will there be a guide on this too?

I almost done these steps some time ago. But the real problem is that you need “ModName” to your Plugins folder to let the engine correct recognize the /ModName/ path and must put ModName.uplugin in the “ModName” folder.
It almost unusable without knowning the ModName.
It is not so easy without modifying the cook code in the UE4 to make it work perfectly /Game/ or /Engine/ path.

There is another annoying problem.
If you put “MyFirstMod” to Plugins directory. Then you will unable to compile your Project C++ Source Codes.

You don’t need to bundle the editor with the game, the project files to mod the game + an editor download through the UE4 launcher would be a lot easier on your end. The pipeline for this is all new though so a lot of this still needs to be figured out. That’s part of what I am doing right now, building mods to discover the issues and looking for ways to improve the pipeline.

I’ll need to check this out… I’m adding mods to the Survival game (GitHub - tomlooman/EpicSurvivalGame: Third-person Survival Game for Unreal Engine (Sample Project)) on GitHub next week so I might run into the same issues you’re having. What kind of errors are you running into?

it would be good to see what is the final aim of this modding feature set. I mean, I can think of 2 main possibilities:

  • a limited custom map with custom rules mode (as I see rather this one),
  • overall game modding, where a game mod can be selected on game start up, and it can extend or overwrite original game rules and assets (in several strategy games, the original pak content is used by default, except if similar named asset is found in the actual mod folder).
    I hope the 2nd could be also possible, as I’m working on a strategy game, with modding features in mind…

What really interests me is configuring game-specific assets which are necessary to maps in a way that the end-user can place them and set the relevant values without sticking their hands into the blueprint guts in a way that would break everything.

Like a “read-only” blueprint which can be placed in a map and for which certain variables can be edited but whose graph is inaccessible, as a way of supplying useful content for user-made levels.

Not that you would want to prevent the user from making more complex assets but to have “factory content” for mods of your game would be nice.

will be watching this, thanks.

Still curious about being able to host a mod on a dedicated server, and if a client connects and does not have it, it get’s downloaded.

I’d like to figure that out. I can remember a system from UE3 where custom map content could be downloaded at load-time but have not looked into support for this in UE4 yet.

  • Tom

I will certainly be racking my brain on it as well, as I don’t like the ‘go to steam workshop and download a mod’ silly stuff.

I am guessing that with the new plugin system perahps it can be done there rather than modifying the engine? Seems like (famous last words eh?) it would be somewhat easy… client connects, gets’ info on what map/mod server is playing, sends back either an OK we have it, or nope, need it, server looks up settings for locations and sends to client that connects to preset site (redirect) and downloads… when done, let’s server know all ready. Or something like that.

There is a problem when you put a map in your Plugin Content Folder. Then it will only package maps and their related referenced assets.
You will be unable to package other assets without referenced by the maps in your plugin.

If you put no map in your plugin, it will be Ok. Other assets will be normally packaged.
But your dlc is in Plugin\YourMod Directory. You need put .uplugin into your packaged game folder(For example, your game folder is “D:\Packages\AsyncLoadAsset\WindowsNoEditor\MyGame”, then you need put your DLC’s YourDLC.uplugin into “D:\Packages\AsyncLoadAsset\WindowsNoEditor\MyGame\Plugins\YourDLC\YourDLC.uplugin”). So you can load dlc’s asset directory by using /YourDLC/DirInDLC/AssetName . If not, you will find that you are hard to load the assets of your DLC.

So Unreal Tournament changed the UE4 source code so that it package the DLC assets into paks that can be loaded assets like /Game/SomeDirectory/AssetName. It will be very easy to load the assets.

The plugins based DLC Mod support is not well designed. It is hard to use. So Epic don’t mention it loudly.

Ok, I did not mean maps as the plugin, I meant a plugin that does that checking as mentioned, then if missing pulls the redirect from the server and goes there and downloads the needed asset.

Have a look at the Ark dev kit to accomplish the second, I believe it does what you are looking for. With a bit of back-end management for replication and key mapping, I’ve managed a similar system using blueprint object/component classes and maps.
It’s a tad tedious to setup at first, but it’s really simple to overwrite/add content and remove original content without touching blueprint files.

Thanks you a lot!

UT4 is doing this. The mod system is implemented and download of map also. Might be a good starting point (if you are the right to use this as the EULA is clearly restricted on this code part)

Of course, if you open your game to mods, right now, looks like you can mod anything. I don’t mind them messing with the UI, but there are things I don’t want modded.
Which means, of course, trying to find a way to limit what the game accepts from the mod section. Interesting challenge!
Have to think about this. Thank you for your guidance, Tom.

Forgive me for not reading anything in here and in the tutorial. But this is an important question:

Will the end user be able to build mods for my game without him having access to the original project files?
Because this is the whole point of it right?

You won’t include all of your (C++) source files. And content that is provided to the mod creators will not include the “Source content” meaning the PNGs, FBX files etc. that are normally stored inside .uasset files (this should get removed during the Cooking process) but all .uasset files should be shipped to a mod creator so he can extend the game. So the answer is two folded. No, they don’t have full access to the “original” content because a lot should be stripped away as mentioned before. But…Yes, they will need project files in order to mod anything at all.

I know when you pack the game and uncheck “pack is *.pak file” you will still see all the uasset files in the packed game but you can’t do anything with them if you try to copy them to your own project ( they just won’t appear ). So I guess this is the same? Because if not, having the uasset files accessable is just like shipping it with the files separately, because anything can be exported via unreal editor to external fbx, png etc… files.