Building Unreal Tournament with Genvid

Getting the Unreal Tournament Source Code

The first thing you need to do is download the Unreal Tournament source code.

This code is available from GitHub but only to registered developers. To register, follow the steps here.

Our current code is based off of the following changelist:

commit 27e91ad5b439cfe698b2d1345432983ccfbc0936
Author: Peter Knepley <[email protected]>
Date:   Tue May 16 16:37:14 2017 -0400

         Copying

         //UT/Release-Next/...

         to //UT/Release-Live/...

         [CL 3441773 by Peter Knepley in UT-Release-Live branch]

Once you have downloaded the source code, switch to that changelist:

git checkout 27e91ad5b439cfe698b2d1345432983ccfbc0936

Note

This version of Unreal Tournament is missing a header it needs to compile correctly. Add the following line near the top of Engine/Source/Programs/UnrealWatchdog/Private/UnrealWatchdog.cpp, right after the last include directive:

#include "EngineBuildSettings.h"

Then follow the steps listed in the Unreal Tournament documentation How to get started (Windows).

When finished, make sure you have a working Unreal Tournament build before proceeding. Note that the initial download, build, and also first run of the game take a long time. Be patient!

Environment preparation and patching

The scripts and configuration for Unreal Tournament are located under samples/ue4/ut4. They use an environment variable named UTROOT to find the Unreal Tournament installation folder. You need to set it to your local version of Unreal Tournament.

For Windows command prompt, specify your UTROOT variable like this:

set UTROOT=C:\UnrealTournament

Adjust for the shell you’re using. For example, using Bash the command would instead be:

export UTROOT='C:\UnrealTournament'

The integration requires some added files and modifications to existing UE4 files to make Unreal Tournament run with Genvid. You can do this with the following script:

py ut4.py prepare

This script will:

  • Copy GenvidPlugin to UnrealTournament/Plugins/.
  • Copy the Genvid module to UnrealTournament/Source/.
  • Copy GenvidConnector.h to UnrealTournament/Source/UnrealTournament/Public/.
  • Copy GenvidConnector.cpp to UnrealTournament/Source/UnrealTournament/Private/.
  • Copy Content to UnrealTournament/.
  • Copy DefaultEngine.ini to UnrealTournament/Config.

Details

This section presents the modifications required to the Unreal Tournament files.

UnrealTournament.Build.cs

At the end of public UnrealTournament(TargetInfo Target), add the following lines:

        PrivateIncludePaths.Add("Genvid/Private");
        PublicIncludePaths.Add("Genvid/Public");
        PublicDependencyModuleNames.Add("Genvid");

These lines make all the GenvidPlugin public interfaces available to the UnrealTournament sub-project.