Skip to content

Instantly share code, notes, and snippets.

@KW-M
Last active October 12, 2024 17:55
Show Gist options
  • Save KW-M/e393150596746616f41e8486b58a71ef to your computer and use it in GitHub Desktop.
Save KW-M/e393150596746616f41e8486b58a71ef to your computer and use it in GitHub Desktop.
How to build Unreal Engine 5 source into an installed (AKA standalone, AKA rocket, AKA "just like" Unreal Engine from the Epic Games Launcher) editor build
  • This guide assumes you want to build the Unreal Engine 5 (UE5) editor from source in order to get a Windows Unreal Engine 5 Editor to share with a team or studio
  • This was writen with the absolute minimum build requirements for our team to avoid taking more disk space and compile time than needed - please modify to fit your needs.
  • Keep in mind that, as of writing, I have little experience with the Unreal build tools, I'm simply documenting what worked for me.
  • Also see this excellent blog post especially if you are building Unreal Engine 4 (UE4): https://www.edwardbeazer.com/unreal-installed-builds-rocket-buids/

Steps

  1. If you do not have it already, download git bash. https://gitforwindows.org/
  2. Get access to the unreal source repo by following this guide: https://www.unrealengine.com/en-US/ue4-on-github
  3. Install Visual Studio 2019 on the C:\ drive for UE5 (Visual Studio 2017 for ue4)
  4. Next, install Debugging Tools for Windows as part of your Windows SDK by going to the "add or remove programs" pannel of the windows settings app, find your windows sdk version in the apps list, click Modify and check debugging tools for windows, then click install.
  5. Find a branch and commit hash of a specific commit in the ue5 source git hub repo (at https://github.com/EpicGames/UnrealEngine.git) that you would like to build from.
    • We used the commit with hash 8ec0dc4e3eed7a38cb783bbb48cd2ad5c441beeb on the 5.0 branch, because it is more stable than the ue5-main branch and that commit seemed to work well.
  6. Make a folder in a harddrive w at least 200gb available
  7. open folder in git bash & run these commands, making sure to replace the commit hash (8ec0dc4e3eed7...) with the full commit hash from the unreal engine source that you desire to build from:
git init
git remote add origin https://github.com/EpicGames/UnrealEngine.git
git fetch --depth 1 origin 8ec0dc4e3eed7a38cb783bbb48cd2ad5c441beeb
git checkout FETCH_HEAD
  1. In Git Bash in the same folder (should now have setup.bat in it and other stuff) run:

NOTE: remove any of the following setup.bat command arguments if they are for target platforms that you would like to compile your game for (otherwise unreal won't download the neccesary dependencies to support that game compile target)

./Setup.bat -exclude=WinRT -exclude=Mac -exclude=MacOS -exclude=MacOSX -exclude=osx -exclude=osx64 -exclude=osx32 -exclude=Android -exclude=TVOS -exclude=Linux -exclude=Linux32 -exclude=Linux64 -exclude=linux_x64 -exclude=HTML5 -exclude=PS4 -exclude=XboxOne -exclude=Switch -exclude=Dingo -exclude=Win32 -exclude=GoogleVR -exclude=LeapMotion
./GenerateProjectFiles.bat
  1. Then open command prompt or powershell and go to the same Unreal Engine Source folder as you just had open in git bash, then run:

NOTE: all other command arguments can be figured out from Engine\Build\InstalledEngineBuild.xml -especially the "withSOMEPlatformName" => statements for target platforms to include, as by default this build command will only compile win64 games, includes client and server multiplayer components, but does not include engine debuging or Datasmith Plugins. also see: https://www.edwardbeazer.com/unreal-installed-builds-rocket-buids/

.\Engine\Build\BatchFiles\RunUAT.bat BuildGraph -target="Make Installed Build Win64" -script="Engine\Build\InstalledEngineBuild.xml" -clean -set:WithWin64=true -set:HostPlatformEditorOnly=true -set:WithClient=true -set:WithServer=true -set:GameConfigurations="Development;Shipping" -set:SignExecutables=false -set:EmbedSrcSrvInfo=false -set:CompileDatasmithPlugins=false -set:WithDDC=false

When done (which took 7+ hours for me) the "installed" aka "standalone" build is in the /LocalBuilds/Win64/ folder. Zip that folder and send it to anyone who needs the built editor. To run the editor, go into that folder and run the /binaries/win64/UnrealEditor.exe file.

@ROBYER1
Copy link

ROBYER1 commented Sep 13, 2024

Thanks this works great - the exported build is rather huge still, I know that in Visual Studio you can clean the project via a Clean Build command and also manually some cleanup by deleting .pdb files.

Is there any way to clean up the build after running the .\Engine\Build\BatchFiles\RunUAT.bat BuildGraph command via a command

@ROBYER1
Copy link

ROBYER1 commented Sep 13, 2024

Okay I was able to make a .bat file to run a cleanup of the files following advice from here: https://forums.unrealengine.com/t/installed-build-is-too-large/776405/2?u=robyer1

Build size went from nearly 200GB down to 35GB with this:

Contents of the .bat file:

@echo off
setlocal enabledelayedexpansion

set target_directory=LocalBuilds

for /r "%target_directory%" %%f in (*.pdb) do (
    echo Deleting "%%f"
    del "%%f"
)

echo All .pdb files in "%target_directory%" have been deleted.

endlocal

@abrahamrkj
Copy link

Thanks a lot!! looking for a exact same thing

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