Git Build with plugins
Approved for Versions:4.11+
- 1 Overview
- 2 Getting Started
- 3 GitHub Web Setup
- 4 Software Installation
- 5 Configure and Build Source
- 6 Add Plugins to Base Source Engine
- 7 Plugin / Engine Upgrades
- 8 That's all folks
Tired of having to put Rama's excellent VictoryBPLibraries into all of your projects manually? How about building a Git source that includes your favorite plugins. This means when new projects are created, the plugins are already there.
Even if you decide not to add plugins to your project, you can use the steps here to create a source build of the engine.
This tutorial is aimed at beginners so I will go through the entire process. A support / comments / suggestion forum thread is here.
You must have an Epic Games account, if you don't head over here. Also needed will be Github and Microsoft account for Visual Studio 2015 Community Edition. Github account creation will be covered, but Microsoft will not be because it is not necessary, but recommended.
Unreal Launcher: The launcher has a top row of items for Epic Games major initiatives, but we'll be hanging out in the Unreal Engine tab. Finally, there are four sub-sections in the left hand column: Community keeps you updated on important UE4 news. Learn is a great place to find tutorials. Marketplace is great for art assets and blueprint programming projects, and finally, the Library. This is where you projects and purchased (Vault) items are stored.
Visual Studio 2015 Community: Microsoft Visual Studio 2015 Community Edition is a development environment for the creation of all sorts of applications, from C#, C++ to web applications. For our purposes, we only need C++ which is not installed by default.
Github Desktop Windows Client: Github will be our access to the Unreal Engine 4 source code.
You should have fast multi-core PC as compiling can take a long time. Visual Studio will use all of the cores that it finds (at least for Intel) but does not seem to take advantage of hyper-threading. Additionally, you will need about 45GB of disk space for the Unreal Engine 4 source so keep that in mind for source directory destination. Finally, Epic recommends 32GB of RAM, but if that is not possible try to at least have 16GB.
For the purposes of this tutorial, I'm running VMWare Workstation 12 Windows 7 VM with 2 vCPU's and 16GB of RAM. My compile time took 1.25 hours. Horrible, and I should have added additional vCPUs and stored the VM files on my SSD drive!
More information from Epic about recommended hardware (slightly outdated) can be found here.
GitHub Web Setup
Linking Epic and Github Accounts
Head over to Github and create an account. You will see the green SIGN UP button in the top right hand corner of the web page. Once the necessary information is filled out, the free personal plan is pre-selected. Click continue. Finally, just skip the next step if you want or provide the requested information.
Now that Github has been setup, head back to your Epic user settings page here. Make sure to be in the profile section and look for Github account name and put in the account name used above.
Head back over to Github and click on the button view invitation in the top right hand corner and then click on Join Epic Games. Epic has two repositories, UnrealEngine and UnrealTournament, click on UnrealEngine.
Unreal Engine 4 - Fork Creation
Now that you have been granted access to the UnrealEngine repository, you will need to "fork" a copy to your GitHub account that you just created above. To do that you first need to change the GitHub dashboard to the EpicGames organization. See screenshot below:
Once you have selected the EpicGames organization you will be taken to their dashboard which looks like the screenshot below.
In the top right hand corner of their dashboard click on Fork. You will be given a choice to select where you want to fork the code to and the only option is your GitHub account. Simply click on it and a few minutes later your own Github account will have a repository named: YourAccountName/UnrealEngine. We're pretty much done here, so let's move to software installation.
We need to install our software in the recommended order:
- Unreal Launcher
- Visual Studio 2015
- Github Desktop Client
What does this have to do with Unreal Engine 4? Well...It turns out that some patches are needed by both the Unreal Editor and Visual Studio 2015 and you might as well update before getting the dreaded MISSING PREREQUISITES message. Besides, we all know how secure Windows is? Yeah, right. Best to be updated.
The Unreal Launcher is very easy to install, simply click on the download that was done above and follow the prompts. Once installed, the launcher will ask you for your username and password, enter them in. That's it!
Visual Studio 2015 Community Edition
There is a little more work involved with the installation of Visual Studio 2015. The first and most important consideration is to ensure that you select C++ from the installation dialog box. Run the executable from the download above to start the installation process. Be sure to select custom installation (see below screen shot).
The next screen is very important because you will need to manually select C++ as shown below.
As you can see, I've selected the Visual C++ option. I did deselect Windows XP Support for C++ because who uses XP anymore? All of the other options are up to you.
Click next and head to your favorite coffee shop...It will be awhile! Once done, it will ask you to restart. Restart and now onto Github Desktop installation and configuration.
Github Desktop Installation
Head to the downloads directory and run GitHubSetup. Super easy process and when the installation is completed, double-click on the GitHub icon on the desktop. The below screen shot is what the screen will look like.
Enter GitHub account information and click Log in.
The next screen will ask to Configure git. It should default to the account information put in in the previous step...Keep in mind that the email address will be public if there are any published commits. Click Continue.
A welcome screen will be displayed but no repositories. Well, we're going to fix that! Click on the dashboard link to get started.
Clicking the dashboards link will display your personal dashboard of repositories. A tutorial repository has been created and you might want to consider running through it. Its pretty nifty!
From your personal dashboard, click on + and select clone. See screen shot below.
Make sure to select the fork inside your organization, in my case, 837studios. Then, click on UnrealEngine and click on Clone UnrealEngine.
A dialog box will come up and ask where to store the local copy, select a disk with plenty of space.
Depending on internet connection speed this could take quite awhile. I've got a 150MB Comcast (argh!) connection and it took about 5 minutes. When completed, the screen should look like the below screenshot.
Configure and Build Source
There are a few things we need to do before we actually compile the source. The first is download the prerequisites and then generate Visual Studio 2015 project files.
Go to the root of your source by clicking open this repository in Explorer from the GitHub Desktop Client.
Right click on Setup.bat and Run As Administrator. It will download about 4GB of dependencies, so you might want to head back to your favorite coffee shop if your internet connection is stinky. After the download completes you will see it Installing prerequisites and the command prompt will close.
Generate Project Files
The next step is to GenerateProjectFiles and luckily, a trip to the coffee shop is not required. Right click on the batch file GenerateProjectFiles and Run As Administrator. A command prompt window will be displayed for about 10 seconds and disappears. Gasp! We're now ready to go into Visual Studio 2015 and compile the source.
Visual Studio Prep Work
We're now ready to compile the source inside of Visual Studio 2015. In the repository directory, double-click on the UE4.SLN (Solution File) and Visual Studio 2015 will load. As with most Microsoft products, they want to gather important advertising statistics <cough> I mean important Visual Studio targeted information, so create an account or login with your current Microsoft account.
While Visual Studio is parsing files in our solution, let's setup Visual Studio 2015 with some recommended settings. There is already a very good article located here. Ignore anything to do with Visual Studio 2013. Be sure to install the UE4 plugin for Visual Studio because it will save time when needing to regenerate project files.
When you are done following the tutorial above, you should have a screen that looks like mine below.
We're now finally ready to compile the source code. Right click on UE4 under Engine and click build. Even if you have the fastest computer on the planet (perhaps not Mars) then a trip to the coffee shop might be in order. As I've said early, my virtual Windows PC took over an hour! Normally, it takes about 25 minutes on my i7 workstation.
In the output window you will see a ton of stuff fly by, this is completely normal. If successful, the final line will look like the screen shot below. If you see a number next to failed, a step might have been missed.
Create Shortcut / First Time Run
Since a source engine can not be added to the launcher, the easiest way to access the editor is to go to GitHub dashboard and open in explorer and then: \Engine\Binaries\Win64 and create a shortcut for UE4Editor.exe on your desktop. You also might want to make a short cut for UE4.SLN on your desktop for easier access to UE4 source build in Visual Studio.
Double-click on the newly created short cut and watch and gasp as the editor is stuck at 45%!! No, nothing is wrong, it will only hang at 45% the first time the editor is loaded. Once the project browser is loaded, shaders will be compiled.
Congratulations, you now have a working Unreal Engine 4.11.2 source installation. Now, let's move to adding Rama's plugin.
Add Plugins to Base Source Engine
GitHub Web Site
Its time to head back to GitHub and fork the plugins we want to include in our base source engine. In search box type VictoryPlugin and then click EverNewJoy/VictoryPlugin. It will take to a screen that looks similar to the Unreal Engine repository. You already know what to do...Click Fork and select your account. That's it!
GitHub Desktop Client
Open the GitHub Desktop Client and click the + key again and select Clone. VictoryPlugin is now part of the repositories. Select it and click Clone repository. Select a location to store the source code. It should default to the directory GitHub. Cloning is much faster than Unreal Engine!
Click on open this repository in explorer and go up one level and right-click and select copy on the directory VictoryPlugin and then paste into the .\Engine\Plugins\Runtime directory.
Visual Studio Build
Click on the UE4.sln shortcut that you created on the desktop and go into Visual Studio. This is where the Unreal Visual Studio plugin comes in handy. In the top right hand corner of Visual Studio, locate two green arrows pointing to each other in a circle and click on it. A dialog box will appear, click on Reload All.
If you do not have the Unreal Plugin loaded, go to your repository directory and click on GenerateFiles.bat.
The final step is to build the code into our base engine. Right click on UE4 in the solution explorer and select build. Don't worry, a coffee break will not be necessary because its smart enough to only compile the new code.
Double click on the UE4Editor shortcut and create a new project (can be anything). Once inside the editor, go to File->Plugins. And, if everything worked, it should look like the screen shot below.
TaDa! You did it... Only a couple of small things we need to do and you can finally leave this joint!
GitHub Desktop Final Steps
Go back into the GitHub Desktop Client and click on the UnrealEngine repository in the left hand column. There should be ~18 changes as of 4/30/2016. In the summary box, put in VictoryPlugin Addition and click Commit to release. Once its committed, you will need to update your repository at GitHub.com. Click Sync in the brown area of the GitHub Desktop client. Head back to GitHub and view the commit. Pretty awesome!
Final Notes on Plugins
Plugin / Engine Upgrades
Most plugins will be updated from time to time and its important to check the state of the source code. If the plugin is stored on your GitHub repository, upgrading is very easy. To check if there is an upgrade, open your GitHub Desktop Client and see if the Update from xxxxxx/master is highlighted. See below.
Good news for us is that Rama upgraded his plugin to include new functionality. Click on the Update from EverNewJoy/master and it should become darker. Click on History to see the updates.
Go back into Visual Studio and refresh your project. Then, right-click on UE4 in solution explore and select Build. The build should be much shorter but there will be a delay when starting up the editor for the first time. Last thing is to sync your changes back to GitHub.com. Select the plugin that you updated (in this case, VictoryPlugin) and click sync.
Most likely, UnrealEngine will need to be synced as well, before syncing, click on UnrealEngine and click on Changes. If there are any files that need to be committed go ahead and do so now. I named mine, VictoryPlugin Update. Once the commit has been created, click Sync.
Unreal Engine 4 Upgrade
Engine upgrades are similar to the above procedure, except you click the UnrealEngine repository, click Upgrade from Epic/release. Once upgrade has been completed, load up Visual Studio, refresh project and build. Oh! And, one last thing, make sure to sync so that GitHub.com is updated. That's pretty much it!
That's all folks
I hope this tutorial has helped in some way...! Support / Comment / Suggestion Thread here.