Compiling Game Projects
Compiling individual game projects using Visual Studio on Windows, or Xcode on Mac.
Choose your operating system:
Unreal Engine 4 (UE4) uses a custom building method via the UnrealBuildTool which handles all the complex aspects of compiling the project and linking it with the engine. This process occurs transparently allowing you to simply build the project through the standard Visual Studio build workflow.
UnrealBuildTool uses the .Build.cs and .Target.cs files to build the game project. These are automatically generated when a project is created using a C++ template, or when the CPP Class Wizard is used to add code to a project created from a Blueprints Only template.
Build Configuration
Unreal projects have multiple targets (Editor, Client, Game, and Server) described by *.target.cs files, each of which can be built to different configurations. In Visual Studio, this manifests as a Visual Studio *.vcxproj file with different configurations for each target. The solution configurations are named as [Configuration][Target Type] (for example, «DevelopmentEditor» for the default editor target, and «Development» for the default standalone game target). The configuration you use will be determined by the purposes of the build you want to create.
Every build configuration contains two keywords, and the first keyword indicates the state of the engine and your game project. For instance, if you compile using a Debug configuration, you will be able to debug your game’s code. The second keyword indicates the target you are building for. For example, if you want to open a project in Unreal, you need to build with the Editor target keyword.
Build Configuration — State
Debug
This configuration contains symbols for debugging. This configuration builds both engine and game code in debug configuration. If you compile your project using the Debug configuration and want to open the project with the Unreal Editor, you must use the «-debug» flag in order to see your code changes reflected in your project.
DebugGame
This configuration builds the engine as optimized, but leaves the game code debuggable. This configuration is ideal for debugging only game modules.
Development
This configuration enables all but the most time-consuming engine and game code optimizations, which makes it ideal for development and performance reasons. Unreal Editor uses the Development configuration by default. Compiling your project using the Development configuration enables you to see code changes made to your project reflected in the editor.
Shipping
This is the configuration for optimal performance and shipping your game. This configuration strips out console commands, stats, and profiling tools.
Test
This configuration is the Shipping configuration, but with some console commands, stats, and profiling tools enabled.
Build Configuration — Target
[empty]
This configuration builds a stand-alone executable version of your project, but requires cooked content specific to the platform. Please refer to our Packaging Projects Reference page to learn more about cooked content.
Editor
To be able to open a project in Unreal Editor and see all code changes reflected, the project must be built in an Editor configuration.
Client
If you’re working on a multiplayer project using UE4 networking features, this target designates the specified project as being a Client in UE4’s client-server model for multiplayer games. If there is a <Game>Client.Target.cs file, the Client build configurations will be valid.
Server
If you’re working on a multiplayer project using UE4 networking features, this target designates the specified project as being a Server in UE4’s client-server model for multiplayer games. If there is a <Game>Server.Target.cs file, the Server build configurations will be valid.
Building with Visual Studio
Setting the Build Configuration
The build configuration can be set in the Visual Studio toolbar.
Project — Configuration Menu
Setting the Solution Platform
The solution platform can be set in the Visual Studio toolbar.
UE4 currently supports the following platforms:
Windows 32-bit
Windows 64-bit
When working with Unreal Engine 4, you will typically use the Win64 platform. This is the only one included by default when generating project files; the Project Files for IDEs page has instructions for generating project files for additional platforms.
Building the Project
Make sure you are running Visual Studio 2015 or higher for Windows Desktop installed before proceeding. If you are using Mac, make sure to have Xcode 9.0 or higher installed.
Set the Solution Configuration to the configuration you want to build. In this example, it is set to Development Editor. Refer to the Build Configuration section for descriptions of each available configuration.

Right-click your game project and choose Rebuild to recompile.

When running the engine, it is important to use the Unreal Engine executable that matches the build configuration you rebuilt your project in. For example, if you compiled your project in the DebugGame Uncooked build configuration, you would run the UE4-Win64-DebugGame.exe executable with your game information as an argument. More information on the binary naming convention can be found on the Building Unreal Engine page.
When running Unreal, it is important to add the -game flag if you rebuilt your project in any Uncooked configuration, and the -debug flag if you rebuilt your project in any Debug configuration.
Visual Studio Known Issues
«Project is out of date» message always appears
Visual Studio thinks the project is out of date when it really is up to date. You can safely suppress this message by checking the Do not show this dialog again box and pressing No.
No Debugging Information window appears when using the Debug configuration
The reason for this is that the UE4editor.exe was compiled using the Development configuration. Your game project will still be debuggable when compiled using the Debug configuration despite this warning. You can safely suppress this message by checking the Do not show this dialog again box and pressing Yes.
Building with Xcode
When building in Xcode, you are only compiling the game project, not the Editor.
To compile the project:
The Unreal Engine Xcode project is configured to build Debug configuration when you use Xcode’s Product > Build option and Development configuration when you use Product > Build For > Profiling. You can edit this behavior by editing the target schemes.
When running the binary Editor, it is important to add the -game flag if you rebuilt your project in any Uncooked configuration, and the -debug flag if you rebuilt your project in any Debug configuration.
Xcode Known Issues
Xcode does not stop at breakpoints
Xcode’s LLDB debugger needs to be configured to correctly handle breakpoints in Unreal Engine projects. You need to create (or edit, if you already have it) a .lldbinit file in your home folder and add the following line to it:
Compiling Unreal Engine From Source
The process and source material for this guide comes from Michael Allar. I am simply taking his video walk-through and creating a written step-by-step guide.
Note: The numbers for each step below link to the corresponding section of the video, if there is one.
1. Sign up for GitHub and Unreal Engine.
If you don’t already have an account at both these sites, you’ll need them to download the source code for Unreal Engine.
2. Connect your GitHub account to your Unreal Engine account.
You should see a section labeled GitHub Account Name, on your settings page. Once you enter in your GitHub account and save your profile, you’ll be invited to join the EpicGames GitHub organization.
3. Download the Unreal Engine source code.
Once you have joined the EpicGames GitHub organization, you’ll see a private repo called UnrealEngine. In the repo, head to the Releases page and grab the latest release. As of 6/25/2015, it’s v4.8.1.
4. Unzip the source code onto your computer.
5. Run Setup.bat.
This downloads a bunch of files required to do the next step and might take a few minutes to complete. Note: This step is missing from the video.
6. Run GenerateProjectFiles.bat.
This should run fairly quickly.
7. Compile the Unreal Engine Visual Studio solution.
Open up the UE project solution. If you are building v4.8 then the file should be named UE4.sln. Note: If you don’t already have Visual Studio, you can get it here.
8. Set development mode and build solution.
Once Visual Studio is open and the project has loaded, you need to update the “Solutions Configuration” and set it to Development Editor. This can be found in the dropdown pictured below. Next, find the UE4 project in “Solution Explorer” on the right. It will be under Engine > UE4. Right click the project and select Build. This step will take some time (at least 15–20 minutes). You’ll know it’s finished once you see “Build: 1 succeeded, 0 failed…” in the Output panel at the bottom of Visual Studio.
9. Register your compiled version of Unreal Engine as an editor.
After Visual Studio is done building the project, go back to your engine directory and find the Version Selector Tool. It should be located in [Root] > Engine > Binaries > Win64 > UnrealVersionSelector-Win64-Shipping.exe. Double click it and select “Yes” when it asks, “Register this directory as an Unreal Engine installation?”.
10. (Optional) Create a shortcut in the root directory.
At this point you’re all set! To run your newly compiled-from-source version of Unreal Engine simply navigate to [Root] > Engine > Binaries > Win64 > UE4Editor.exe and double click it. If you prefer (which Michael and I both do), you can create a shortcut from the root to quickly run Unreal. In your root directory, create a new file named Editor.bat, right click it, and select “Edit”. Paste the following code:
Now you can use Editor.bat to launch Unreal Engine! 😀
Thanks again to Michael Allar for creating the video walk-through that’s at the top of this post. If you have any questions about this written guide, feel free to email me, or tweet me @ianhirschfeld.
Как скомпилировать игру в unreal engine 4
Unreal Engine 4 (UE4) uses a custom building method via the UnrealBuildTool which handles all the complex aspects of compiling the project and linking it with the engine. This process occurs transparently allowing you to simply build the project through the standard Visual Studio build workflow.
UnrealBuildTool uses the .Build.cs and .Target.cs files to build the game project. These are automatically generated when a project is created using a C++ template, or when the CPP Class Wizard is used to add code to a project created from a Blueprints Only template.
Build Configuration
Unreal projects have multiple targets (Editor, Client, Game, and Server) described by *.target.cs files, each of which can be built to different configurations. In Visual Studio, this manifests as a Visual Studio *.vcxproj file with different configurations for each target. The solution configurations are named as [Configuration][Target Type] (for example, «DevelopmentEditor» for the default editor target, and «Development» for the default standalone game target). The configuration you use will be determined by the purposes of the build you want to create.
Every build configuration contains two keywords, and the first keyword indicates the state of the engine and your game project. For instance, if you compile using a Debug configuration, you will be able to debug your game’s code. The second keyword indicates the target you are building for. For example, if you want to open a project in Unreal, you need to build with the Editor target keyword.
Build Configuration — State
Debug
This configuration contains symbols for debugging. This configuration builds both engine and game code in debug configuration. If you compile your project using the Debug configuration and want to open the project with the Unreal Editor, you must use the «-debug» flag in order to see your code changes reflected in your project.
DebugGame
This configuration builds the engine as optimized, but leaves the game code debuggable. This configuration is ideal for debugging only game modules.
Development
This configuration enables all but the most time-consuming engine and game code optimizations, which makes it ideal for development and performance reasons. Unreal Editor uses the Development configuration by default. Compiling your project using the Development configuration enables you to see code changes made to your project reflected in the editor.
Shipping
This is the configuration for optimal performance and shipping your game. This configuration strips out console commands, stats, and profiling tools.
Test
This configuration is the Shipping configuration, but with some console commands, stats, and profiling tools enabled.
Build Configuration — Target
[empty]
This configuration builds a stand-alone executable version of your project, but requires cooked content specific to the platform. Please refer to our Packaging Projects Reference page to learn more about cooked content.
Editor
To be able to open a project in Unreal Editor and see all code changes reflected, the project must be built in an Editor configuration.
Client
If you’re working on a multiplayer project using UE4 networking features, this target designates the specified project as being a Client in UE4’s client-server model for multiplayer games. If there is a <Game>Client.Target.cs file, the Client build configurations will be valid.
Server
If you’re working on a multiplayer project using UE4 networking features, this target designates the specified project as being a Server in UE4’s client-server model for multiplayer games. If there is a <Game>Server.Target.cs file, the Server build configurations will be valid.
Building with Visual Studio
Setting the Build Configuration
The build configuration can be set in the Visual Studio toolbar.
Project — Configuration Menu

Setting the Solution Platform
The solution platform can be set in the Visual Studio toolbar.
UE4 currently supports the following platforms:
Windows 32-bit
Windows 64-bit
When working with Unreal Engine 4, you will typically use the Win64 platform. This is the only one included by default when generating project files; the Project Files for IDEs page has instructions for generating project files for additional platforms.
Building the Project
Make sure you are running Visual Studio 2015 or higher for Windows Desktop installed before proceeding. If you are using Mac, make sure to have Xcode 9.0 or higher installed.
Set the Solution Configuration to the configuration you want to build. In this example, it is set to Development Editor. Refer to the Build Configuration section for descriptions of each available configuration.

Right-click your game project and choose Rebuild to recompile.

You can now run the engine with your compiled project.
When running the engine, it is important to use the Unreal Engine executable that matches the build configuration you rebuilt your project in. For example, if you compiled your project in the DebugGame Uncooked build configuration, you would run the UE4-Win64-DebugGame.exe executable with your game information as an argument. More information on the binary naming convention can be found on the Building Unreal Engine page.
When running Unreal, it is important to add the -game flag if you rebuilt your project in any Uncooked configuration, and the -debug flag if you rebuilt your project in any Debug configuration.
Visual Studio Known Issues
«Project is out of date» message always appears
Visual Studio thinks the project is out of date when it really is up to date. You can safely suppress this message by checking the Do not show this dialog again box and pressing No.
No Debugging Information window appears when using the Debug configuration
The reason for this is that the UE4editor.exe was compiled using the Development configuration. Your game project will still be debuggable when compiled using the Debug configuration despite this warning. You can safely suppress this message by checking the Do not show this dialog again box and pressing Yes.
Building with Xcode
When building in Xcode, you are only compiling the game project, not the Editor.
To compile the project:
The Unreal Engine Xcode project is configured to build Debug configuration when you use Xcode’s Product > Build option and Development configuration when you use Product > Build For > Profiling. You can edit this behavior by editing the target schemes.
You can now run the engine with your compiled project.
When running the binary Editor, it is important to add the -game flag if you rebuilt your project in any Uncooked configuration, and the -debug flag if you rebuilt your project in any Debug configuration.
Xcode Known Issues
Xcode does not stop at breakpoints
Xcode’s LLDB debugger needs to be configured to correctly handle breakpoints in Unreal Engine projects. You need to create (or edit, if you already have it) a .lldbinit file in your home folder and add the following line to it:
UEngine.Ru

Перед тем, как распространять свой проект пользователям, он должен быть правильно скомпилирован и запакован для быстрого и корректного запуска.
Подготовка проекта состоит из нескольких шагов. Для начала это компиляция кода для корректного запуска, после чего проходит запаковка контента, из которого и состояит игра. Этот контент запаковывается, в основном, под конкретную платформу на которой будет запущен проект. После всего этого останется останется подготовить проект для удобного использования и запуска, например установщик Windows.
В File меню вы сможете найти подменю под названием Package Project. Этот раздел отвечает за подготовку и запаковку вашего проекта для тестирования и распространения. Так же в этом разделе имеются дополнительные настройки запаковки.
После выбора нужной платформы, редактор Unreal Engine 4 начнет компиляцию кода, запаковку контента и подготовку проекта для дистрибутации или тестирования. Процесс может занимать очень долгое время, если в вашем проекте содержится большое количество контента(модели, звуки, карты и т.п.).
Запаковка проекта
Что бы запаковать ваш проект под конкретную платформу, выберете File > Package Project > [Имя платформы] в редакторе UE4.

Вам будет предложено выбрать путь, куда будет помещен ваш проект, а затем начнется процесс запаковки проекта.
Процесс запаковки проходит в фоновом режиме, поэтому возможность использовать редактор остается. В нижнем правом углу будет показываться индикатор, который означает, что ваш проект запаковывается.

Данное окно позволяет прервать процесс в случае необходимости, а так же позволяет открыть окно логов. Окно будет открыто как отдельное окно, в котором будет подробно описан процесс компиляции. В случае ошибки, в данном окне можно посмотреть, на каком моменте и по какой причине был прерван процесс запаковки.

Для менее опытных пользователей, самые важные сообщения, такие как предупреждения или ошибки, можно посмотреть в отдельном окне Message Log.

Запуск проекта
После того, как проект был успешно запакован и подготовлен, вы можете найти его и запустить по пути, который был выбран перед процессом запаковки.
Для каждой платформы, исполняемые файлы для запуска могут различаться. Таким образом для Windows будет файл .exe, а для Android — .apk

| Конфигурация | Название EXE | Расположение |
| Development | [Имя проекта].exe | [Путь]WindowsNoEditor[Имя проекта]BinariesWin64 |
| Shipping | [Имя проекта]-Win32-Shipping.exe.exe | [Путь]WindowsNoEditor[Имя проекта]BinariesWin32 |
Распространение
Дополнительные настройки
Дополнительные настройки можно найти в File > Package Project > Packaging Settings в главном меню редактора UE4.

| Build Configuration | Конфигурация проекта. Для отладки режим Debug. Для тестирования больше подойдет режим Development. Для финального распространения — режим Shipping. |
| Staging Directory | Директория, которая будет содержать запакованный проект. Будет автоматически обновлено при выборе другого пути перед запаковкой. |
| Full Rebuild | Определяет, будет ли скомпилирован весь код, или же только измененная часть(Выкл). Это может ускорить время запаковки. При подготовки проекта к распространению(режим Shipping) убедитесь, что данная опция включена, что бы не пропустить ничего лишнего при запаковке. |
| Use Pak File | Определяет, запаковывать ли весь контент в один файл(.pak) для более удобного распространения, или же хранить контент в индивидуальных файлах(Выкл). |
Запаковка контента
При обновлении вашего контента, вам может не понадобится перекомпилировать весь проект для того, что бы запустить его и проверить. Вместо этого, в UE4 существует возможность запаковать только сам контент на нужную платформу. Сделать это можно через File > Cook Content > [Платформа].