The three virtues of a programmer: Laziness, Impatience, and Hubris. – Larry Wall
UE3:Setting Up Configuration Files for a New Game Project Tutorial (UDK)
From Unreal Wiki, The Unreal Engine Documentation Site
 Setting Up Configuration Files for a New Game Project
This is a step-by-step tutorial explaining precisely how to setup the configuration files for a new Game Project for the UDK after installing the software and setting up your coding environment and folder structure.
This tutorial was created using the January 2012 version of the UDK.
 Things to Remember
- I'll say it again, this tutorial was created using the January 2012 version of the UDK. There is no guarantee this will work for previous releases or newer ones that come down the pipeline. The UDK is still technically in Beta, and the basic setup can and most likely will continue to change somewhat over time. I will attempt to keep this guide updated as new editions are released.
- This tutorial assumes you know how to download and install the UDK, and have already done so.
- The UDK isn't designed for multiple games to be developed from one installation. This is something I had to find out by reading random guides around the internet. I don't believe the online documentation mentions this, and I believe this still holds true.
- Don't be afraid to start over. This means backing up the configuration files folder and starting from scratch; if you don't have anything you want to keep, don't hesitate to blow everything away and begin again until you get it right. It took me quite a few attempts to get this right, while piecing together information from outdated tutorials around the web with incomplete and out-dated online documentation from Epic.
- I'm assuming you want to setup your game as an extension of the already provided code-base and configuration files that come with the UDK. This is how most people will setup their new game project.
- I'm not an expert yet, so if I make any mistakes, please correct them and comment as to why on the discussions page.
 Step 1: Finding and Changing the Configuration Files
- There is a decent page on the UDN explaining in a very quick and dirty way the directory structure for the UDK. [UDN Documentation on Directory Structure]
- Specifically for today, we'll be looking at a few locations in the config folder. [UDN Config Folder Description]
- First, navigate to your Config folder, which should be similar to C:\UDK\UDK-2012-01\UDKGame\Config | (UDK_Installation_Root\UDKGame\Config)
- You should be seeing something very similar to this:
 Making the Change
- Open the file DefaultEngineUDK.ini
- There are two sections we're looking for. One is called [Core.System] and the other is [UnrealEd.EditorEngine]
- Those sections are displayed here:
- If you have trouble locating the sections, use the "Find" function of notepad by pressing Ctrl+F and searching for the section's title.
- Starting with the [Core.System] section, I'm going to have you add a line at the very top. Add "+Paths=..\..\MyGameProject\Content" without the quotes. Also, replace 'MyGameProject' with whatever game name you want, just remember what you entered.
- It wont matter where you add the line, as long as it begins with the '+' sign and is in the correct section. The '+' sign denotes you are adding another value of key-type 'Paths' into the [Core.System] section.
- Your DefaultEngineUDK.ini file should now look similar to this (I've added the red outline to indicate the addition):
- Save and close the configuration file.
 Why We Did This
- You might be asking, "Why did I just add that line?" Adding this line tells the UDK to look for packages (files ending in .upk that hold game assets and maps) and add them to the content browser every time you launch the UDK executable. Cool, huh?
 Creating the New Content Directory Structure
- Now you need to create the folders you've just pointed to in the Configuration file, and populate them with a .upk file and test it out. If you launch the UDK right now, it won't be any different, as the folders don't even exist.
- Navigate to the base UDK installation folder, which should be similar to C:\UDK\UDK-2012-01 | (UDK_Installation_Root). If you're in the correct place, you should see something very similar to this folder structure:
- Now create a new folder in this directory and name it whatever you entered for "MyGameProject" previously in the Config file, without the quotes. It has to be the same, although it doesn't need to be case-sensitive.
- Inside the new folder you just created, create another folder and name it "Content" without the quotes.
- Your new folder structure should look like this (I've added the red box to indicate the new folders):
 Populating the Content Folder
- Before the UDK will care about your Configuration File changes, or the new folders you've just made, you need to copy a .upk file to the new Content folder.
- Navigate to C:\UDK\UDK-2012-01\UDKGame\Content or its equivalent on your machine, and copy any .upk file you desire (smaller is better, but not necessary).
- Paste the .upk file you just copied back into the C:\UDK\UDK-2012-01\MyGameProject\Content folder of its equivalent on your machine, rename it (as otherwise there'll be a conflict) and launch the UDK.
- If you've done everything correctly, you should be able to open the content browser, and see the new folders and the .upk file on the bottom left of the content browser. Like this:
 Step 2: Changing the Configuration Files Again
- Step 1 was mostly there to get your feet wet, and also show you how to segregate your game content from Epic's game content. You don't have to do that, but I find it much easier to organize my content that way.
- For Step 2, return to the DefaultEngineUDK.ini file and locate the [UnrealEd.EditorEngine] section mentioned previously. I asked you to close the file and forget about it earlier so you'd have an opportunity to navigate to the folder and locate the file again yourself. If you can't remember where it was, read through Step 1 for a refresher.
- Within the [UnrealEd.EditorEngine] section, you should notice a few entries that begin with "+EditPackages=" without the quotes. Specifically, for the January 2012 build of the UDK, you will see "+EditPackages=UDKBase" and "+EditPackages=UTEditor". You're going to leave those entries alone, and add another entry similar to what we did in Step 1.
- Add "+EditPackages=MyGameProject" without the quotes, and replace 'MyGameProject' with the folder name you have setup in the Src folder 'C:\UDK\UDK-2012-01\Development\Src\MyGameProject' or its equivalent on your machine.
 Why We Did This
- This line in the [UnrealEd.EditorEngine] section of the DefaultEngineUDK.ini file is looking specifically for *.uc files, which are the script files you're going to be making to create your new awesome game. Script files should always be in subfolders within the Src folder. In case you don't know this yet, Src is short for Source or SourceCode.
- It is necessary to complete Step 2 for a few reasons. First, to have access to your compiled scripts from within the UDK for creating archetypes and changing editable variables; second, to have the option for the UDK to check and see if all of your .uc files are compiled at launch time and optionally compile them before the UDK opens fully; third, to have the option for UnrealFrontend.exe to be used to build your scripts. UnrealFrontend requires its own tutorial, and isn't covered here. Just know that it is used to Build Scripts, Cook Content, Package the Game, and Launch the Game or the UDK.
- If you have no clue what I'm talking about, you should think about creating an account on the UDK forums if you haven't already and posting any clarification questions there. You will usually get a pretty fast turn-around. [UDK Forums]
- Although the scope of this tutorial doesn't cover adding script files and compiling them, you've made a very large step in that direction. You are literally fully setup to start writing code, and adding resources like meshes, sounds, and textures.
- I hope this tutorial helps others out there like me that found many other guides lacking.