Files
UnrealEngineUWP/Engine/Documentation/Source/GettingStarted/RunningUnrealEngine/RunningUnrealEngine.INT.udn

524 lines
18 KiB
Plaintext

Availability:Public
Title:Running Unreal Engine
Crumbs: %ROOT%, GettingStarted
Description:Running the engine as a game or editor, including how to launch a specific map and useful in-game commands.
%Globals:OSSelect%
[TOC (start:2 end:4)]
[EXCERPT:Main]
The instructions on this page are for running the engine with projects compiled in a **Development** build configuration. You can substitute the `UE4Editor-*.exe` or `UE4-*.exe` that you need
for opening projects built in other configurations. More information on the binary naming convention can be found on the [Building Unreal Engine](Programming/Development/BuildingUnrealEngine) page.
## Running the Editor
[EXCERPT:RunEditor]
[PUBLISH:Licensee]
This process will launch a copy of Unreal Editor.
[/PUBLISH:Licensee]
[PUBLISH:Rocket]
The process of running the editor simply requires passing the name of the project to run as an argument to the executable.
[REGION:tip]
You can add the `-debug` switch to force the executable to load the debug version of the modules for your project, which
contain all of the debugging symbols. This is necessary even when debugging through Visual Studio with the configuration
set to **Debug** because the main executable is always compiled using the **Development** configuration. Of course, you
must first compile your modules using the **Debug** configuration so they exist for the executable to load.
[/REGION]
[/PUBLISH:Rocket]
### Running the Editor From the Command Line
[PUBLISH:Licensee]
1. From a command prompt, navigate to the `\Engine\Binaries\Win64` directory of your `UE4` directory.
1. Run the `UE4Editor.exe` passing it the name of the game to run:
|Project Location|Command Prompt|
|----------------|--------------|
|UE4 Root | `UE4Editor.exe MyGame`|
|Alternate Location| `UE4Editor.exe "[ProjectPath]\[ProjectName].uproject"`|
[/PUBLISH:Licensee]
[PUBLISH:Rocket]
[OBJECT:ToggleButtonContent]
[PARAMLITERAL:category]
OS
[/PARAMLITERAL]
[PARAMLITERAL:id]
windows
[/PARAMLITERAL]
[PARAMLITERAL:active]
active_button_content
[/PARAMLITERAL]
[PARAM:content]
1. From a command prompt, navigate to your `[LauncherInstall]\[VersionNumber]\Engine\Binaries\Win64` directory.
1. Run the `UE4Editor.exe` passing it the path to your project:
UE4Editor.exe "[ProjectPath]\[ProjectName].uproject"
[/PARAM]
[/OBJECT]
[OBJECT:ToggleButtonContent]
[PARAMLITERAL:category]
OS
[/PARAMLITERAL]
[PARAMLITERAL:id]
mac
[/PARAMLITERAL]
[PARAMLITERAL:active]
[/PARAMLITERAL]
[PARAM:content]
1. From a command prompt, navigate to your `[LauncherInstall]/[VersionNumber]/Engine/Binaries/Mac` directory.
1. Run the `UE4Editor.app` passing it the path to your project:
open UE4Editor.app --args "[ProjectPath]/[ProjectName].uproject"
[/PARAM]
[/OBJECT]
[/PUBLISH:Rocket]
### Running the Editor From the Executable
[PUBLISH:Licensee]
1. Navigate to the `\Engine\Binaries\Win64` directory of your `UE4` directory.
1. **Right-click** on the `UE4Editor.exe` executable and choose **Create shortcut**.
1. Rename the shortcut to reflect the game it will run and the fact that it will launch the editor, i.e. **MyGameEditor.exe**.
1. **Right-click** on the newly created shortcut and choose **Properties**.
1. Add the name of the game to run as an argument at the end of the **Target** property:
|Project Location|Target|
|----------------|--------------|
|UE4 Root | `[UE4Directory]\Engine\Binaries\Win64\UE4Editor.exe MyGame`|
|Alternate Location| `[UE4Directory]\Engine\Binaries\Win64\UE4Editor.exe "[ProjectPath]\[ProjectName].uproject"`|
1. Press **OK** to save the changes.
1. **Double-click** the shortcut to launch the editor.
[/PUBLISH:Licensee]
[PUBLISH:Rocket]
[OBJECT:ToggleButtonContent]
[PARAMLITERAL:category]
OS
[/PARAMLITERAL]
[PARAMLITERAL:id]
windows
[/PARAMLITERAL]
[PARAMLITERAL:active]
active_button_content
[/PARAMLITERAL]
[PARAM:content]
1. Navigate to your `[LauncherInstall]\[VersionNumber]\Engine\Binaries\Win64` directory.
1. **Right-click** on the `UE4Editor.exe` executable and choose **Create shortcut**.
1. Rename the shortcut to reflect the game it will run and the fact that it will launch the editor, i.e. **MyProject - Editor.exe**.
1. **Right-click** on the newly created shortcut and choose **Properties**.
1. Add the name of the game to run as an argument at the end of the **Target** property:
[LauncherInstall]\[VersionNumber]\Engine\Binaries\Win64\UE4Editor.exe "[ProjectPath]\[ProjectName].uproject"
1. Press **OK** to save the changes.
1. **Double-click** the shortcut to launch the editor.
[/PARAM]
[/OBJECT]
[OBJECT:ToggleButtonContent]
[PARAMLITERAL:category]
OS
[/PARAMLITERAL]
[PARAMLITERAL:id]
mac
[/PARAMLITERAL]
[PARAMLITERAL:active]
[/PARAMLITERAL]
[PARAM:content]
The editor must be run [from the command prompt](#RunningtheEditorFromtheCommandLine) to load a specific project directly or [with no arguments](#RunningtheEditorwithNoArguments_Stand-Alone_) to access the Project Browser.
[/PARAM]
[/OBJECT]
[/PUBLISH:Rocket]
### Running the Editor with No Arguments (Stand-alone)
If the editor is not set to open the most recent project at startup, running the editor executable without any arguments will launch the Project Browser. From here, you can
[create a new project](Engine/Basics/Projects/Browser#creatingnewprojects), [open your existing projects](Engine/Basics/Projects/Browser#openingprojects),
or open [content examples and sample games](Resources).
[/EXCERPT:RunEditor]
## Running an Uncooked Game
Once a project is loaded in Unreal Editor, you can [test your gameplay](Engine/UI/LevelEditor/InEditorTesting#modes) in Uncooked Game mode from the **Play In** menu.
To play the uncooked game in its own window, select the [**New Window At** > **Default Player Start** mode](Engine/UI/LevelEditor/InEditorTesting#modes) using
the [**Play In** dropdown menu](Engine/UI/LevelEditor/InEditorTesting#toolbar) in the Level Editor toolbar.
**Click to see full-size image:**
[REGION:lightbox]
[![](Engine/UI/LevelEditor/InEditorTesting/PIE_newwindow.png)(w:300)](Engine/UI/LevelEditor/InEditorTesting/PIE_newwindow.png)
[/REGION:lightbox]
Running the uncooked game version of the engine executable using either of the below methods will result in the same behavior.
### Running an Uncooked Game from the Command Line
[PUBLISH:Licensee]
When running the game from the command line, you must specify the game you want to run as an argument to the `UE4Editor.exe` executable via the
**Target** property of a shortcut, as well as specify the `-game` parameter to tell the editor to run in game mode instead of bringing up the editor UI.
1. From a command prompt, navigate to the `\Engine\Binaries\Win64` directory of your `UE4` directory.
1. Run the `UE4Editor.exe -game` passing it the name of the game to run:
|Project Location|Command Prompt|
|----------------|--------------|
|UE4 Root | `UE4Editor.exe MyGame -game`|
|Alternate Location| `UE4Editor.exe "[ProjectPath]\[ProjectName].uproject" -game`|
[/PUBLISH:Licensee]
[PUBLISH:Rocket]
When running from the command line, you must pass the name of the project you want to run along with the `-game` switch as arguments.
[OBJECT:ToggleButtonContent]
[PARAMLITERAL:category]
OS
[/PARAMLITERAL]
[PARAMLITERAL:id]
windows
[/PARAMLITERAL]
[PARAMLITERAL:active]
active_button_content
[/PARAMLITERAL]
[PARAM:content]
1. From a command prompt, navigate to your `[LauncherInstall]\[VersionNumber]\Engine\Binaries\Win64` directory.
1. Run the **UE4Editor.exe** passing it the path to the project to run, along with the `-game` parameter.
UE4Editor.exe "[ProjectPath]\[ProjectName].uproject" -game
[/PARAM]
[/OBJECT]
[OBJECT:ToggleButtonContent]
[PARAMLITERAL:category]
OS
[/PARAMLITERAL]
[PARAMLITERAL:id]
mac
[/PARAMLITERAL]
[PARAMLITERAL:active]
[/PARAMLITERAL]
[PARAM:content]
1. From a command prompt, navigate to your `[LauncherInstall]\[VersionNumber]/Engine/Binaries/Mac` directory.
1. Run the **UE4Editor.app** passing it the path to the project to run, along with the `-game` parameter
open UE4Editor.app --args "[ProjectPath]/[ProjectName].uproject" -game
[/PARAM]
[/OBJECT]
[/PUBLISH:Rocket]
### Running an Uncooked Game From the Executable
[PUBLISH:Licensee]
When running from the executable, you must specify the game you want to run as an argument to the `UE4Editor.exe` executable via the
**Target** property of a shortcut, as well as specify the `-game` parameter to tell the editor to run in game mode instead of bringing up the editor UI.
1. Navigate to the `\Engine\Binaries\Win64` directory of your `UE4` directory.
1. **Right-click** on the `UE4Editor.exe` executable and choose **Create shortcut**.
1. Rename the shortcut to reflect the game it will run and the fact that it will launch the editor, i.e. **MyGameUncooked.exe**.
1. **Right-click** on the newly created shortcut and choose **Properties**.
1. Add the name of the game to run as an argument at the end of the **Target** property:
|Project Location|Target|
|----------------|--------------|
|UE4 Root | `[UE4Directory]\Engine\Binaries\Win64\UE4Editor.exe MyGame -game`|
|Alternate Location| `[UE4Directory]\Engine\Binaries\Win64\UE4Editor.exe "[ProjectPath]\[ProjectName].uproject" -game`|
1. Press **OK** to save the changes.
1. **Double-click** the shortcut to launch the editor.
[/PUBLISH:Licensee]
[PUBLISH:Rocket]
[OBJECT:ToggleButtonContent]
[PARAMLITERAL:category]
OS
[/PARAMLITERAL]
[PARAMLITERAL:id]
windows
[/PARAMLITERAL]
[PARAMLITERAL:active]
active_button_content
[/PARAMLITERAL]
[PARAM:content]
When running from the executable, you must specify the path to the project you want to run along with the `-game` switch as arguments to the
executable via the **Target** property of a shortcut.
1. Navigate to your `[LauncherInstall]\[VersionNumber]\Engine\Binaries\Win64` directory.
1. **Right-click** on the **UE4Editor.exe** executable and choose **Create shortcut**.
1. Rename the shortcut to reflect the game it will run, i.e. **MyProject.exe**.
1. **Right-click** on the newly created shortcut and choose **Properties** to display the properties of the shortcut.
1. Add the full path to the project to run as an argument at the end of the **Target** property, and specify the `-game` argument to run as a game:
[LauncherInstall]\[VersionNumber]\Engine\Binaries\Win64\UE4Editor.exe "[ProjectPath]\[ProjectName].uproject" -game
Press **OK** to save the changes.
1. **Double-click** the shortcut to run the game.
[/PARAM]
[/OBJECT]
[OBJECT:ToggleButtonContent]
[PARAMLITERAL:category]
OS
[/PARAMLITERAL]
[PARAMLITERAL:id]
mac
[/PARAMLITERAL]
[PARAMLITERAL:active]
[/PARAMLITERAL]
[PARAM:content]
The editor must be run [from the command line](#RunningtheEditorfromtheCommandLine) to load a specific project directly.
[/PARAM]
[/OBJECT]
[/PUBLISH:Rocket]
## Running a Cooked Game
[INCLUDE:Engine/Basics/Projects/Packaging#runcooked]
See [](Engine/Basics/Projects/Packaging) for more information on how to package and run cooked game builds.
## Useful In-Game Commands
When you are running the game, there are a multitude of **console commands** you can use in the console inside the game.
The console can be summoned by pressing the **~ (tilde)** or **Tab** keys. Some of the most useful commands are listed
below.
$ EXIT/QUIT :
Exits the game; closing down the engine.
$ DISCONNECT :
Exits the game; returning to the main menu (if one is present).
$ OPEN [MapURL] :
Loads a new map using the specified URL using all previous settings. A URL is a map name (without the file extension) followed by an optional list of parameters which can be used to specify certain options, such as the gametype, player class, player name, team number, etc.
$ TRAVEL [MapURL] :
Loads a new map using the specified URL and resets all settings. See above for a description of map URLs.
$ VIEWMODE [Mode] :
Sets the rendering mode of the game viewport to the specified mode. The available modes are:
| Mode | Description |
| ---- | ----------- |
| WIREFRAME | Shows the wireframe of all meshes. |
| UNLIT | Renders meshes using only the diffuse channel of materials. |
| LIT | Default. Renders meshes using their materials being affected by lighting. |
| DETAILLIGHTING | Renders meshes using a neutral-colored material with normals being affected by lighting. |
| LIGHTINGONLY | Renders meshes using a neutral-colored material without normals being affected by lighting. |
| LIGHTCOMPLEXITY | Renders meshes using a solid color based on the number of dynamic lights affecting the mesh. Black means no dynamic lights affect the mesh. As more lights affect the mesh, the color goes from green to red. |
| SHADERCOMPLEXITY | Renders meshes using solid colors based on the number of shader instructions executed by the material applied to the surface. The colors range from green (0) to red (300) to pink (600) to white (900). |
## Loading Maps
It is possible to specify a particular map to load when running the engine or editor or load a new map while running
the engine. This can be useful for testing by quickly jumping into the map you want to test without needing to make
your way through a series of menus.
### Loading Maps at Startup
The engine will always attempt to load a default map when it is run. This map is specified in the `DefaultEngine.ini`
config file located in the `Config` folder of your game project. The map to run by default is set using the **Map**
property in the `[URL]` section of the .ini file. As an example, VehicleGame has the following in its `DefaultEngine.ini`
file:
[URL]
...
Map=/Game/Maps/VehicleMenu
...
This will cause the `VehicleMenu.umap` (located in `[UE4Directory]\VehicleGame\Content\Maps`) to load at startup unless it is overridden. Generally, you will want to
specify the map that loads or is used as the background for your main menu as the default map.
[PUBLISH:Licensee]
To override the default map, you can pass in a map name (without the file extension) as a command line argument. It
was mentioned previously that you must specify the game name on the command line. Following these, you can also specify
a map name to force the engine to load a map other than the default. For instance, the following command line could be
used to load the engine in uncooked game mode running the `ExampleMap` map:
UE4Editor.exe [Gamename] ExampleMap -game
[/PUBLISH:Licensee]
[PUBLISH:Rocket]
To override the default map, you can pass in a map name (without the file extension) as a command line argument. It
was mentioned previously that you must specify the project name on the command line. Following these, you can also specify
a map name to force the engine to load a map other than the default. For instance, the following command line could be
used to load the engine running the `ExampleMap` map:
[OBJECT:ToggleButtonContent]
[PARAMLITERAL:category]
OS
[/PARAMLITERAL]
[PARAMLITERAL:id]
windows
[/PARAMLITERAL]
[PARAMLITERAL:active]
active_button_content
[/PARAMLITERAL]
[PARAM:content]
~~~
UE4Editor.exe "[ProjectPath]\[ProjectName].uproject" ExampleMap -game
~~~
[/PARAM]
[/OBJECT]
[OBJECT:ToggleButtonContent]
[PARAMLITERAL:category]
OS
[/PARAMLITERAL]
[PARAMLITERAL:id]
mac
[/PARAMLITERAL]
[PARAMLITERAL:active]
[/PARAMLITERAL]
[PARAM:content]
~~~
open UE4Editor.app --args "[ProjectPath]/[ProjectName].uproject" ExampleMap -game
~~~
[/PARAM]
[/OBJECT]
[/PUBLISH:Rocket]
[PUBLISH:Licensee]
The same concept works when running the editor. Specifying the name of the map to load following the `editor` argument
will load that map when the editor opens instead of the default or blank map. To load the editor with the `ExampleMap`
map loaded, the following command line can be used:
UE4Editor.exe [GameName] ExampleMap
[/PUBLISH:Licensee]
[PUBLISH:Rocket]
The same concept works when running the editor. Specifying the name of the map to load will load that map when the
editor opens instead of the default or blank map. To load the editor with the `ExampleMap` map loaded, the
following command line can be used:
[OBJECT:ToggleButtonContent]
[PARAMLITERAL:category]
OS
[/PARAMLITERAL]
[PARAMLITERAL:id]
windows
[/PARAMLITERAL]
[PARAMLITERAL:active]
active_button_content
[/PARAMLITERAL]
[PARAM:content]
~~~
UE4Editor.exe "[ProjectPath]\[ProjectName].uproject" ExampleMap
~~~
[/PARAM]
[/OBJECT]
[OBJECT:ToggleButtonContent]
[PARAMLITERAL:category]
OS
[/PARAMLITERAL]
[PARAMLITERAL:id]
mac
[/PARAMLITERAL]
[PARAMLITERAL:active]
[/PARAMLITERAL]
[PARAM:content]
~~~
open UE4Editor.app --args "[ProjectPath]/[ProjectName].uproject" ExampleMap
~~~
[/PARAM]
[/OBJECT]
[/PUBLISH:Rocket]
[REGION:tip]
The map name can also be a full map URL specifying additional settings such as the GameMode. Settings are appended
to the map name as key-value pairs separated by a `?`. For example:
DM-Deck?Game=CaptureTheFlag
[/REGION]
### Loading New Maps
If you want to load a new map during play, in order to test during development or even to switch maps during gameplay,
this can be done using the `OPEN` or `TRAVEL` console commands followed by the name of the map (without the file extension)
to load.
[REGION:note]
The difference between the `OPEN` and `TRAVEL` commands is described above in the [Useful In-Game Commands](#UsefulIn-GameCommands) section.
[/REGION]
The commands below load the DM-Deck map during play with the same settings or settings reset, respectively:
open DM-Deck
Or
travel DM-Deck
<!--
[PUBLISH:Licensee]
## Running the Game with Cooked Content
The executable for your game requires cooked content to run.
### Run from Command Line
1. From a command prompt, navigate to the `\Binaries\Win32` directory of your game's directory.
1. Run the **[GameName].exe**
[GameName].exe
### Run from Executable
1. Navigate to the `\Binaries\Win32` folder of your game's directory.
1. **Double-click** the **[GameName].exe** to run the game.
[/PUBLISH:Licensee]
-->
[/EXCERPT:Main]