Unreal Tournament Integration

Here we will describe how we modified the latest Unreal Tournament to use Genvid.

Preparation

You will need to download the Unreal Tournament source code.

This code is available from GitHub but only to registered developers. To register, follow the steps highlighted 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

Normally, some git-hook should call setup.bat, but we recommend you call it by hand for good measure. This script will download and install all of the necessary requirements.

Note that this version of Unreal Tournament miss a header to compile correctly. In the file UnrealWatchdog.cpp, you must add the following line:

#include "EngineBuildSettings.h"

You should then follow the steps listed in Epic’s own documentation.

The gist of it is to run GenerateProjectFiles.bat, open up UE4.sln, and compile a few targets (ShaderCompileWorker and UnrealLightmass). Then, with UnrealTournament selected, simply Build and Debug (F5). It does take some time, so be patient.

Make sure you have a working Unreal Tournament build before proceeding.

Installation

The integration requires various files which we added and some modifications to existing UE4 files to make Unreal Tournament run with Genvid.

  • Copy GenvidPlugin under UnrealTournament/Plugins/.
  • Copy the Genvid module under UnrealTournament/Source/.
  • Copy GenvidConnector.h under UnrealTournament/Source/UnrealTournament/Public/.
  • Copy GenvidConnector.cpp under UnrealTournament/Source/UnrealTournament/Private/.
  • Copy BP_GenvidConnector.uasset under UnrealTournament/Content/Genvid/.

Details

This section presents the modifications required to the UnrealTournament files.

UnrealTournament.Build.cs

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

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

This line makes all of the GenvidPlugin public interfaces available to all of the UnrealTournament sub-project.

UTWorldSettings.h

You then now need to derived the AUTWorldSettings class from the AGenvidWorldSettings, which itself is a specialization of AWorldSettings.

Start by including the GenvidWorldSettings.h header at the top of the file:

#include "UTResetInterface.h"
#include "GenvidWorldSettings.h"
#include "UTWorldSettings.generated.h"

Then, replace the parent class of AUTWorldSettings with AGenvidWorldSettings:

UCLASS()
class UNREALTOURNAMENT_API AUTWorldSettings : public AGenvidWorldSettings, public IUTResetInterface
{

And you’re ready to go!

Note

Using UE4 JSON serialization routines is a suboptimal decision which we took mainly due to simplicity arguments of this tutorial. We recommend developers use a much more compact binary representation in order to save as much bandwidth as possible. The extra cost incurred on the web browser side should be worth the extra effort.

BP_GenvidConnector.uasset

To finish the integration of genvid in the UnrealTournament project, select the map you want to play with and open the World Settings window.

../_images/World_Settings_Menu.gif

Once you are in the World Settings section, it requires you to modify up to two settings in the World Settings window of the Unreal Editor.

proceed to the Genvid subsection.

Click on the checkbox of Enabled and in the drop-down list of Streamer, select the blueprint asset BP_GenvidConnector.

../_images/World_Settings.gif