You are previewing Unreal Development Kit Game Programming with UnrealScript.
O'Reilly logo
Unreal Development Kit Game Programming with UnrealScript

Book Description

Create games beyond your imagination with the Unreal Development Kit

  • Dive into game programming with UnrealScript by creating a working example game.

  • Learn how the Unreal Development Kit is organized and how to quickly set up your own projects.

  • Recognize and fix crashes and other errors that come up during a game's development.

  • A practical beginner's guide with fresh, fun writing that keeps you engaged as you learn game programming with UnrealScript

  • In Detail

    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

    1. Unreal Development Kit Game Programming with UnrealScript
    2. Credits
    3. About the Author
    4. About the Reviewers
    5. www.PacktPub.com
      1. Support files, eBooks, discount offers, and more
        1. Why Subscribe?
        2. Free Access for Packt account holders
    6. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Time for action heading
        1. What just happened?
        2. Pop quiz heading
        3. Have a go hero heading
      6. Reader feedback
      7. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    7. 1. Project Setup and Test Environments
      1. System requirements
        1. Minimum requirements:
      2. Time for action Installing the UDK
        1. What just happened?
      3. Directory overview
        1. Binaries
        2. Development
        3. Engine
        4. UDKGame
      4. Using external programs to code
        1. ConTEXT
      5. Time for action Installing ConTEXT
        1. What just happened?
      6. Time for action Configuring ConTEXT
        1. What just happened?
        2. UnCodeX
      7. Time for action Installing UnCodeX
        1. What just happened?
      8. Time for action Configuring UnCodeX
        1. What just happened?
        2. nFringe
        3. WOTgreal
      9. Setting up a project
      10. Time for action Setting up AwesomeGame
        1. What just happened?
        2. Have a go hero More editing of ini files
      11. Compiling and testing
      12. Time for action Compiling and testing AwesomeActor
        1. A quick note about comments
        2. Pop quiz Files and directories
      13. Summary
    8. 2. Storing and Manipulating Data
      1. Variables and arrays
        1. Booleans
      2. Time for action Using booleans
        1. What just happened?
        2. Integers and floats
      3. Time for action Using integers
        1. What just happened?
      4. Time for action Using floats
        1. What just happened?
        2. Strings
      5. Time for action Using strings
        1. What just happened?
        2. Enums
      6. Time for action Using enums
        1. What just happened?
        2. Arrays
      7. Time for action Using arrays
        1. What just happened?
        2. Dynamic arrays
      8. Time for action Using dynamic arrays
        1. What just happened?
        2. Have a go hero Copy an array
        3. Structs
      9. Time for action Using structs
        1. What just happened?
        2. Vectors
      10. Time for action Using vectors
        1. What just happened?
        2. Rotators
      11. Time for action Using rotators
        1. What just happened?
      12. Variable properties
        1. Default properties
      13. Time for action Using the default properties block
        1. What just happened?
        2. Editable variables
      14. Time for action Editable variables
        1. What just happened?
        2. Config variables
      15. Time for action Creating config variables
        1. Have a go hero Editable configurable variable?
        2. What just happened?
      16. Common operators
        1. Standard arithmetic
      17. Time for action Math!
        1. What just happened?
        2. Modulo
      18. Time for action Using modulo
        1. What just happened?
        2. Comparisons
      19. Time for action Comparisons
        1. What just happened?
        2. Logical operators
      20. Time for action Using logical operators
        1. What just happened?
        2. Have a go hero Writing logical statements
        3. Concatenation
      21. Time for action Concatenation
        1. What just happened?
        2. Variable functions
          1. Ints
          2. Floats
          3. Strings
          4. Vectors
          5. Rotators
      22. Flow control
        1. If else
      23. Time for action Using if/else
        1. What just happened?
        2. For
      24. Time for action Using the for statement
        1. What just happened?
        2. While
      25. Time for action Something
        1. What just happened?
        2. Do until
        3. Switch
      26. Time for action Using switches
        1. What just happened?
        2. Return
        3. Goto
        4. Pop quiz Variable madness!
      27. Summary
    9. 3. Understanding the Class Tree
      1. What is a class?
      2. Time for action All classes are created equally
        1. What just happened?
      3. Inheritance
      4. Time for action Examining inheritance
        1. What just happened?
      5. Time for action Making a custom weapon
        1. What just happened?
      6. Time for action Experiments with inheritance
        1. What just happened?
      7. Function overriding
      8. Time for action Creating a custom GameInfo and PlayerController
        1. What just happened?
      9. Time for action Experiments with function overriding
        1. What just happened?
      10. Actors as variables
      11. Time for action Experiments with Actors as variables
        1. What just happened?
        2. Have a go hero Keeping references to spawned actors
      12. Casting
      13. Time for action Casting Actor variables
        1. What just happened?
      14. Time for action A practical example of casting for our game
        1. What just happened?
        2. Pop quiz Chopping down the class tree
      15. Summary
    10. 4. Making Custom Classes
      1. Creating a class
        1. Awesome Game quicky design document
        2. Class breakdown
      2. Time for action Creating the weapon branch
        1. What just happened?
      3. Class modifiers
        1. Placeable
        2. Notplaceable
        3. Abstract
      4. Time for action Using abstract
        1. What just happened?
        2. Native
        3. Config
        4. Hidecategories
      5. Time for action Hidecategories
        1. What just happened?
        2. Hidedropdown
      6. Actors versus objects
      7. Common UnrealScript classes
        1. The GameInfo
      8. Time for action Expanding AwesomeGame
        1. What just happened?
      9. Time for action SHOOT NOW!
        1. What just happened?
      10. Time for action Customizing the Pawn class
        1. What just happened?
        2. Have a go hero A different end condition
        3. The Controller
      11. Time for action Expanding the Controller
        1. What just happened?
      12. Time for action No, my left!
        1. What just happened?
        2. The Pawn
      13. Time for action Detecting collisions to give our Pawn damage
        1. What just happened?
      14. Time for action Making the TestEnemies move
        1. What just happened?
        2. The HUD
      15. Time for action Using the HUD
        1. What just happened?
        2. Have a go hero Kills on the HUD
        3. Pop quiz Figuring out Functions
      16. Summary
    11. 5. Using Functions
      1. What's your function?
      2. Creating and calling functions
      3. Time for action Writing a function
        1. What just happened?
      4. Time for action Calling custom functions
        1. What just happened?
      5. Time for action What's your malfunction?
        1. What just happened?
      6. Local versus instance variables
        1. Local Variables
      7. Time for action Using local variables
        1. What just happened?
        2. Actors as local variables
      8. Time for action Using Actors as local variables
        1. What just happened?
      9. Time for action Modifying the projectile
        1. What just happened?
      10. Function parameters and modifiers
        1. Function parameters
      11. Time for action Using function parameters
        1. What just happened?
      12. Time for action Out parameters
        1. What just happened?
        2. Return values
      13. Time for action I'd like to return this please
        1. What just happened?
        2. Function modifiers
          1. Native
          2. Const, NoExport, latent, and iterator
          3. Event
          4. Simulated, server, client, reliable, and unreliable
          5. Singular
          6. Exec
      14. Time for action Filthy cheater
        1. What just happened?
          1. Static
      15. Time for action Using static functions
        1. What just happened?
      16. The super
      17. Using timers
      18. Time for action Just five more minutes mom
        1. What just happened?
      19. Putting it all together
      20. Time for action Expanding Awesome Game
        1. What just happened?
        2. Have a go hero Displaying a timer
        3. Pop quiz All about functions
      21. Summary
    12. 6. Using States to Control Behavior
      1. It's a state of mind
        1. Creating a state
      2. Time for action Writing a state
        1. What just happened?
        2. Switching between states
      3. Time for action Switching states
        1. What just happened?
      4. Function overriding in states
        1. Red state, blue state, no state, new state?
      5. Time for action Multiple personalities
        1. What just happened?
        2. Non-state functions
      6. Time for action Calling non-state functions
        1. What just happened?
      7. Time for action Non-state functions from inside a state
        1. What just happened?
      8. State changes and detection
        1. BeginState
      9. Time for action BeginState
        1. What just happened?
        2. EndState
      10. Time for action EndState
        1. What just happened?
        2. State detection
      11. Time for action Using state detection functions
        1. What just happened?
        2. Have a go hero Rewriting the SetMaterial calls
      12. Subclassing states
      13. Time for action Subclassing the Seeking state
        1. What just happened?
      14. Keywords, labels, and latent functions
        1. Keywords
      15. Time for action Using ignores
        1. What just happened?
        2. Labels and latent functions
      16. Time for action Do we really need to give labels to everything?
        1. What just happened?
      17. Like a boss
        1. The cleanup job
      18. Time for action Reverting our code
        1. What just happened?
        2. Attack of Schellenberg
      19. Time for action Creating the abstract base class
        1. What just happened?
      20. Time for action Creating and spawning the boss
        1. What just happened?
      21. Time for action I like you, I kill you last
        1. What just happened?
      22. Time for action Rage mode activate
        1. What just happened?
        2. Have a go hero Subclassing
        3. Pop quiz Using states
      23. Summary
    13. 7. Working with Kismet
      1. Overview of Kismet
        1. A simple introduction
      2. Time for action Using Kismet
        1. What just happened?
        2. Building complexity
      3. Time for action A more complex Kismet sequence
        1. What just happened?
      4. Time for action Bug fixing time!
        1. What just happened?
      5. Kismet actions
        1. Creating Kismet actions
      6. Time for action Creating Kismet actions
        1. What just happened?
        2. Using variables in Kismet actions
      7. Time for action Using variables in Kismet
        1. What just happened?
        2. Kismet handler functions
      8. Time for action Using handler functions
        1. What just happened?
      9. Time for action Differentiating Kismet inputs
        1. What just happened?
        2. Have a go hero The toggle input
      10. Kismet conditions
      11. Time for action What condition my condition was in
        1. What just happened?
      12. Kismet events
      13. Time for action The cleanup job
        1. What just happened?
        2. Creating and triggering a Kismet event
      14. Time for action Our first Kismet event
        1. What just happened?
        2. Giving the event some meaning
      15. Time for action Moving functionality into Kismet
        1. What just happened?
        2. Further expanding our Kismet
      16. Time for action Setting the wave size
        1. What just happened?
        2. Have a go hero Expanding the Kismet
        3. Supported events
      17. Time for action Using SupportedEvents
        1. What just happened?
      18. Time for action Creating a custom SupportedEvent
        1. What just happened?
      19. Latent actions
      20. Time for action Creating a latent action
        1. What just happened?
        2. Pop quiz Kismet craziness!
      21. Summary
    14. 8. Creating Multiplayer Games
      1. The server-client relationship
        1. One state to bind us all
      2. Testing network code
        1. Setting up the server
      3. Time for action The server batch file
        1. What just happened?
        2. Setting up the client
      4. Time for action The client batch file
        1. What just happened?
        2. Fixing Awesome Game
      5. Time for action Unbreaking the player
        1. What just happened?
      6. Time for action Unbreaking the game
        1. What just happened?
        2. The GameReplicationInfo class
      7. Time for action Making the GameReplicationInfo
        1. What just happened?
        2. Fixing enemy fleeing
      8. Time for action RUN AWAY!
        1. What just happened?
      9. Time for action Bossing around
        1. What just happened?
      10. Replicating function calls
        1. Replication function modifiers
          1. Reliable versus Unreliable
          2. Client functions
      11. Time for action Setting up for the client function
        1. What just happened?
      12. Time for action Using the client function
        1. What just happened?
          1. Server functions
      13. Time for action Using a server function
        1. What just happened?
          1. Simulated functions
      14. Time for action Setting up the map
        1. What just happened?
      15. Time for action Using simulated functions
        1. What just happened?
      16. Time for action COMBO BREAKER!
        1. What just happened?
      17. Role and authority
        1. Role and RemoteRole
      18. Time for action Examining Role and RemoteRole
        1. What just happened?
      19. Time for action Respect my authority!
        1. What just happened?
        2. NetMode
      20. Time for action Checking the level's NetMode.
        1. What just happened?
      21. Replicating variables
        1. The replication block
      22. Time for action Replicating a variable
        1. What just happened?
        2. Replication variables
        3. ReplicatedEvent
      23. Time for action Using ReplicatedEvent
        1. What just happened?
        2. Have a go hero The Replication, The!
        3. Pop quiz Replication
      24. Summary
    15. 9. Debugging and Optimization
      1. Compiler errors
      2. Time for action Preparing for brokenness
        1. What just happened?
      3. Time for action A new script package
        1. What just happened?
      4. Time for action Breaking the class itself
        1. What just happened?
      5. Time for action Breaking some more code
        1. What just happened?
      6. Time for action Misleading errors
        1. What just happened?
      7. Time for action Captain obvious to the rescue!
        1. What just happened?
      8. Time for action Setting up a twofer
        1. What just happened?
      9. Time for action Mal-function
        1. What just happened?
      10. Time for action Taking care of other function errors.
        1. What just happened?
      11. Time for action Actor variable errors
        1. What just happened?
      12. Time for action Other variable errors
        1. What just happened?
      13. Debugging
        1. Accessed none
      14. Time for action Dealing with Accessed None
        1. What just happened?
      15. Time for action Fixing an Accessed None
        1. What just happened?
      16. Time for action Accessed None in function parameters
        1. What just happened?
        2. Using the log
      17. Time for action Setting up a scenario
        1. What just happened?
      18. Time for action Debugging using the log
        1. What just happened?
      19. Optimization
        1. The profiler
      20. Time for action Using the profiler
        1. What just happened?
        2. Clock / UnClock
      21. Time for action Using Clock and UnClock
        1. What just happened?
        2. Best practices
        3. Pop quiz Errors and conditions
      22. Summary
    16. 10. Odds and Ends
      1. Using Components
        1. Creating Components
      2. Time for action Adding a Component to an Actor
        1. What just happened?
      3. Time for action Component compiler error
        1. What just happened?
        2. Interacting with Components
      4. Time for action Components as variables
        1. What just happened?
        2. Have a go hero Using SetStaticMesh
        3. A practical example
      5. Time for action Creating a toggleable flashlight
        1. What just happened?
      6. DLLBind
      7. Time for action Using DLLBind
        1. What just happened?
      8. Final Thoughts
        1. Other Resources
        2. Pop quiz Components and DLLBind
      9. Summary
    17. A. Pop quiz Answers
      1. Chapter 1, Project Setup and Test Environments
      2. Chapter 2, Storing and Manipulating Data
      3. Chapter 3, Understanding the Class Tree
      4. Chapter 4, Making Custom Classes
      5. Chapter 5, Using Functions
      6. Chapter 6, Using States to Control Behavior
      7. Chapter 7, Working with Kismet
      8. Chapter 8, Creating Multiplayer Games
      9. Chapter 9, Debugging and Optimization
      10. Chapter 10, Odds and Ends