Setting up the Environment
Requirements:
UDK 2-2011 is installed and has been run at least once.
Stage 2: Configuring the UDK
NOTE: Some of the following code for the tutorial has been split up to multiple lines due to word wrap. Take into account that some lines that appear to be two lines, should actually be one line.
The UDK comes with a lot of pre-written code, and this code is the basis for any UDK game. To program in the UDK you will be extending from this code, and altering it to suit your needs.
Create a new folder in C:\UDK\UDK-2011-02\Development\Src named after the game you're making, this will hold your game's code, this folder will from now-on be referred to as “Game”, you will have to make the necessary alterations to given instructions later to customise it for your own game.
Create a new folder inside that called "Classes". Create a text file, rename it to Gametype.uc.

Go to the folder C:\UDK\UDK-2011-02\UDKGame\Config and make sure that it is NOT set to "read only" (right click the file, select properties, in the General Tab then untick the Read-only checkbox. Select apply changes to subfolders and files.
All of the files in this folder should be edited with Notepad ONLY! Word and other programs add yucky stuff which will make the UDK choke when trying to recompile the files.
Open DefaultGame.ini, we're going to add some lines.
First we're going to add the gametype we've just made to the file. Do this by Adding the following line just under the other “+DefaultMapPrefixes” lines. The line is one line do not type it in on multiple lines.
+DefaultMapPrefixes=(Prefix="GPX",bUsesCommonPackage=FALSE,GameType="Game.Gametype")
This allows the UDK to “see” our code from inside a map.
NOTE: The UDK works with a system known as “Game Prefixes”, this is where you must add letters to the start of your map filename so that the UDK knows what gametype is associated with it. In this case, the prefix we're going to use is “GPX” (Game PrefiX), and all maps made for the tutorial will be labelled like so: GPX-Mapname.udk.
Add this line below the other GameSpecificMapCycles lines. The line is one line do not type it in on multiple lines.
GameSpecificMapCycles=(GameClassName="Game.Gametype",Maps=("GPX-Box"))
This is the map cycle for our game type. This adds the map GPX-Box (Which you can change to the name of any map you've made) to the gamecycle Game. So if we play our game type with a rotation of maps, it will choose this map. Multiple maps can be added, separated by a comma (no spaces) and each name enclosed in it's own quotation marks.
Now we're going to add our gametype! We will put this at the bottom of the file for easy reference, as you'll probably edit it a few times in the future. Note that any line preceded with a semi-colon (;) is a comment, and will not be read by the engine.
;///////////////
; Game Game Mode
;///////////////
[Game.Gametype UTUIDataProvider_GameModeInfo]
GameMode=Game.Gametype
GameSettingsClass=Game.Gamesettings
GameSearchClass=Game.Gamesearch
PreviewImageMarkup=UI_FrontEnd_Art.GameTypes.___TeamDeathmatch
DefaultMap=GPX-Box
Prefixes=GPX
OptionSet=DM
IconImage=UI_HUD.HUD.UI_HUD_BaseD
IconU=230
IconV=76
IconUL=104
IconVL=113
Now to break this down a little bit. The first line “[Game.Gametype UTUIDataProvider_GameModeInfo]” declares that we want to add a new game type to the UDK.
The lines
“GameMode=Game.Gametype
GameSettingsClass=Game.Gamesettings
GameSearchClass=Game.Gamesearch”
Are files that we will create. They contain the basic information for the game, as well as the pointers to all the other files needed for the game to run.
“PreviewImageMarkup=UI_FrontEnd_Art.GameTypes.___TeamDeathmatch”
Is the image that will pop up when you select the gamemode to play. You can change this image at a later point in time, but it must point to an image that's in an Unreal content package (UPK) this can be done through the Unreal Editor.
“DefaultMap=GPX-Box
Prefixes=GPX”
Sets the default map for the gametype and the prefixes that will be on all maps for this gametype. The prefix and map name can be changed depending on the name and prefix you wish to use for your game.
I'm not a hundred percent sure what the rest of the lines do, except that weird stuff happens (+ errors) if you don't include them. So I just left them at the defaults for a Death Match map.
Next up, the map!
;//////////////
; Box Map
;//////////////
[GPX-Box UTUIDataProvider_MapInfo]
MapName=GPX-Box
PreviewImageMarkup=UI_FrontEnd_Art.MapPics.___Map-Pic-vCTF-Necropolis
Description=<Strings:UTGAMEUI.CampaignBriefing.BriefDesc38>
“[GPX-Box UTUIDataProvider_MapInfo]” Lets the UDK know we want to declare a map.
“MapName=GPX-Box” tells the UDK where to find the map, the map must be in C:\UDK\UDK-2011-02\UDKGame\Content\Maps for this to work.
“PreviewImageMarkup=UI_FrontEnd_Art.MapPics.___Map-Pic-vCTF-Necropolis” is the picture to be shown when the map is selected. At current it shows the picture for Necropolis. This can be changed to another picture, so long as the picture is located in an Unreal content package (UPK), this can be done through the Unreal Editor.
“Description=<Strings:UTGAMEUI.CampaignBriefing.BriefDesc38>” This is the description for the map. It points to another .ini file. I may touch on how to edit this at a later point.
And finally, but certainly not least, is in the DefaultEngine.ini, you must add the line
+ModEditPackages=Game
below the line
+EditPackages=UTGameContent
This will point the UDK to the code so that it can compile it.
Save changes and close both files.
Lastly, you must delete all of the .ini files that start with “UDK”. Don't worry, these files are created from the base files (the ones that aren't preceded by UDK) when the Editor or Game start up, so they're not completely lost. Deleting the files will force the UDK to re-create the child-files, otherwise you probably won't see your changes take place.
Next Tutorial: Finally Programming something!