You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
172 lines
12 KiB
Plaintext
172 lines
12 KiB
Plaintext
Availability:Public
|
|
Title:Compiling Game Projects
|
|
Crumbs: %ROOT%, Programming, Programming/Development
|
|
Description:Compiling individual game projects using Visual Studio on Windows, or Xcode on Mac.
|
|
Version: 4.9
|
|
|
|
[TOC (start:2 end:3)]
|
|
|
|
[EXCERPT:Main]
|
|
|
|
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 [](Programming\Development\ManagingGameCode\CppClassWizard) is used to add code to a
|
|
project created from a Blueprints Only template.
|
|
|
|
## Build Configuration
|
|
|
|
UE4 and the UnrealBuildTool use different build configurations to determine how the engine is compiled. Which configuration you use will be determined by the purposes of the build you want to create.
|
|
|
|
[EXCERPT:winbuildconfig]
|
|
Each build configuration contains two keywords. The first of these 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. If you would like to open a project in Unreal, you need to build with
|
|
the **Editor** target keyword, but if you are building an executable version of your game, but if you are building an executable version of your project that will run on a server, you would need to build using the **Server** target keyword.
|
|
|
|
|Build Configuration - State | Description |
|
|
|------------- |------------- |
|
|
| **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 is equivalent to Release. In order to see your project's code changes reflected when you open the project later in the Unreal Editor, you must compile in the **Development** configuration. |
|
|
| **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 | Description |
|
|
| ------------------ | ---------- |
|
|
| [empty] | This configuration builds a stand-alone executable version of your project, but requires cooked content specific to the platform. |
|
|
| **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 there is a `<Game>Client.Target.cs` file, the **Client** build configurations will be valid. |
|
|
| **Server** | If there is a `<Game>Server.Target.cs` file, the **Server** build configurations will be valid. |
|
|
[/EXCERPT:winbuildconfig]
|
|
|
|
[/EXCERPT:Main]
|
|
|
|
[EXCERPT:VS]
|
|
## Building with Visual Studio
|
|
|
|
### Setting the Build Configuration
|
|
|
|
The build configuration can be set in the Visual Studio toolbar.
|
|
|
|
### Project - Configuration Menu
|
|
|
|

|
|
<!--
|
|
### Solution - Configuration Menu
|
|
|
|

|
|
-->
|
|
### Setting the Solution Platform
|
|
|
|
The solution platform can be set in the Visual Studio toolbar.
|
|
<!--
|
|
UE4 currently supports the following platforms:
|
|
|
|
* **Windows 64-bit**
|
|
|
|

|
|

|
|
-->
|
|
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 [](Programming/UnrealBuildSystem/ProjectFileGenerator) page
|
|
has instructions for generating project files for additional platforms.
|
|
|
|
### Building the Project
|
|
|
|
[REGION:note]
|
|
Please make sure you are running Visual Studio 2013 Express, Community, or Professional for Windows Desktop installed before proceeding. If you are using Mac, make sure to have Xcode 6.1 or higher installed.
|
|
[/REGION]
|
|
|
|
<!--
|
|
|
|
[REGION:tip]
|
|
When building in Visual Studio, you are only compiling the game project, not the Unreal Editor.
|
|
[/REGION]
|
|
[REGION:tip]
|
|
When building in Visual Studio, you are compiling the engine in addition to the game project.
|
|
[/REGION]
|
|
|
|
-->
|
|
|
|
1. 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](#BuildConfiguration) section for descriptions of each available configuration.
|
|
|
|

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

|
|
|
|
1. Set the **Solution Configuration** to the configuration you want to build. In this example, it is set to **Development**. Refer to the [Build Configuration](#BuildConfiguration) section for descriptions of each available configuration.
|
|
|
|

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

|
|
|
|
You can now [run the engine](GettingStarted/RunningUnrealEngine) with your compiled project.
|
|
|
|
[EXCERPT:MatchEXE]
|
|
[REGION:note]
|
|
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](Programming/Development/BuildingUnrealEngine) page.
|
|
[/REGION:note]
|
|
|
|
[REGION:note]
|
|
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.
|
|
[/REGION:note]
|
|
[/EXCERPT:MatchEXE]
|
|
|
|
### Visual Studio Known Issues
|
|
|
|
| Issue | Solution |
|
|
| ----- | -------- |
|
|
| "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**. |
|
|
[/EXCERPT:VS]
|
|
|
|
[EXCERPT:Xcode]
|
|
|
|
## Building with Xcode
|
|
|
|
[REGION:tip]
|
|
When building in Xcode, you are only compiling the game project, not the Editor.
|
|
[/REGION]
|
|
|
|
**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](GettingStarted/RunningUnrealEngine) with your compiled project.
|
|
|
|
[EXCERPT:MatchDMG]
|
|
[REGION:note]
|
|
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.
|
|
[/REGION:note]
|
|
[/EXCERPT:MatchDMG]
|
|
|
|
### Xcode Known Issues
|
|
|
|
|
|
| Issue | Solution |
|
|
| ----- | -------- |
|
|
| Xcode does not stop at breakpoints | [INCLUDE:#XcodeDebug] |
|
|
|
|
<!--
|
|
[EXCERPT:XcodeDebug]
|
|
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:
|
|
|
|
settings set target.inline-breakpoint-strategy always
|
|
[/EXCERPT:XcodeDebug]
|
|
-->
|
|
|
|
[/EXCERPT:Xcode]
|
|
|
|
<!-- The following was deprecated per LaurenR 29.7.15
|
|
| **Uncooked** | Projects built using configurations that have an **Uncooked** type should be opened in Unreal Editor with the "-game" flag. This runs your game with uncooked content, in a new window, and is equivalent to **Play in > New Window at Default Player Start** in the editor. | --> |