Modifying the Shooter template to include UE4 project in the solution

Hello,

I was really bothered by the fact that the default solution generated with the shooter template did not include the UE4 project. This does not make too much sense since the template is intended to be used by a C++ programmer. I found myself crippled by not being able to step into the engine code.

I found out that .uproject file contains the metadata to generate the solution.

The original uproject file looked like this:



{
	"FileVersion": 3,
	"Version": 0,
	"VersionName": "0.0",
	"EngineVersion": "4.1.0-2053896+++depot+UE4-Releases+4.1",
	"PackageFileUE4Version": 352,
	"PackageFileLicenseeUE4Version": 0,
	"EngineAssociation": "4.1",
	"FriendlyName": "",
	"Description": "",
	"Category": "Sample Games",
	"CreatedBy": "",
	"CreatedByURL": "",
	"Modules": 
		{
			"Name": "ShooterGame",
			"Type": "Runtime",
			"LoadingPhase": "Default"
		},
		{
			"Name": "ShooterGameLoadingScreen",
			"Type": "Runtime",
			"LoadingPhase": "PreLoadingScreen"
		}
	],
	"EpicSampleNameHash": "3868556100"
}


The 2 properties of interest are EngineVersion and EngineAssociation. If you look at any of the uprojects generated by the engine you have compiled will have different values for these properties.

So if you want the shooter template to use the engine code you have compiled modify these properties to match the version and GUID you have.

In my case the EngineVersion turned out to be 4.1.0-0+UE4. I assume that the EngineAssociation is a randomly generated GUID.

If there is a better version of doing this please let me know. If not I hope this information proves to be useful for others.

Thanks,
-Yenal

As far as I know, you have to compile the engine separately from the project. I don’t think it’s (easily) possible to combine them. (That’s what you wanted to do, right?)

Yes you compile the engine first. What I did is to put the shooter project into the same solution with the engine project. This is what happens anyway if you compile the engine from source and use that engine to generate a C++ based Unreal project.

Hi yenal,

I am not sure if this meets your needs, but it is possible to open the VS solution for a project from within the Editor. If you open the ShooterGame example project in the Editor, you can go to File -> Open Visual Studio. This will open the solution for that project in Visual Studio. The solution will contain both the ShooterGame code files, as well as the UE4 source code.

I have found the easier way to do this. If you open the ShooterGame.uproject with the editor you have compiled, the editor prompts you if you want to update the project to use with this version of the editor. If you say yes, basically it does exactly what I have explained in the original post.

It seems like when you download content from the marketplace app with the Unreal Launcher, it associates the shooter template project with the binary version of the Unreal Engine. What I was doing was to right click on the project file and use the “Generate Project Files” option. This obviously will create a solution without the engine source code. To fix you have to open the project file (.uproject) with the engine you have compiled and update the engine association. Then you can create the solution file which will reference the Unreal Engine you have compiled.

I hope this helps.

Ah this is good info to know in case I run into this.

The most foolproof way is to simply make a batch file.



call "EnginePathGoesHere\GenerateProjectFiles.bat" "GamePathGoesHere\GameProjectNameGoesHere.uproject" -Game -Engine


You’re right, this is even better. Thanks.

Just right click on the uproject file and change the engine version to your source build. It will recreate the sln and include the engine source.

Finally got around to trying this using Zeblote’s method. It worked like a charm! Note, I had to go to my source folder and register the build using UnrealVersionSelector-Win64-Shipping.exe. If you skip that step, you will not have the option to change your engine version when you right click on your .uproject.

Thanks Zeblote