With Unreal’s latest announcement that they are making the engine available freely to all, I figured I might as well try the IDE client on Ubuntu. These steps should work on any version of Ubuntu, but I’ve only really tested it on Ubuntu 15.04.

This post assumes you know your way around Ubuntu, and have played with Terminals before.

First things first, you still need a Github account and an Unreal account. Why? At the time of this post, the Unreal Github repository is private, so to gain access you must follow Unreal’s requirements to gain access.

Make your Github account here (it’s free).

Make your Unreal account here (it’s free).

With those setup, you need to link your Unreal account to your Github account before you can access the source code for the Unreal Engine. You do that here, enter your Github username and click save.

Go back to your Github page, and you should see an invitation from Unreal. Accept it. “But wait!” I hear you say, “isn’t the client downloadable for Windows and Mac OSX? Why do we need the source code for Linux?”. In it’s current state, Unreal Engine 4 is not ready for release on Linux (according to the Unreal developers). So, we must make do with the source code for the foreseeable future.

You could use Git to clone (which means download) their source, but it’s just easier if you click Download Zip on the right, and extract it to your desktop once it’s downloaded. Look for the Download Zip button on their page here. Looks like the following. Easy.

Install Required Dependencies

You’ll very likely need quite a few dependencies installed before being able to continue. So, let’s get those installed. Open a terminal, and enter the following:

sudo apt-get install -y mono-gmcs mono-xbuild mono-dmcs libmono-corlib4.0-cil libmono-system-data-datasetextensions4.0-cil libmono-system-web-extensions4.0-cil libmono-system-management4.0-cil libmono-system-xml-linq4.0-cil cmake dos2unix clang-3.5 xdg-user-dirs libqt4-dev

Setting Up Unreal Engine 4

Alright, we’re set. Let’s get to prepping Unreal Engine 4 to work on Ubuntu. Open a new Terminal, and CD to the directory where you extracted UE4’s source code. For me, that was on the desktop, so my command looked like this:

cd '/home/ismail/Desktop/UnrealEngine'

Once in this directory, we need to run the Setup, so enter this into the Terminal:

./Setup.sh

Go ahead and hit Enter. It may complain that it needs to install extra dependencies (in case we missed any), just type in your password and it will auto-install it for you. It may take a while, since it’s downloading the rest of the UE4 editor files (3GB or more). Once it’s done, let’s run the following:

./GenerateProjectFiles.sh

If you’re successful so far, you should see something like this in your Terminal:

Encountering Errors with Clang

If, after running GenerateProjectFiles, it returns an error like the following:

*** This version of the engine can only be compiled by clang - refusing to register the Linux toolchain. Generating data for project indexing... 0% UnrealBuildTool Exception: ERROR: GetPlatformToolChain: No tool chain found for Linux

This means Unreal’s source still can’t be built using Clang 3.5, or it simply can’t find Clang (may not have successfully been installed). Thus, you will need to uninstall Clang 3.5 (if it’s present on your system), and instead install 3.3 as instructed by them here. Personally, for me, Clang-3.5 worked so it should work for you as well. If this error did not occur, you can skip this part! To remove Clang 3.5, enter the following in a new Terminal:

sudo apt-get remove clang-3.5

In Ubuntu 14.04 and above, you should have access to Clang 3.3, 3.4, and 3.5. So, let’s install Clang 3.3. In the same Terminal as just now, enter the following:

sudo apt-get install clang-3.3

Once that’s done, just rerun the GenerateProjectFiles command as shown above (make sure your Terminal is in the same directory as the UE4 folder).

Building the Editor and it’s Components

Time for more commands! Yay! Alright, shouldn’t be long before we get the editor up and running now. Enter the following in the same Terminal as before:

make SlateViewer

That should have been pretty straightfoward and successful. Now, let’s actually build the Editor itself. Note that this part can actually take a seriously long time, that’s normal and ok. In the same Terminal, enter the following:

make ShaderCompileWorker UnrealLightmass UnrealPak UE4Editor

This part WILL TAKE LONG! It took me over 1 hour to compile, and that’s with an Intel i7-4770 3.4GHz CPU. Clang and Mono ate my RAM like crazy, and when compiling certain modules it actually took up 100% of it, which is 8GB of RAM. Do not attempt this if you have less than 8GB of RAM.

Once it’s completed compiling, it should look like this:

Running the Unreal Engine 4 Editor on Ubuntu

Finally! We’ve made it, let’s run this beast. Be prepared, it took me 20 minutes before I was actually able to use the Editor for the first time, since it needs to prepare shaders for first-time use.

Head into your UnrealEngine source folder, enter the Engine folder, enter the Binaries folder, and finally enter the Linux folder (that’s Desktop/UnrealEngine/Engine/Binaries/Linux for me). Scroll down until you see UE4Editor. It should look like this in your window manager:

All you should need to do is double click it to run it! Give it a minute or two before anything appears. The first thing you should see, should look something like this (fullscreen image here):

After 10 minutes for me, the main Editor appeared, but still required another 10 minutes to finish it’s Shader setup.

That’s it! Happy UE4 Linux game developing! Hopefully I haven’t excluded anything important. Please note that at the time of this post, Unreal Engine was at version 4.7.2.

Related