This new series of posts will be detailing the process of modifying Unreal Engine 4 in order to improve its static lighting capabilities. This series will assume a decent understanding of GitHub, UE4, and Visual Studio, as well as C++. In this first part, we will be describing how to set up the engine and download its source code. In later installments, we will be describing how to manage such a large code base as UE4, our methodology for modifying specific source files, and our specific modifications and improvements to the static lighting system.

Step 1: Gaining Access to the Source Code

In order to gain access to the source code, you first have to create an account on the Unreal Engine website. Once that is set up, you can follow the steps on their GitHub setup page to gain access to the project. You can then fork the project or simply directly download the source code; however, if you want to later submit a merge request, you will have to fork the project.

Once you have the project downloaded on your computer, you will have to run a script that will generate project files for the source code for your specific environment. Most of this information can also be found in the file found at the project’s root directory. In our case, we set up the project on Windows for Visual Studio 2017, and will be detailing that process here. The readme has more information on setting up the project for a Mac environment.

Step 2: Building UE4

In order to generate the project files, run Seutp.bat found in the project root directory. This will download the project binaries. Once this is complete, you can then run GenerateProjectFiles.bat in the same directory. This will generate solution files for Visual Studio. After this is complete, UE4.sln will appear in the project root directory. Opening this file in Visual Studio will load the entire UE4 project. You can then set your solution configuration (their recommendation is Development Editor), set your platform to Win64, and build the UE4 solution. This will build all solutions found in the project, and generate a fresh copy of the Unreal Engine executable at <ProjectRoot>\Engine\Binaries\Win64\UE4Editor.exe. Running this will run a fully functional version of the UE4 editor that you can also debug using breakpoints.

Step 3: Setting Up a Debug Project

Depending on what you’re going to modify within the engine, you will need a specific solution configuration. Different configurations will optimize various parts of the engine, while still leaving certain parts debuggable. You can find a full list of configurations here. Because of our modifications, we have decided to use the Debug Editor configuration. This leaves most of the code unoptimized, but we have the most access to debug symbols.

In addition, we are also using the UnrealVS plugin. The link gives a very in-depth tutorial on installation and use. It allows for quick building of individual projects, as well as the use of command line arguments. It is not necessarily entirely needed, but it is a useful tool. It makes it much easier to run the editor in debug mode as using the -debug flag on the command line allows for on-the-fly changes in the source code.

In the next part of Modifying UE4, we will discuss our modifications in more depth as well as how we determined where our modifications would be in the source code.