class PlaygroundGame extends GameInfo;
event PostLogin( PlayerController NewPlayer )
{
super.PostLogin( NewPlayer );
NewPlayer.ClientMessage( "PlaygroundGame: Welcome " $ NewPlayer.PlayerReplicationInfo.PlayerName);
}
defaultproperties
{
}
This simply defines our own GameInfo class where we can host all the logic that determines the rules of our current game mode.
In the sample above, we've overridden the PostLogin event which gets called whenever a new player joins the game. We send that player a message that shows up on screen so that we know everything is working.
Take a moment and compile your scripts now. This will enable the editor to see our game mode so that we can try it out. Once scripts are done compiling, and no errors occurred, we're ready to try out our new game mode.
There are actually 2 ways to do this. The first, which is more manual, is to define the game type on a per-map basis. Go ahead and launch the editor and leave the default map open. Click on View->World Properties. This launches a properties panel that displays all of the available options for this map.
Expand the GameType panel and you'll see something that looks like the following:

This is where we can define the GameInfo class to use for this map. You have two options. The first is to change the 'Default Game Type' which will determine the GameInfo class to use when the game is launched regularly. The other option 'Game Type for PIE' is the GameInfo class that will be used when you Play In Editor (PIE). For now, we'll assign both of them to new 'PlaygroundGame' class.

If you launch your game now, you'll see our custom message displayed to the user.

The second way to setup a game type is to assign a 'default' globally. That is, all maps, when no game type is specified, will use this setting as its default. Right now, it is assigned to UDKGame.SimpleGame but we'll modify that so it now uses our custom GameInfo class.
Make sure the editor and the game aren't running. This is a MUST when you are editing INI files are their settings won't take effect until the next time you run.
Open up DefaultGame.ini from inside the UDKGame\Config directory and search for the [Engine.GameInfo] section.

We want to overwrite the DefaultGame and DefaultServerGame with our own custom game type. In this case, our package is named 'Playground' and the GameInfo derived class is called 'PlaygroundGame'. So we'll specify 'Playground.PlaygroundGame' as our DefaultGame and DefaultServerGame type.

We can now launch any map without having to specify the Game Type in the World Info properties and it will use our game type. In any map, if we do specify the Game Type, that will take priority. This is the method I will be using as my game will only be supporting one main game mode for now. In the future, we can always change it since it can be overridden per map.