Unreal engine build types

You will note that if you open an Unreal Engine game project in Visual Studio you will be presented with the following build options:

  1. DebugGame
  2. DebugGameEditor
  3. Developement
  4. DevelopementEditor
  5. Shipping

The editor build can be attached to and loaded to the Unreal Editor. There is off course some overhead associated with this.

The non-editor bulds are stand alone builds that you can run out of the editor. To run these builds you would need to cook content for the given platform in the editor through File-> Cook content for [Platform].

The debug game options are the least optimized and allow access to all variables during debug, while the development options are semi optimized and the shipping option is fully optimized.

2016-04-03 14_00_34-SampleProject - Unreal Editor.png

The shipping build is the actual game you distribute for a given platform. This has full optimization on no debugging features.

The unreal editor has a compile option that will create new binaries for a DevelopementEditor build.

Random UE snippets (C++)

On this thread I am going to post a bunch of random Unreal Engine snippets I make use of
Make calls easier by redefining them

#define print(text) if (GEngine) GEngine->AddOnScreenDebugMessage(-1, 1.5, FColor::White,text)

Convert Fstring to std::string and vice-versa

std::string cppString = "Sample string";
FString ue4String(cppString.c_str());

FString ue4String2 = "Flowers";
std::string cppString2(TCHAR_TO_UTF8(*ue4String2));

Convert int/float to FString and vice-versa

FString ue4String = "123.021";
int32 intValue = FCString::Atoi(*ue4String);
float floatValue = FCString::Atof(*ue4String);

FString ue4String2 = FString::FromInt(intValue);
FString ue4String3 = FString::SanitizeFloat(intValue)

Reading and writing to config files in UE

Configuration files are a nice way to store various game variables in Unreal Engine games. They are particularly good in that you can make changes to parameters in them and not have to compile/build you game again. Your power users could even tweak things by making changes to these parameters.

Unreal comes with a bunch of configuration files that you can find under [Game Location]\Saved\Config\Windows

Below is a screenshot indicating the config files I have by default on creating a new blank project

configuration files

Reading from config files:

You can read any parameter from these files by making use of GConfig as shown below:

 if(!GConfig) return;

 FString value;


 UE_LOG(LogTemp, Log, TEXT("%s"),*value);

In this example we intend to read the MouseControlLabelPosition value under the catergory /Script/UnrealEd.LevelEditorPlaySettings from the file EditorPerProjectUserSettings.ini.

We call the GeString method in this case because the target value is a string, you have other options such as GetBool etc. The first argument you pass in is the section name. Take a look at the screenshot below showing what the file contents look like. The second argument is the name of the parameter you want to read. The third argument is the variable you want to store the result into, note we have made this an FString. The fourth argument is a const for the file we want to read in this case for EditorPerProjectUserSettings.ini it is GEditorPerProjectIni.

configuration file sample.png

Writing to config files:

In the example below we will write to the config file Game.ini and create a new section called Sample.Section.

if (!GConfig) return;

FString newSection = "Sample.Section";

Note that on completion we called GConfig->Flush. This is to ensure that any data held in buffers is flushed to the target config file.

Sending debug messages in UE

One thing that really comes handy during debugging is being able to send messages to yourself say in a log window or the game screen even. You may for instance want to know what data your actor is operating on. This is really easy to do in Unreal Engine.

To send messages to the console:

UE_LOG(LogTemp, Log, TEXT("Sample debug %s."),"message");

LogTemp is the default category for temporary log messages.
Log represents ordinary log messages that will be shown in grey. You have the option from:

  • Log (grey)
  • Warning (yellow)
  • Error (red)

The last two parameters represent the log message format and arguments. Optionally you can you the format as the actual log message.

To send a message to the game screen:

GEngine->AddOnScreenDebugMessage(-1, 15, FColor::Red, "Sample debug message.");

You make use of GEngine to log messages to the screen by calling AddOnScreenDebugMessage. The first parameters is a key (-1 represents messages that can be repeated each shown individually, inverse being key 0). The second parameter is the number of seconds to display the message for. The third parameter is an FColor representing the color you would like to show the message in. The last parameter is the debug message you would like to show.

There is one disadvantage to sending messages to the game screen. These messages are displayed for a limited amount of time and you cannot go back to review these messages at a later stage.