UnrealEngine custom build

  • recommend to read first
  • this post covers
    • why we need the custom unreal engine
    • how to access to unreal engine code
    • how to build and configure our custom unreal engine
  • environment
    • Windows / 10
    • Visual Studio IDE / 2017 Community

overview

  • using unreal engine with the Epic Games Launcher means that you can use some parts of unreal engine
    • because, engines provided from Epic Games Launcher are lack of some features ( find more at here )
    • especially, you can only use Client and Server build target with custom unreal engine
  • if you want to use whole of unreal engine, you need to build unreal engine from source code
    • making a project with custom engine, Epic Games Launcher recognizes the project but not the version of engine
    • you can see the Other on the screenshot above, which means that versioning is not meaningful no more
  • for example, suppose you need to seperate your game project into client and server
    • that means, client version of your game only has the feature for client and vice versa
    • build targets supported by engine from Epic Games Launcher are only Game and Editor so you cannot

access

  • accessing to unreal engine repository needs some process below
  • visit epic games page and sign in
  • click PERSONAL in the combo box on your nickname and click CONNECTED ACCOUNTS
    • click CONNECT in the GITHUB box and sign in with your github account
    • then, some mails would be sent to your email and accept them
  • now you can find that you have entered the Epic Games organization
  • visit the unreal engine repository and download or clone it
  • if you want to make custom engine based on a specific version, select the proper branch
  • now you are ready to build custom engine

build

  • before starting, there are some requirements to visual studio IDE
  • execute visual studio 2017 and click Tools/Get Tools and Features...
    • in Individual components tab, you should check the components below
      • .NET Framework 4.5 things
      • .NET Framework 4.6 things
      • VC++ 2015 for desktop things
  • right click the Setup.bat in engine root folder and select Run as administrator
  • execute command prompt and move to engine root folder
    • type GenerateProjectFiles.bat -2017 and enter
    • now you can see UE4.sln is generated and open it with visual studio 2017
  • right click UE4 project and select build
    • it takes soooo long time ( about 1~2 hours )

usage

  • launch any engine on Epic Games Launcher
  • create some project
  • right click uproject and select Switch Unreal Engine version...
  • if the build was successfully done, there is the engine root in combo box
    • if not, find and choose the engine root directory
  • select proper one and it starts generating project files
  • open the [ProjectName].sln and you can check out the UE4 in solution explorer
  • even you would find the Client and Server options in solution configurations
    • this process is required whenever you want to use custom engine
    • hooh ! now you can use your own custom unreal engine !

What is UnrealEngine build target

  • this post covers
    • what is the build target in unreal engine
    • why we need the several build targets
  • environment
    • Windows / 10
    • Unreal Engine / 4.19.2
    • Visual Studio IDE / 2017 Community

overview

  • create new project with Basic Code in cpp tab
  • then you can see the directory like this
  • open the [ProjectName].sln and check out the csharp files whose name are ending up with Target.cs
  • now you may wonder…
    • what the Type = TargetType.Game means
    • what the heck is UnrealBuildTool
    • what is difference between [ProjectName]Target and [ProjectName]EditorTarget
  • do not hurry, first of all, we gonna learn about the build targets

solution-configuration

  • most of you may have developed the game with no manipulation of Solution Configurations
  • when you folds it out, there are several options and each option is explained in this document detailed
    • DebugGame and Development : build output is stand-alone binary file, which has exe extension
    • DebugGame Editor and Development Editor : build output is dynamic link library, which has dll extension
    • Shipping : build output is stand-alone binary file, which has exe extension
  • the difference between
    • DebugGame and Development : the level and depth of debugging features
    • DebugGame, Development and Shipping : output of Shipping is more optimized for the reason of absence of command prompt and screen debug, etc. but, having no assets for the level presentation, both cannot be executed normally

build-target

  • yep, you have seen the Solution Configurations and what they do
  • and there is the way to change the behavior of each configuration by editing the Target.cs files
  • let us change the text Editor into Game in [ProjectName]Editor.Target.cs
  • remove the Binaries folder for checking the build output
  • build our project with Development Editor
  • look at the build output, what happened ? exe file has been generated, not the dll

  • okay, now I would think it is time to tell you how the build works

    • when you select DebugGame or Development, unreal engine does the build based on [ProjectName].Target.cs
    • also, when you select DebugGame Editor or Development Editor, unreal engine will build based on [ProjectName]Editor.Target.cs
    • and the Type in Target.cs file is a key value of build configuration, which is read by UnrealBuildTool
  • as a result, there is no significant difference except for the file names
    • first 5 files are built with Development and Test419.Target.cs with Type = TargetType.Game
    • later 5 files are built with Development Editor and Test419Editor.Target.cs with Type = TargetType.Game

why-it-needed

  • this structure can help you customize build configurations
    • if you need to build for several enviroments, take care of the target files
    • there are many options not only Type value, find at this document
  • typically, the target file is used for building an unreal server
    • at that time, we will use [ProjectName]Server.Target.cs with Type = TargetType.Server
    • because, in the production level, we need a server executing unreal dedicated server

further

  • I will write about unreal server build and combination with aws game lift
  • in the following contents, this post should be useful for you
  • there is a good QnA for these subjects