Book Image

Unreal Development Kit Game Programming with UnrealScript: Beginner's Guide

By : Rachel Cordone
Book Image

Unreal Development Kit Game Programming with UnrealScript: Beginner's Guide

By: Rachel Cordone

Overview of this book

Unreal Development Kit is the free edition of Unreal Engine—the largest game engine in existence with hundreds of shipped commercial titles. The Unreal Engine is a very powerful tool for game development but with something so complex it's hard to know where to start.This book will teach you how to use the UnrealScript language to create your own games with the Unreal Development Kit by using an example game that you can create and play for yourself. It breaks down the UnrealScript language into easy to follow chapters that will quickly bring you up to speed with UnrealScript game programming.Unreal Development Kit Game Programming with UnrealScript takes you through the UnrealScript language for the Unreal Development Kit. It starts by walking through a project setup and setting up programs to write and browse code. It then takes you through using variables, functions, and custom classes to alter the game's behavior and create our own functionality. The use and creation of Kismet is also covered. Later, using replication to create and test multiplayer games is discussed. The book closes with code optimization and error handling as well as a few of the less common but useful features of UnrealScript.
Table of Contents (18 chapters)
Unreal Development Kit Game Programming with UnrealScript
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Directory overview


Let's take a look at the folders in the UDK install to see how everything is organized.

Binaries

The first folder, Binaries, holds the game executables and tools for artists and animators. We won't be working with the art tools in this book, but it's helpful to know what they do.

  • ActorX: Provides plugins to export static and animated game objects from 3D modeling programs like 3ds Max and Maya.

  • FaceFXPlugins: Lip syncing and facial animation tools for characters.

  • GFx: Tools used to make Scaleform menus for the interface and player HUD.

  • SpeedTreeModeler: Used to quickly make trees and other vegetation to fill game environments.

Development

The next folder, Development, is where most of our work will take place. You may have heard people talk about a game's source code before. The Development\Src folder is where our game's source code will go. If we look in the Src folder we see that it isn't empty, there are a lot of folders already in there. Epic provides the source UnrealScript files for reference, to make it easier to learn how to make our own code. As Indiana Jones might say if he were a programmer, "Seventy percent of programming is reading the source code." One important thing to remember: NEVER ALTER EPIC'S SOURCE CODE! A lot of the files have C++ code behind the scenes, and altering these files could break them since we don't have access to the C++ code. All the work we do will be creating our own files to work with.

Engine

The Engine folder holds resources and configuration files for the game and editor, and will rarely need to be touched even by experienced UnrealScript programmers.

UDKGame

The next folder is where the heart of a UDK project resides. UDKGame is where all of the content for our game is found, where the configuration files are, even where the splash screen is. Let's take a look at each folder individually. The next two folders are:

  • Autosave: This folder doesn't exist when you first install the UDK. When you open the editor and start creating a level, the editor will periodically save a copy of your map to this folder. If the editor freezes up or your computer crashes, you would be able to retrieve a recent version of the map you had been working on without losing a lot of work.

  • Config: We use the INI files in here to change settings that the game uses to run, as well as giving the player a way to change settings for our custom game. The game's resolution and keyboard settings are in here as an example. INI files can be opened with any plain text editor such as Notepad. Here is an example of keybinds that can be found in the DefaultInput.ini file:

    .Bindings=(Name="E",Command="GBA_Use")
    .Bindings=(Name="LeftMouseButton",Command="GBA_Fire")
    .Bindings=(Name="RightMouseButton",Command="GBA_AltFire")
    .Bindings=(Name="C",Command="GBA_Duck")
    .Bindings=(Name="Escape",Command="GBA_ShowMenu")
  • Content: Maps, sounds, characters, environment art, it's all here. The directory structure inside this folder is divided up to create separate areas for mobile content if we were working on an iOS project, to keep it separate from the normal PC content. The exact directory structure here doesn't matter much, we can organize our content however we like. As long as it's in the Content folder the game will be able to find it.

  • Flash: This folder holds the source files for our Scaleform menus and any HUDs our game uses.

  • Localization: If we were releasing our game in different languages, this is where we would put all of our translated text. As with INI files, INT files can be opened with a plain text editor.

  • Logs: The files here record game events and any debugging code that we put in, and are very helpful when trying to fix broken code. The LOG files can be opened with a plain text editor.

  • Movies: Any cutscene videos we create would go in here, as well as the game loading and level loading movie files.

  • Script: Once our source code is compiled, the .u file ends up here. These are the files that the game uses and the ones that are distributed with our game, the source code is only used to create these and aren't included.

  • Splash: In addition to the images that are shown when the game or editor are starting up, there are links to the Epic forums and the Unreal Developer Network in here. Both are valuable resources for learning how to use the UDK.

Not too complicated! In this next section we'll be taking a closer look at the Development folder by installing and setting up a few programs we can use to making coding in UnrealScript easier. Let's get to it!