Setting up Unreal engine in M1 Mac for C++ game development

Sai Balaji
Techiepedia
Published in
6 min readMay 11, 2021

Hello everyone in this article we are going to see how to setup Unreal Engine with C++(using VSCode editor) in M1 Mac.

Current state of Unreal Engine in M1 Mac

At present there is no native arm version of the unreal engine is available from Epic games.And also the recent version UE 4.26.2 does’nt even launch in M1 chip MBP.But there are two Unreal engine versions which are usable 4.19 and 4.25.4. I prefer 4.25.4 as it works with newer Xcode version and command line tools without any problem. And also it is important to note that M1 Chip Mac running BigSur does’nt support Xcode version below 12. So it is better to go with 4.25.4.And also you can use a Mac for running Unreal Engine if you are making iOS games,remote building iOS projects or even learning game development by making simple games.At present state using Unreal engine in M1 Mac for large projects is not recommended. And also M1 Chip Mac Mini or MacBook Pro with 16GB ram is preferable because machine may get hotter during compilation of shaders for which I recommend a device with active cooling like Mac mini,MacBook Pro over passsive cooled MacBookAir.

Setting up Unreal Engine

  • Download the Epci game launcher by heading to this website
  • In Epic game launcher press the + symbol to add the engine and select 4.25.4 from the drop downcast . As I have already installed it in my mac is doesn't show in the list
  • After installation launch the engine.For the first time launch it may take some time and also it may also see like it got stuck at 83% loading or like that if it happens select forcequit option see it it is labeled as not responding my mac os if so the quit it and try launching it agian.If not wait till it loads.
  • Create a new project I’m creating a blank template C++ project with following options
  • If it generates project files and compiles C++ code then it is good. If not you may get error stating.

and so on.

  • To solve this problem quit the unreal engine and open up the terminal and move to this folder location using cd command
/Users/Shared/UnrealEngine/UE_4.25/Engine/Source/Runtime/ApplicationCore
  • Open up a file named ApplicationCore.Build.cs using VSCode or any other text editor.In line number 46 comment the existing line and add the below line of C# code.
string SDKROOT = Utils.RunLocalProcessAndReturnStdOut("/usr/bin/xcrun", "--sdk macosx --show-sdk-path");    PublicAdditionalLibraries.Add(SDKROOT + "/System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/Current/MultitouchSupport.tbd");

Once done save it VSCode may give option like overwrite select overwrite then it will save the changes to the file instead of saving as a seperate file.

  • Next go to this location in terminal and open and open a C# file named Core.Build.cs
/Users/Shared/UnrealEngine/UE_4.25/Engine/Source/Runtime/Core

Here go to line number 98 and comment the existing code and replace with following C# code.

string SDKROOT = Utils.RunLocalProcessAndReturnStdOut("/usr/bin/xcrun", "--sdk macosx --show-sdk-path");    PublicAdditionalLibraries.Add(SDKROOT + "/System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/Current/MultitouchSupport.tbd");

Now save and close that file.

  • Now we need to generate VSCode workspace file so that we can open our project in VSCode as of now Xcode really sucks with Unreal Engine without proper autocomplete support and some gibberish errors so it is better to use VSCode.

First head to this website and download VScode make sure you download AppleSilicon version and not Universal or Intel Chip version

Open up VSCode and install the following extensions

  • “C/C++ Intellisense, debugging and code browsing” — from Microsoft
  • “C# for Visual Studio Code (powered by OmniSharp)” — from Microsoft

NOTE: You may get a prompt stating “Get the .NET Core SDK” is so click and install it.If not head to https://dotnet.microsoft.com/download

and download the .NetCore SDK for mac os.

Once .NetCore SDK is intalled run the following command to verify if .NetCore SDK is properly installed.

dotnet --version
  • Next we need to install Mono runtime for C# it can be done through homebrew
brew install mono
  • Next step we are going to create vscode workspace for your C++ project which you have previously created

NOTE: The following steps are need to be done only once for initial setup and it is not needed to be done for each and every project.

  • In terminal navigate to your C++ project directory and copy the path for your .uproject file.
/Users/<username>/Documents/Unreal\ Projects/PROJECT_NAME/PROJECT_NAME.uproject
  • Next head to this location in terminal
/Users/Shared/UnrealEngine/UE_4.25/Engine/Build/BatchFiles/Mac
  • Now run this following command to generate vscode workspace for our project. Make sure you specify your .uproject file path in double quotes.
./GenerateProjectFiles.sh -project=".UPROJECT_FILE_PATH_HERE" -game -vscode
  • Now this command will generate the VSCode workspace. It may give some warning no need to worry about it.Once it is done it will show like this
  • Now navigate to your project directory you will see a file .code-workspace open it in VSCode
  • Now we need to make VScode as our defualt editor so that there is no need to repeat above steps for each and every project to generate .code workspace file.
  • It can be done by heading to preference of Unreal Engine under source code and editor option select VSCode as editor. Now it will ask to restart Unreal editor restart it.

Now go to file->Generate Visual Studio code project which will create make files needed to build the project.Now you can open your C++ project in VSCode.

  • In addition you can download VSCode UE4 Intellisense fix extension as shown in below website.
  • And for auto generating method implementation for given function defination you can use this extension in VSCode.

All set now you can use M1 Mac for making some simple ue4 c++ games.

But it is still important to note that Unreal engine is not yet natively available for M1 chip hence there may be some caveats and also there may also be some minor issues with VSCode intellisense.

--

--