Skip to content

Instantly share code, notes, and snippets.

@zhiguangwang
Last active June 23, 2023 09:50
Show Gist options
  • Save zhiguangwang/42b0584ae689f0f8711790e4c05d76f1 to your computer and use it in GitHub Desktop.
Save zhiguangwang/42b0584ae689f0f8711790e4c05d76f1 to your computer and use it in GitHub Desktop.
Building Unreal Engine Game Client and Dedicated Server on Linux.

Building Unreal Engine Game Client and Dedicated Server on Linux

Because the build tools of UE4 works across platforms (Windows, Mac OS, Linux), steps in this article can be applied to Mac OS and Windows as well.

On Windows, You need to replace RunUAT.sh with RunUAT.bat though.

Prerequisites

First, get Unreal Engine 4 sourcecode and export the following environment variables:

  • $UE4_ROOT Engine sourcecode directory, which contains Setup.sh
  • $GAME_UPROJECT Path of the .uproject file of your game project
  • $ARCHIVED_DIR Your build output directory.

Build Steps

Prepare for Engine Build

cd $UE4_ROOT
./Setup.sh
./GenerateProjectFiles.sh

Build the Engine

make UE4Editor UE4Game UnrealPak CrashReportClient ShaderCompileWorker UnrealLightmass

Generate Game Project Files

This will generate Makefiles on Linux (Visual Studio files on Windows, XCode files on Mac OS).

$UE4_ROOT/GenerateProjectFiles.sh -project="$GAME_UPROJECT" -game

Build and Cook the Dedicated Server

$UE4_ROOT/Engine/Build/BatchFiles/RunUAT.sh \
    BuildCookRun -project="$GAME_UPROJECT" \
    -nop4 -build -cook -compressed -stage \
    -noclient -server -serverplatform=Linux -serverconfig=Development \
    -pak -archive -archivedirectory="$ARCHIVED_DIR" \
    -utf8output

Build and Cook the Client

$UE4_ROOT/Engine/Build/BatchFiles/RunUAT.sh \
    BuildCookRun -project="$GAME_UPROJECT" \
    -nop4 -build -cook -compressed -stage \
    -platform=Linux -clientconfig=Development \
    -pak -archive -archivedirectory="$ARCHIVED_DIR" \
    -utf8output

References

@crozar
Copy link

crozar commented Nov 20, 2019

can u join this discord server and PM me , my nick name is uaedude
im @ https://discord.gg/wQVTfE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment