IT-Universitetet

Peder's Game Development Corner

peder dot johansen at gmail dot com

 

 

Downloads

The files from my first lecture on UnrealEd are available for download here

The files from my second lecture on UnrealScript are available for download here

The files from Kristian Jespersen's (ZeitGuyz) lecture on level desig are here

Michael Schmidt's character creation lecture notes are here

Overview of AI and pathfinding in Unreal

AI states example (feighning death)

Michael Schmidt's GameWorkshop: Rendering and Performance / Becoming a game developer / Make something Unreal

 

Links

Essentials

Official UT3 Modding Home

http://udn.epicgames.com/Three/UT3ModHome
Official UT3 forums http://utforums.epicgames.com/forumdisplay.php?f=20
UnrealScript language reference (Programmers) http://udn.epicgames.com/Three/UnrealScriptReference.html
Tutorials
List of tutorials by topic http://www.icecreamyou.com/ut3.html
Great introductory tutorials! These complements your book well. http://waylon-art.com/LearningUnreal/
Also good tutorials + two good examples of how amazing levels are built http://book.hourences.com/tutorialsindex.htm
Kismet tutorials http://www.avld.org/pages/tuts/tuts.htm
Four UT3 Programming tutorials http://www.moddb.com/games/169/unreal-tournament-3/tutorials
Modifying a weapon tutorial http://files.filefront.com/Basic+Weapon+Tutorial+PDF+Version/;9317502;/fileinfo.html
Programming tutorials (UT2004, but should still be relevant) http://chimeric.beyondunreal.com/tutorials.php
Video Tutorials
Official UT3 Collectors Ed Videos. These are the best vids out there! http://www.stage6.com/Unreal-Engine-3---Video-Tutorials/videos/
Some video tutorials. Ok quality. http://www.veoh.com/channels/HouseofUnreal
Pretty good tutorials for the basic stuff http://www.youtube.com/user/kcin228
Unreal technology vids for UT2003 and UT2004. Requires that you register. http://www.3dbuzz.com
Resources and tools
WOTgreal - The best unreal script editor

http://www.wotgreal.com/

A lot of people seems to use this tool for compiling unreal script http://www.free-monkey.com/main/monkeybuild.php
New mod community site for UT3 http://www.unrealgate.org/
Mod community site for Unreal Tournament series http://beyondunreal.com/
3rd person cam mod (No scripts, and I haven't tested it) http://www.moddb.com/mods/10356/action-cam/downloads/9447/action-cam-v10

 

Tutorials

Setting up UnrealScript for UT3 and WOTgreal

  1. Export the script files from the Unreal Editor
    1. Open the editor by:
      1. Command line: "C:/Games/Unreal Tournament 3/Binaries /UT3 editor"
      2. or.. Start the UnrealFrontent from the Unreal Tournament bin folder, and click the editor button.
      3. or.. Start it from the start menu.
    2. Open the generic browser.
    3. Select the Actor classes tab.
    4. From the file menu, select "Export all scripts". This will export the scripts to /My Documents/My Games/Unreal Tournament 3/UTGame/ExportedScript/
  2. Install WOTgreal at home
    1. Download and run the newest WOTgreal installer from www.wotgreal.com. As of writing this, the latest installer is 3.05.
    2. To run WOTgreal with UT3, you are going to need version 3.06, so you must download the development build, and extract the files into the WOTgreal installation directory, overvriting the old files.
    3. WOTgreal 3.06 has a setup wizard that automatically detects installed unreal games, except from Unreal Engine 3 games, so just skip trough the wizard.
  3. Install WOTgreal in Game-Lab
    1. You don't have permission to install anything here, so simply download the development build zip file from www.wotgreal.com, and extract the content to a folder in your home directory.
    2. I am working on getting the IT department to get it properly installed.
  4. Configure WOTgreal for the UT3 game type
    1. Go to Options -> Preferences, and then choose "game information" from the menu.
    2. Hit the "Edit Game Types" and, press "Add". If UE3 is already on the list, select it and press the edit button.
    3. Enter the following settings:
      1. Display Name (This is the name your game type configuration will be stored under) = UT3
      2. Game Exe Name (This is the same for all game types and mods) = UT3
      3. Default UCC Name (The compiler) = UT3.exe
      4. Menu Name = Same as Display Name
      5. Select UE3 under game architecture
    4. Go back to the "Game Information" window, and select the new/modified UT3 game type.
    5. In the field, "UCC.exe file", browse to the location of the Unreal Tournament 3 executable : C:\Games\Unreal Tournament 3\Binaries\UT3.exe
    6. In the field, "Source Root Dir(s)", browse to the folder(s) where you have stored the UnrealScript files for your project and the Unreal Tournament 3 script files, in this case: H:/private/My Documents/My Games/Unreal Tournament 3/UTGame/ExportedScript/. This will build the class tree once you close the property window.

HUD

Head's up displays can be made in the UI editor, by creating a new UI scene. UIScenes have several properties you need to set in order to to use it as a HUD. Make sure the cursor is hidden, that the game is not paused and that input are not blocked to the game.

The hud scene should be loaded from a custom hud class. You can specify that this hud class should be used in the defaultproperties of your derived GameInfo class (your gametype).

To modify the hud scene, you can access all objects by creating references to them in your hud class. Materials are very practical in this regard, since you can add scalarparameters and textureParameters that can be accessed in code, in the material editor. To access these variables, you need to use MaterialInstanceConstants in the hud scene. If you are using regular materials, you can convert them in code as shown below.
There is another way of modifying UIScenes in-game, using UIDataStores. This is supposed to be much easier, but I can't tell you how to do this, as the data store system was not complete when I got into hud programming in UE3.

This code snippet shows how to open a UIScene from the hud class, and creates references to three UI widgets that are modified in the tick function:

class MyHUD extends HUD;

var UIScene HUDScene;

var MaterialInstanceConstant lifeMaterial;
var UILabel MyLabel;
var UIObject MyObject; //All widgets has this base class

function PostBeginPlay()
{
    local UIInteraction UIController;
    local MyPlayerController MyPC;
    local int idx;
    local array< UIObject > HUDChildren;
    local MaterialInterface mat;

    super.PostBeginPlay();

    MyPC = MyPLayerController(PlayerOwner);

    UIController = MyPC.GetUIController();
    if( UIController != none )
    {
        //Open the scene
        UIController.OpenScene( UIScene'MyUPK.MyHUDScene', LocalPlayer( MyPC.Player ), HUDScene );

        //Loop trough all the widgets and create references to them
        HUDChildren = HUDScene.GetChildren(true);
        for( idx = 0; idx < HUDChildren.length; idx++ )
        {

            if( HUDChildren[ idx ].Name == 'lifebar' ) //'lifebar' references the name of the widget in the UIScene
            {
                //Get the widgets material
                mat = MaterialInterface(UIImage(HUDChildren[idx]).ImageComponent.ImageRef.GetSurface());

                //Create a new MaterialInstanceConstant
                lifeMaterial = new() class'MaterialInstanceConstant';

                //Set a reference to the widget material
                lifeMaterial.SetParent( mat );

                //Replace the widget material with the MaterialInstanceConstant so we can modify it
                UIImage(HUDChildren[idx]).ImageComponent.SetImage(Minimap_material);
            }

            if( HUDChildren[ idx ].Name == 'my_label' )
            {
                MyLabel = UILabel(HUDChildren[ idx ]);
            }

            if( HUDChildren[ idx ].Name == 'my_widget' )
            {
                MyObject = HUDChildren[ idx ];
            }
        }
    }
}

event Tick( float DeltaTime )
{
    if(PlayerOwner.Pawn != none &&  lifeMaterial != none)
    {
        //The widget material has a scalar parameter called 'health'
        lifeMaterial.SetScalarParameterValue('health', Pawn.Health);
    }

    if(someCondition)
    {
        MyLabel.SetValue(someString);
        MyLabel.SetVisibility(true);
        MyObject.SetVisibility(false);
    }
    else
    {
        MyLabel.SetVisibility(false);
        MyObject.SetVisibility(true);
    }
}

 

Creating a third person camera

The PlayerController has a PlayerCamera variable of type Camera. You could use this camera to create a 3rd persion view, but then you also need to subclass the UTPlayerController and make sure the playercamera is not deleted. In UT the view is calculated internally in UTPlayerController and UTPawn, so the references to the camera is destroyed several places. You should subclass the Camera into a PlayerCamera class, and override the UpdateViewTarget function to write your own camera update. To make your playercontroller use your new camera you must set the CameraClass variable in your playercontroller. Similarly, you specify which playercontroller class to use in your gameinfo subclass.

Tips and tricks

Programmers, you REALLY need to read the page on mod authoring at udn: http://udn.epicgames.com/Three/UT3Mods.html. If you don't configure your mod properly, you won't even be able to compile your classes.

CVS/SVN is a must for larger teams. I personally prefer SVN. Use the lock function to avoid two people editing the same binary file at the same time.

If you are going to be more than one person working on the same map, you should split it up in streaming levels from the beginning. A good place to start is to have all the BSP and static geometry in one map, and all dynamic objects and gameplay in another.

If you want to model your own characters, you should consider reusing the animations and anim-trees of UT3 to save some time. This is possible if your character skeleton is the same as in UT3. There are three rigged UT3 characters available for download from http://udn.epicgames.com/Three/UT3Mods.html (bottom of the page). I suggest stripping the meshes away, and build your own character on top of the skeleton.

The best way to learn the different tools in UnrealEd: Look at the Unreal Tournament maps and assets, and try to understand what they did, and why.

You can make several types of mods to UT3: Mutators, gametypes, total conversions and custom content. Total conversion means, in the most extreme, stripping away all that is Unreal Tournament from the engine, and build a game from scratch. You should not attempt to go all the way with this option with the current lack of documentation and support from Epic (Not to mention time and recources). Mutators can be used to make small alterations to existing UT3 gameplay. If you are planning on making a game that is somewhat different than UT3, which you probably are, I would suggest making your own gametype, and subclass custom pawn and controller classes. Then you can add whatever custom content and classes you need from there. Anyway, a good tip: START SMALL!!!

[Programmers] The most valuable features of WOTgreal: "Find active file in class tree" (right-click in file), find in files (Ctrl-F), the code explorer, go to definition (Ctrl-click on function/variable). Learn to use these functions. They will make it a lot easier to navigate around the code, and increase your productivity.

Custom game types (Subclasses of GameInfo.uc) that you make will not be recognized by UT3 in the "play in editor" feature. An unrecognized map prefix will load the base game type. This means you cannot test all your features in the "play in editor" feature. To test some of the level design, you could also start by making the map a deathmatch for UT (prefix DM-), then you at least get the AI, movement and weapons working in the "play in editor". If you don't have a license for UT3 on your user account, you can still run the custom gametype from command line or using a bat file. To make sure UT3 finds your custom maps, you should store the bat file / run the command in the directory where the maps are.
Here is an example of how a bat file could look:
"C:\Games\Unreal Tournament 3\Binaries\UT3.exe" MyLevel?game=MyGameType?mutator=YourMutotors, moreMutotors?ProfileName=profilename?ProfilePassword=password

 

Code help

UnrealScript haven't changed that much since the last version of the game, so you can use a lot of tutorials and resources for Unreal Tournament 2004, like http://wiki.beyondunreal.com/wiki/UnrealScript, http://wiki.beyondunreal.com/wiki/UnrealScript_Lessons and http://chimeric.beyondunreal.com/tutorials.php.

Unreal Engine has an ExampleGame package. Look at the script files in this package, they are a lot more compact and easier to read than the UT files, and show the very most basic modifications needed to make a game. However, in your case, you might want to consider using more of the UT stuff.

Debugging:
There is currently no debugger for unreal script that works with the mod kit for UT3. Use `log("My debug value is " $ value) to print out debug messages. Concatinate strings, numbers etc with $. The messages will be written to My Documents/My Games/Unreal Tournament 3/UTGame/Logs/launch.log

Command line functions and input mapping:
Command line functions are defined by declearing the function as "exec function". Exec functions can be mapped to buttons in the input.ini config file.

Forum threads on gametypes and total conversions:
http://utforums.epicgames.com/showthread.php?t=597440
http://utforums.epicgames.com/showthread.php?t=597429
http://utforums.epicgames.com/showthread.php?t=595306
http://utforums.epicgames.com/showthread.php?t=601035

Forum thread on overriding camera / 3rd person cam:
http://utforums.epicgames.com/showthread.php?t=592345
http://utforums.epicgames.com/showthread.php?t=602420