Skip to content

Instantly share code, notes, and snippets.

@parthnaik92
Last active April 17, 2025 19:51
Show Gist options
  • Save parthnaik92/30eff84267565376df69e37fefc47fbf to your computer and use it in GitHub Desktop.
Save parthnaik92/30eff84267565376df69e37fefc47fbf to your computer and use it in GitHub Desktop.
Create a minimal binary build of the Oculus fork UE4 from source for internal distribution. (Should work with normal UE4 source build too) (Windows only)
/Samples/MobileStarterContent/**
/Samples/PixelStreaming/**
/Samples/StarterContent/**
/Templates/**
/FeaturePacks/**
/Engine/Source/Developer/Datasmith/**
/Engine/Source/Programs/Enterprise/**
/Engine/Source/Programs/SwitchboardListener/**
/Engine/Source/Runtime/Datasmith/**
/Engine/Plugins/AI/UE4ML/**
/Engine/Plugins/Animation/RigLogic/**
/Engine/Plugins/Cameras/CameraShakePreviewer/**
/Engine/Plugins/Compositing/Composure/**
/Engine/Plugins/Compositing/LensDistortion/**
/Engine/Plugins/Compositing/OpenCVLensDistortion/**
/Engine/Plugins/Developer/CLionSourceCodeAccess/**
/Engine/Plugins/Developer/CodeLiteSourceCodeAccess/**
/Engine/Plugins/Developer/KDevelopSourceCodeAccess/**
/Engine/Plugins/Developer/PlasticSourceControl/**
/Engine/Plugins/Developer/SubversionSourceControl/**
/Engine/Plugins/Developer/XCodeSourceCodeAccess/**
/Engine/Plugins/Editor/MacGraphicsSwitching/**
/Engine/Plugins/Editor/MeshEditor/**
/Engine/Plugins/Editor/SpeedTreeImporter/**
/Engine/Plugins/Enterprise/**
/Engine/Plugins/Experimental/AlembicImporter/**
/Engine/Plugins/Experimental/AppleVision/**
/Engine/Plugins/Experimental/AR/**
/Engine/Plugins/Experimental/BackChannel/**
/Engine/Plugins/Experimental/BlastPlugin/**
/Engine/Plugins/Experimental/ChaosCaching/**
/Engine/Plugins/Experimental/ChaosCloth/**
/Engine/Plugins/Experimental/ChaosClothEditor/**
/Engine/Plugins/Experimental/ChaosEditor/**
/Engine/Plugins/Experimental/ChaosNiagara/**
/Engine/Plugins/Experimental/ChaosSolverPlugin/**
/Engine/Plugins/Experimental/ChaosVehiclesPlugin/**
/Engine/Plugins/Experimental/CommonConversation/**
/Engine/Plugins/Experimental/CommonUI/**
/Engine/Plugins/Experimental/Enterprise/**
/Engine/Plugins/Experimental/FieldSystemPlugin/**
/Engine/Plugins/Experimental/GeometryCacheAbcFile/**
/Engine/Plugins/Experimental/GeometryCollectionPlugin/**
/Engine/Plugins/Experimental/LiveLinkControlRig/**
/Engine/Plugins/Experimental/MotoSynth/**
/Engine/Plugins/Experimental/OpenImageDenoise/**
/Engine/Plugins/Experimental/Phya/**
/Engine/Plugins/Experimental/RemoteSession/**
/Engine/Plugins/Experimental/SampleToolsEditorMode/**
/Engine/Plugins/Experimental/Shotgun/**
/Engine/Plugins/Experimental/VirtualCamera/**
/Engine/Plugins/Experimental/VirtualProduction/**
/Engine/Plugins/Experimental/VirtualProductionUtilities/**
/Engine/Plugins/Experimental/WebSocketNetworking/**
/Engine/Plugins/Importers/**
/Engine/Plugins/Lumin/**
/Engine/Plugins/Media/AjaMedia/**
/Engine/Plugins/Media/AppleProResMedia/**
/Engine/Plugins/Media/AvfMedia/**
/Engine/Plugins/Media/AvidDNxMedia/**
/Engine/Plugins/Media/BlackmagicMedia/**
/Engine/Plugins/Media/ElectraCDM/**
/Engine/Plugins/Media/ElectraPlayer/**
/Engine/Plugins/Media/ElectraUtil/**
/Engine/Plugins/Media/HAPMedia/**
/Engine/Plugins/Media/HardwareEncoders/**
/Engine/Plugins/Media/HLMedia/**
/Engine/Plugins/Media/ImgMedia/**
/Engine/Plugins/Media/MediaCompositing/**
/Engine/Plugins/Media/MediaFrameworkUtilities/**
/Engine/Plugins/Media/MediaIOFramework/**
/Engine/Plugins/Media/MediaMovieStreamer/**
/Engine/Plugins/Media/MediaPlayerEditor/**
/Engine/Plugins/Media/MfMedia/**
/Engine/Plugins/Media/PixelStreaming/**
/Engine/Plugins/Media/TimecodeSynchronizer/**
/Engine/Plugins/Media/WebMMedia/**
/Engine/Plugins/Media/WmfMedia/**
/Engine/Plugins/Online/Android/**
/Engine/Plugins/Online/IOS/**
/Engine/Plugins/Online/OnlineSubsystemAmazon/**
/Engine/Plugins/Online/OnlineSubsystemApple/**
/Engine/Plugins/Online/OnlineSubsystemFacebook/**
/Engine/Plugins/Online/OnlineSubsystemGoogle/**
/Engine/Plugins/Online/OnlineSubsystemTencent/**
/Engine/Plugins/Online/OnlineSubsystemTwitch/**
/Engine/Plugins/Online/VoiceChat/VivoxVoiceChat/**
/Engine/Plugins/Runtime/Advertising/**
/Engine/Plugins/Runtime/Analytics/Adjust/**
/Engine/Plugins/Runtime/Analytics/Flurry/**
/Engine/Plugins/Runtime/AppleImageUtils/**
/Engine/Plugins/Runtime/AppleMoviePlayer/**
/Engine/Plugins/Runtime/AR/**
/Engine/Plugins/Runtime/ArchVisCharacter/**
/Engine/Plugins/Runtime/AudioSynesthesia/**
/Engine/Plugins/Runtime/Firebase/**
/Engine/Plugins/Runtime/GeoReferencing/**
/Engine/Plugins/Runtime/GoogleCloudMessaging/**
/Engine/Plugins/Runtime/GooglePAD/**
/Engine/Plugins/Runtime/GoogleVR/**
/Engine/Plugins/Runtime/HDRIBackdrop/**
/Engine/Plugins/Runtime/IOSDeviceProfileSelector/**
/Engine/Plugins/Runtime/IOSReplayKit/**
/Engine/Plugins/Runtime/LiveLinkOvernDisplay/**
/Engine/Plugins/Runtime/LocationServicesIOSImpl/**
/Engine/Plugins/Runtime/MicrosoftSpatialAudio/**
/Engine/Plugins/Runtime/MixedRealityCaptureFramework/**
/Engine/Plugins/Runtime/nDisplay/**
/Engine/Plugins/Runtime/Nvidia/**
/Engine/Plugins/Runtime/OSC/**
/Engine/Plugins/Runtime/OSCModulationMixing/**
/Engine/Plugins/Runtime/ResonanceAudio/**
/Engine/Plugins/Runtime/Synthesis/**
/Engine/Plugins/Runtime/TimeSynth/**
/Engine/Plugins/Runtime/WarpUtils/**
/Engine/Plugins/Runtime/WebMMoviePlayer/**
/Engine/Plugins/Slate/SlateRemote/**
/Engine/Plugins/VirtualProduction/**
!/Engine/Plugins/VirtualProduction/Takes/**

Requirements:

  • Download the Oculus fork of UE4 source from GitHub.
    • Before you extract, keep the following in mind.
      • The drive you extract it in should have at least 150 GB free space. Have 200 GB free, just to be sure.
      • (Optional) Use SSD, it will make compilation much faster.
    • Extract it to a folder which is directly under your drive. Do not put it like <Drive>:\folder1\folder2..., you might get path length errors.
  • Download Unreal Binary Builder from GitHub. Direct Download Link
    • Extract it wherever you want.
  • You know a little bit of xml so you can properly edit some files mentioned in the following section.

Pre-Setup steps:

  • Go to the <UnrealEngine folder>\Engine\Build folder. Open both InstalledEngineBuild.xml and InstalledEngineFilters.xml in a text editor.
    • Remove all the things related to IOS, TVOS, Datasmith and Switchboardlistener from both the files.
    • Save and close both of them.
  • Go to Engine\Programs\UnrealFrontend\Config and open DefaultEngine.ini in a text editor.
    • Remove xcode related entry from it.
    • Save and close it.
  • Go to Engine\Programs\UnrealInsights\Config and open DefaultEngine.ini in a text editor.
    • Remove xcode related entry from it.
    • Save and close it.
  • Add a .gitdepsignore file to the <UnrealEngine folder>. The one I use is available with this gist.
    • It will be used to tell the setup which files to not download. In our case, datasmith, Lumen, unrequired plugins, IOS, TVOS related files etc.
    • You can add/remove folders as per your choice here. Remember, the setup will not download files and folders mentioned here.
    • Here is a link to the UE4 plugin dependency sheet I made for the same purpose. This will help you decide which plugins to keep and which ones to remove.
    • If you want to remove a folder or a file, just add it's relative path to your <UnrealEngine folder>. e.g. If you don't want to download the "Pixel Streaming" sample, add /Samples/PixelStreaming/** to it.
    • If you want to remove contents of a folder but keep a subfolder/file from inside it, add the relative path to the folder like mentioned before. Also add the relative path of the subfolder/file but with a ! before it. e.g. We want to remove the entire Engine/PluginsVirtualProduction folder but keep the Takes plugin that is inside it. Add /Engine/Plugins/VirtualProduction/** and !/Engine/Plugins/VirtualProduction/Takes/**.
    • Remove all the files and folders mentioned in the .gitdepsigore from your <UnrealEngine folder>. Do keep the ones that are added with ! before the entry. (You can create a script to remove/keep files/folders, it would save some time)

Installation:

  • Open UnrealBinaryBuilder.exe.
  • Make sure you are in the "Setup" tab. In this tab,
    • Click "Browse" and select your <UnrealEngine folder>.
    • Check "Windows 64", "Windows 32" and "Android" under platforms.
      • For my installation, I only requried one "Windows 32" related file so I unchecked the option here and just copy pasted it from the Epic Binary Unreal Engine installation folder to the relevant folder here. The file was Engine\Binaries\ThirdParty\ARM\Win32\astcenc.exe, you can do the same if your .gitdepsignore file looks the same as mine.
    • Check "Build Setup" and "Build Automation Tool". You can check "Generate Project Files" if you want to use Visual Studio to compile UE4. I would not recommend it as it takes much longer. With default settings, Visual Studio builds the engine with lesser number of parallel processes than Unreal Binary Builder. So it would take more time with Visual Studio.
    • Make sure that "Continue to Engine Builds" is checked.
  • Go to the "Zip Build" tab. In this tab,
    • Check "Zip Final Build".
    • Browse and select the folder where you want the zipped Unreal Engine installation to go to. Also make sure you write the name of the file that will be created as the zip. Click Save.
    • Under "Contents to zip", Make sure you have "Core" and "Include Source" checked. For the minimal engine build, you only need these 2. You can also check "Include Documentation", it won't take much space.
    • You can check "Include PDB" and "Include DEBUG". It will help with debuggning your games. It will increase your build size. I am not checking it as I am trying to make a super minimalistic build.
  • Go to the "Compile" tab.
    • Under "Platforms", check "Host Editor Only", "Windows 64" and "Android".
    • Under "Options", you don't need to check anything. You can check "Use 2019 compiler" if you want to use the VS 2019 compiler instead.
  • You are ready to make the engine build. Go to the "Setup" tab again and click "Start".
  • Sit back, relax, have some food, this will take a while.
  • Once the engine is built, it will automatically start creating a zip of the engine build. This is stored in the folder which you specified before in "Zip Build".
  • You can distribute this zip to your team members.
  • For me, after I completed this whole process, the zip was 3.83 GB and once I extracted it, it was 12.6 GB. Super minimalistic engine build.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment