Hot reload failing with custom gameplay modules

Hi,

So, we have added a gameplay module to the Shooter Game demo under the Source directory. The directory structure looks like so:

UnrealEngine
ShooterGame
Source
ShooterGame
TestModule (our custom module)

When making changes to, say, ShooterCharacter.cpp, the editor fails to hot reload ShooterGame-[suffix].dll because it is trying to load TestModule-[suffix].dll. The latter wasn’t actually built and only TestModule.dll actually exists.

Any ideas what may be wrong here?

Thanks,
Benny

Yes. ShooterGame.uproject looks like this:

{
	"FileVersion": 3,
	"EngineAssociation": "",
	"Category": "Samples",
	"Description": "",
	"Modules": [
		{
			"Name": "ShooterGame",
			"Type": "Runtime",
			"LoadingPhase": "Default",
			"AdditionalDependencies": [
				"Engine",
				"CoreUObject",
				"UMG",
				"RobotCore",
				"RobotObjective"
			]
		},
		{
			"Name": "ShooterGameLoadingScreen",
			"Type": "Runtime",
			"LoadingPhase": "PreLoadingScreen"
		},
		{
			"Name": "RobotCore",
			"Type": "Runtime",
			"LoadingPhase": "Default"
		},
...
}

Sorry, copy/paste error. It’s in there like so:

	{
		"Name": "TestModule",
		"Type": "Runtime",
		"LoadingPhase": "Default"
	},

Any suggestions on things we may try?

Should TestModule.dll have a suffix when making changes to ShooterCharacter.cpp?

You added module to uproject file?

So wheres TestModule?

Hmm ok, hot reload is known to be buggy sometimes as not whole engine code is used to module hot swapping, but if this is reproducible it should be reported. So i move this to Bug Raport.

Considering not much people add extra modules and plugins dont support hot reloading at all, i can see how this could slip in so far. I think code rebuild be good solution for now.

Most basic solution is to not use hot reload at all. if it’s bug noting can be helped other then fixing a bug and by look of it it’s bug as you correctly registered module and engine should expect yet it incorrectly reload the modules. Again hot reload is not perfect, sometimes if you notice strange behavior, you need to restart the engine.

UBT and any other software can’t modify dll that is running it’s locked by OS, that why it builds seperate dll with random number surffix and when it is done tells engine to swap the modules.