Manual-install: UE fork and plugin
If you prefer to manually install the the UE fork and plugin, follow these instructions to:
- set up and build the SpatialOS Unreal Engine fork after cloning the Unreal Engine fork repository.
- clone and install the SpatialOS GDK for Unreal plugin.
Tip: We recommend you use the auto-install option as this makes setting up the Example Project and following tutorials based on the Example Project quicker. If you manually install, you will need to take extra steps to follow tutorials.
You must have followed the Get started guide:
Step 1: Unreal Linux cross-platform support
To build the server software for SpatialOS deployments correctly, you need to build the Unreal Engine fork targeting Linux. This requires Linux cross-compilation of your SpatialOS project and the Unreal Engine fork. To do this, you need to download and unzip the Linux cross-compilation toolchain.
For guidance on this, see the Getting the toolchain section of Unreal’s Compiling for Linux documentation. As you follow the guidance there, select v11 clang 5.0.0-based to download the
v11_clang-5.0.0-centos7.zip archive, then unzip this file into a suitable directory.
Step 2: Add a LINUX_MULTIARCH_ROOT environment variable
To build the To build the SpatialOS-compatible version of Unreal Engine, you need to add an environment variable to set the path to the Linux cross-compilation toolchain so you have Unreal Linux cross-platform support (
- Open File Explorer and navigate to Control Panel > System and Security > System > Advanced system settings > Advanced > Environment variables to display the Environment Variables dialog box.
- In the dialog box, select New… to create a new system variable named
LINUX_MULTIARCH_ROOT. Set the variable value as the path to the directory of the Linux cross-compilation toolchain you downloaded and unzipped earlier.
- Test the variable is set correctly: close and restart your terminal window and run
echo %LINUX_MULTIARCH_ROOT%(Command Prompt) or
echo $Env:LINUX_MULTIARCH_ROOT(PowerShell). If you have registered the environment variable correctly, this returns the path you unzipped
v11_clang-5.0.0-centos7.zipinto. If it doesn’t, go back to the Environment Variables dialog box via File Explorer and check that you’ve set the environment variable correctly.
Step 3: Build Unreal Engine
In File Explorer navigate to the directory you cloned the Unreal Engine fork into.
Double-click Setup.bat. This installs prerequisites for building Unreal Engine 4.
This process can take a long time to complete.
While running the Setup file, you should see
Checking dependencies (excluding Mac, Android).... If it also says
excluding Linux, make sure that you set the environment variable
LINUX_MULTIARCH_ROOTcorrectly, and run the Setup file again.
- In the same directory, double-click GenerateProjectFiles.bat. This file automatically sets up the project files you require to build Unreal Engine 4.
If you encounter the message,
error MSB4036: The "GetReferenceNearestTargetFrameworkTask" task was not foundwhen building with Visual Studio 2017, check that you have the NuGet Package Manager installed via the Visual Studio installer.
- In the same directory, open UE4.sln in Visual Studio.
- In Visual Studio, on the toolbar, navigate to Build > Configuration Manager; set your active solution configuration to Development Editor and your active solution platform to Win64.
- In the Solution Explorer window, right-click on the UE4 project and select Build (you may be prompted to install some dependencies first).
Visual Studio then builds Unreal Engine, which can take up to a couple of hours.
You have now built Unreal Engine 4 with cross-compilation for Linux.
Step 4: Clone and install the SpatialOS GDK for Unreal plugin
You need to add the plugin to your project’s plugins folder in order to use SpatialOS.
To do this:
- In File Explorer, navigate to the
<YourProject>\Gamedirectory and create a
Pluginsfolder in this directory.
- In a terminal window, navigate to the
<YourProject>\Game\Pluginsdirectory and clone the GDK for Unreal repository by running either:
- In File Explorer, navigate to the root directory of the GDK for Unreal repository (
<YourProject>\Game\Plugins\UnrealGDK\...), and double-click
Setup.bat. If you haven’t already signed into your SpatialOS account, the SpatialOS developer website may prompt you to sign in.
When the build is complete, you can continue to 3 - Set up a project.
> Next: 3 - Set up project
- Set up the Example Project The Example Project is a session-based FPS game. It gives an overview of the GDK and using SpatialOS, including deploying your game to SpatialOS locally and in the cloud.
- Set up the Starter Template Use as a base for creating your own project running on SpatialOS.
—— 2019-08-12 Page updated with editorial review: added to page orientation.