Home Game Development Unreal Development Kit Game Design Cookbook

Unreal Development Kit Game Design Cookbook

By Thomas Mooney
books-svg-icon Book
eBook $36.99
Print $60.99
Subscription $15.99 $10 p/m for three months
$10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
BUY NOW $10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
eBook $36.99
Print $60.99
Subscription $15.99 $10 p/m for three months
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
  1. Free Chapter
    Heads Up—UDK Interface Essentials
About this book
UDK is a free, world class game editing tool and being so powerful it can be daunting to learn. This guide offers an excellent set of targeted recipes to help game artists get up to speed with game designing in UDK.Unreal Development Kit Game Design Cookbook contains everything you need to jumpstart your game design efforts. The lessons are aimed squarely at the artist's field of production, with recipes on asset handling, creating content within the editor, animation and visual scripting to get the content working in gameplay.Unreal Game Development Kit Game Design Cookbook exposes how real-time environments are built using UDK tools. Key features are examined ñ assets, animation, light, materials, game controls, user interface, special effects, and game interactivity - with the view of making UDK technically accessible so users can transcend technique and focus on their creative design process. The book has well prepared recipes for level designers and artists of all levels. It covers core design tools and processes in the editor, particularly setting up characters, UI approaches, configuration and scripting gameplay. It is a technical guide that allows game artists to go beyond just creating assets, and it includes creative, extensive demonstrations that extend on mere functionality.
Publication date:
February 2012
Publisher
Packt
Pages
544
ISBN
9781849691802

 

Chapter 1. Heads Up—UDK Interface Essentials

This chapter is for people who are starting out with the Unreal Development Kit (UDK). It walks you through some very easy procedures such as obtaining and installing UDK, glancing over the interface, UI conventions, level building, and even sending the level off to iOS emulation to play.

In this chapter, we'll cover the following topics:

  • Installing UDK and folder structure

  • What content comes with UDK

  • Beginning, building, and testing a new level

  • Deciding on your preferences

  • UI survival steps

  • Navigating the Content Browser

  • Accessing assets in the Content Browser

  • Creating and managing packages

  • Importing your own content

  • Cooking a map with Unreal Frontend

  • Mobile device emulation

  • Kismet debugging

 

Introduction


UDK is a robust game editor that welds several different tools together; it offers many areas of specialization. New users should try to gain a broad understanding of the complete scope of what UDK includes, then start building individual prowess in areas that they care about. Whether you like to build things up or knock things down, you'll confront a base set of asset handling processes which deal with actors and game objects placed in the world, and the properties and interactions which we can assign to influence them. You'll also have to handle packages, which store content used to construct levels. The following lessons may seem at first difficult for those unfamiliar with UDK, but after a short while they'll become second nature. The examples here are intended to furnish anyone picking up UDK from scratch with some interface and asset handling awareness so they can then follow upcoming chapters.

 

Installing UDK and folder structure


Since 2009 Epic Games has updated UDK every month. The software is distributed as a download from their front page at www.udk.com. The website foregrounds the current version, along with its new features, and provides a list of previous versions that users can still access for legacy reasons. If you are following tutorials based on a previous version it is useful to run an older version of UDK to ensure the content referred to is available, as shipped content does change somewhat from time to time.

Getting ready

Install GetRight from http://getright.com/get.html to ensure that the large installer file for UDK is easy to obtain. It supports resumed downloads. Then visit www.udk.com.

How to do it...

  1. UDK has a Download UDK button on the upper tab of their front page. Click this. Also take a look at the UDK News for the current version.

  2. Under Download Latest Release there should be a direct link to the installer file. With GetRight running (or any downloader that supports resumable, large file downloads), right-click on it and choose Copy Link Address. Through the Windows tray choose GetRight's Enter New URL to Download command and paste in the copied link. You should also be prompted for a folder destination for the file, such as your desktop.

  3. Once the installer has downloaded, locate it and run it. During the installation you'll be prompted to agree to Epic Games' license terms, which you should read at least once to answer questions about what you are permitted to do with UDK, and then set a directory to install to. Usually, it makes sense to install to the offered directory. This includes the version number, customarily in the format of the date of release, like UDK-2011-08, which in this book we refer to as ~.

  4. UDK installs its own required utilities including DirectX. If there is a problem with that step (which is rare) you can go to C:\UDK\~\Binaries\Redist\UE3Redist.EXE and run it as administrator. Supposing the dependencies install okay, UDK should then install correctly. Users using Windows XP may face this.

  5. UDK offers to launch itself at the end of the installation, and after that you can find it in the Start | Programs | Unreal Development Kit | Editor shortcut. UDK also adds a desktop shortcut, and you can pin this to the start menu. It is a good idea to edit the UDK shortcut to include a running Log, by right-clicking on it and choosing Properties, then adding -log to the end of the text in the Target: field.

There's more...

Folder structure and updating UDK

UDK so far has had regular updates, and it is possible to concurrently run several installations of UDK as well as several different versions all on the same machine. Each installation has its own folder. Remember to track whether the shortcut to the editor is opening the version you want to use if you have several UDK copies installed. The files used need to be maintained by the user. In this recipe we'll discuss ways to make this easy.

How to do it...

  1. When you uninstall UDK all the user files created can be deleted too, or maintained if you so choose. When you update, this can provide you with a way to access exactly what needs to be transferred over to a new installation.

  2. It is best to keep your content in a few packages all within a single folder (which can then be easily backed up and transferred to other machines too).

  3. Create a subfolder called Yourname in the C:\UDK\~\UDKGame\Content\ folder. In here drop all the model, texture, sound, and animation files you create as you go. To start with you may well have nothing to add, but create the folder anyway for easy access when the time comes.

  4. Flash content is handled differently. This should go in another YournameUI subfolder created in C:\UDK\~\UDKGame\Flash\. This will include any SWF files you import and further subfolders containing content that each SWF uses.

  5. Code is handled separately too. You will need to create a folder called C:\UDK\~\Development\Src\MyGame\Classes\, where MyGame is your folder. You can call it what you like, but all the code in this book assumes you are using MyGame. For a real project you would more likely use the title of the game and create your own naming convention. If you are working with others, consult with the team leader to make sure everyone is on the same page.

  6. When you update UDK and want to carry over settings that you changed in the previous version's config files, you could copy over everything wholesale, but it wouldn't be a safe choice. This is because it is possible that UDK's initial settings may change from version to version. You really just want to take the lines which your game depends on across (the ones that you changed or added yourself). For example, your custom class files are only compiled if they are assigned a path in C:\UDK\~\UDKGame\Config\DefaultEngine.INI, as we'll see later. When you update UDK, you have to tell the new version about your custom classes all over again, and set other default settings for UDK that you want changed too.

See also

The configuration of UDK depends on how you intend to use it. More information on this is covered in Got Your Wires Crossed?

 

What content comes with UDK?


From version to version the content bundled with the editor changes. Usually this is incremental, like the face of a moving glacier, while sometimes it is abrupt, like a melted one. Also, the package structure in the Content Browser changes from time to time. This matters if you transfer levels made in one version to another.

How to do it...

  1. Some tutorials refer to maps, the scenes built using UDK, that no longer come with the current installer. For example, the very good Introduction to the Unreal Development Kit DVD by Waylon Brinck, published by The Gnomon Workshop, is based on a map called DM_Sanctuary which is found in the March 2010 release. Later releases don't include it. You would have to download the entire March 2010 release from www.udk.com to obtain the relevant content to follow that DVD (which is well worth it).

  2. Some old releases included a set of material network demonstrations which, after May 2011, seem to have been dropped from the TestPackages folder.

  3. The folder structure for versions after June 2011 has been simplified so that there are now Maps, Mobile, Shared, Showcases, TestPackages, and UT3 folders in the Content Browser. Not all of the original UT3 content is still included.

  4. Older tutorials, those by 3DBuzz for example, sometimes include deprecated tools. One case in particular is the UIScenes editor used to build HUD graphics, whose functionality has been superseded by the incorporation of Autodesk Scaleform tools (through GFxUI nodes in Kismet). Some users didn't like this switch, preferring the old UI building editor, shown below, and their objections still echo through the forums; but on the whole it is generally accepted that the change to GFxUI represents a step forward, though one that takes an effort.

  5. The UIScene editor actually still functions, but is turned off in newer versions in the configuration. Very little is actually preventing it from working. All you have to do is designate in your GameType script (such as MyGame.uc) in the DefaultProperties the line: useclassicHUD=true and it will be enabled after recompiling.

There's more...

Binaries

UDK includes some external software to interface with other programs. These are found in C:\UDK\~\Binaries\.

How to do it...

  1. Actorx enables users to export models and animation as assets from 3D applications such as Autodesk 3ds Max, Autodesk XSI and Autodesk Maya. Each supported software has its own plugin folder within the C:\UDK\~\Binaries\actorx\ folder. The plugin or plugins can be copied and pasted to the relevant application.

  2. Additionally, FaceFX , the facial animation tool in UDK, has plugins that work the same way, also including an interface to Autodesk MotionBuilder. To use FaceFX, which is a third party technology, refer to www.facefx.com.

  3. Next, the C:\UDK\~\Binaries\GFx\ folder includes requirements for using SWF [assets] from Adobe Flash in UDK through Scaleform. Information for installing those and using them is covered in Chapter 10, The Way of the Flash UI.

  4. Speed Tree Modeler , a third party foliage generation software is bundled with UDK in a format that only permits assets from it to be compiled for UDK levels. Refer to http://www.speedtree.com/games/ for technical information. It is possible to pick up the functionality of SpeedTree within a few hours. Since it installs with UDK, you can access it from Windows Start | All Programs | Unreal Development Kit | ~ | Tools | Speed Tree Modeller.

  5. In the binaries folder, you will also find Unrealfrontend.EXE [ ], which is an interface for compiling and publishing completed levels (or sets of levels) into a single installer for distribution. It also allows script compilation. This can be run from Start | Programs | Unreal Development Kit | ~ | Tools | Unreal Frontend. Its usage will be discussed briefly in an upcoming recipe.

See also

Some of the topics mentioned are discussed in depth later on:

  • Unreal Frontend is discussed in this chapter's recipe Cooking a map in Unreal Frontend.

  • ActorX is detailed in Chapter 3, It Lives! The recipe covers how to install ActorX, export skeletal animation, and import content into UDK.

  • Scaleform GfxUI is discussed in Chapter 10, The Way of the Flash UI.

 

Beginning, building, and testing a new level


In versions prior to June 2011 the user was confronted with a blank scene on loading the editor. This is still possible, if one likes that, but there is now also a set of templates to get started quickly. The templates each emulate a certain time of the day (Night, Day, Morning, Afternoon). These are not extensive maps, just a staging point to help move around the space easily and to help make visual prototyping faster. They come with already established lighting (Dominant Directional Light), a sky dome StaticMesh, a LightmassImportanceVolume, and a KillZ height, all of which the user would have to fuss with previously.

How to do it...

  1. Install UDK post June 2011 and start UDK. Go to the File menu and choose New. Choose the Afternoon Lighting template.

  2. The map that opens has a large StaticMesh box for the ground, and a small StaticMesh cube where the Builder Brush is. This StaticMesh is not useful except for scale reference, so select and delete it by pressing Delete. You can't delete the red Builder Brush.

  3. After deleting the box, notice the current lighting (shadows most obviously) doesn't change. Therefore we need to build the scene. Click on the menu Build and choose Build All or press [ ]. Swarm Agent will start and you can watch it process the scene (in the first instance you may be asked for administrator approval to run this utility). For more information on Swarm, and distributed rendering, consult: http://udn.epicgames.com/Three/Swarm.html.
  4. When the Build is finished, which should be fast given the scene simplicity, hit F8 (to Play in Editor (PIE)) or Alt + F8 to play in the active viewport.

  5. Notice you have no gun and there's no HUD (Heads-up display). Press Escape to close the play session and return to the editor. This time go to the menu View | World Properties. Under Default Game Type, change None to UTGame and do the same for Game Type for PIE. Press F8 or press [ ] and this time when you PIE you'll be able to shoot and see a crosshair for aiming and so on.
  6. Save the map to C:\UDK\~\UDKGame\Content\Yourfolder\Yourfirstmap.UDK.

  7. If you want to you can set any of your maps as one of the map templates that show when UDK loads. To do this we need to save the map to the folder C:\UDK\~\UDKGame\Content\Maps\Templates which is a location specifically for templates. In this case use the extension .UMAP, for instance: YourFirstMap.UMAP.

  8. In the Content Browser, locate the folder or package called Engine.Content.MapTemplateIndex. Add your map here by right-clicking in the Content Browser and choosing New TemplateMapMetadata. When the dialog for this opens, give the Info | Name as YourFirstMap (or whatever you saved your .UMAP file as, without including the ending). Click Okay.

  9. You can add a picture to your newly created TemplateMapMetadata asset. You could take a screen grab and save it as .PNG from Photoshop, and then in the UDK Content Browser right-click and choose Import, and browse to your .PNG. Import the texture to the same package as your TemplateMapMetadata asset.

  10. To complete adding the picture to the template, right-click on the imported texture and choose Copy full name to clipboard. Then find the TemplateMapMetadata asset and double-click it to show its Properties, and in the Thumbnail field of the Template Map Metadata paste the texture name. Save your package and next time you start UDK and choose New Map, yours should appear in the offered templates.

 

Deciding on your preferences


UDK offers some tweaks to customize the user experience. We'll explore some of the ways to alter the default settings. There are two ways to set preferences. One is the Preferences menu, and the other is the View menu. If you choose to use a version of UDK prior to June 2011, all preferences appear in the View menu. This recipe details some of the more immediately useful available settings.

Getting ready

Load one of the default map presets. Also, have a read through the UDN interface information at http://udn.epicgames.com/Three/MainEditorMenuBar.html.

How to do it...

  1. Click on the Preferences menu, and turn on Load Simple Map on Startup. This toggle will prevent or allow skipping through the startup menu to immediately load a set map.

  2. The map which is already loaded (which ought to be a .UMAP as was discussed in the previous recipe) is defined in the configuration file C:\UDK\~\UDKGame\Config\DefaultEditorUDK.ini in the lines at the end:

    [UnrealEd.SimpleMap]
    SimpleMapName=..\..\Engine\Content\Maps\Templates\Template_MidDay.umap
  3. If you are certain you're developing for mobile you can set Preferences | Always Optimize Content for Mobile which helps to ensure compiled materials and meshes are maintained within platform limitations. View more information at: http://udn.epicgames.com/Three/MigratingMobileJune2011.html. The setting enables ImgTec's PowerVR PVRTC compression when building lighting, which is a lossy, fixed rate texture compression used because mobile devices don't support DXT (DirectX textures). What UDK actually does is cache both DXT and PVRTC compression of the texture and dumps one or the other when cooking the game depending on the destination format (PC or iOS).

  4. Textures for iOS should be larger than 16 x 16 pixels. iOS doesn't support textures that do not have their width-height resolution in powers of two, so what UDK does under the hood is automatically stretch any you use so they'll work. Lightmaps, the scene lighting baked into textures during a build, are often not square so these may need special attention. This command is already set in UDK's configuration in C:\UDK\~\UDKGame\Config\UDKLightmass.INI:

    [DevOptions.StaticLighting]
    bRepackLightAndShadowMapTextures=True
  5. If you want to alter this state, just add the suffix nopvrtclightmaps to the line in the Target: field of your editor shortcut before launching UDK. If you're just starting out then you won't need to, but it's good to understand how it works.

  6. Moving on, a useful preference to set comes from the fact that clicking on BSP geometry in the perspective view selects the surface under the cursor, not the entire BSP model. In Preferences | Clicking BSP Selects Brush, you can reverse this. Remember, click Ctrl + Shift on a BSP by default selects the entire brush or you can just select it in an orthographic view instead. You can make the BSP brush show shaded faces when selected by going to View | Draw Brush Marker Polys. Try this out, and check the effect of it being on and off.

  7. Preferences | Perspective viewports default to real-time means that when you launch the editor, your perspective view will display running particle systems and animated content in materials and so on. This can use considerable memory in large scenes. To toggle Real Time display, press Ctrl + R or click the joystick icon [ ] in the icons row above the desired viewport. You can test this in the June 2011 version or later straight away if you've loaded one of the templates that include a sky. With real-time playback enabled you'll see clouds moving. With it off, you won't.
  8. Some designers like to see a visual guide to what is selected. You can go to Preferences | Highlight Selected with Borders to enable white bounding boxes which face the camera and surround each object in a selection. For better depth perception you can tick Preferences | Enable Wireframe halos so that objects further away get fuzzy edges. Also, you can tick Preferences | Highlight objects under the mouse cursor so as you mouse over objects it identifies one over another in a busy scene. The effect is more obvious in some shading modes (like wireframe or unlit) than others (lit or detail lighting).

  9. If you like to split up your views, you can disable the default Preferences | Resize Top and Bottom Viewports Together. This means that when you drag a view, it is free from the others. By default when you zoom and pan an orthographic view the others follow it. This can also be disabled, through Preferences | Link Orthographic Viewport Movement and will make your viewport response a little more like 3ds Max. A related feature which you may find disconcerting if you use another 3D application is that UDK's default view panning is to move the camera in the direction of the drag (which sends the scene apparently panning away from the drag direction). This can be inverted to a generic style of map panning where the scene stays fixed relative to the cursor during the drag. Preferences | Grab and Drag to Scroll Ortho Cameras sets this.

  10. If you want to work full screen, press F11 or go to View | Fullscreen. This fits the editor to the maximum available space. If you want to switch from the default view 2 x 2 split to a single view, each view has an icon [ ] for this on the extreme upper right -hand corner of the view. When maximized, it restores down. If you have multiple monitors it can be useful to Tear Off additional views by going to View | New Floating Viewport and choosing between Perspective or an Orthographic view. Each view (and the Content Browser) has icons for this [ ].
  11. In versions of UDK from June 2011 on, you can Group actors to make handling them in the view easier. Go to View | Allow Group Selection and tick it. Refer to http://udn.epicgames.com/Three/ActorGrouping.html for further information on grouping. All grouping is controlled by having a selection of objects then right-clicking on them and choosing Group Actors, or Groups if the objects are already grouped.

 

UI survival steps


UDK's interface has changed from time to time; it is an outgrowth from the UT3 Editor of several years ago. There's no reason to think it will remain the same as the software improves. Still, its essential layout has remained intact since day one.

How to do it...

  1. Look down the side of the editor and you'll see a range of square buttons that are grouped together. The top set is Editing modes. The second is Brushes (the base geometry creating tool in UDK). The third is Volumes, which opens a list of volume types you can generate from the active brush in the scene. Then there are some Show/Hide tools and Selection aid tools at the bottom. Click on the Go To Builder Brush icon [ ]. You can also press the Home key to frame whatever is selected in the view. Notice it frames the red Builder Brush in all views, and also selects it. Click on the sky dome actor in the scene, then press Go to Actor [ ] and it will likewise frame the entire scene as that actor is really big. Below, the icons, for the tool set have been set into a smaller area to fit the page.
  2. The four views can be sized by dragging their frames. At the end of the icon row each viewport has, shown below, there is a Tear Off command that creates a floating copy of the view. You can change the layout of the views using the options under the menu View | Viewport Configuration. The default 2 x 2 split is probably easiest to get used to. As with most 3D software, you can shade the views in various modes, using the icons running along the top of each view. Just hold the mouse over the button to get its tooltip, and test each one out to see how it behaves. Each viewport's icon row starts with a letter (P for perspective, T for top, F for front, and S for Side) that you can click to cycle between views.

  3. To navigate the perspective view there are two systems. One way is to use the left mouse to move forward and back, right mouse to look around, and both together to move up and down. This way can be extended by right-clicking and using W A S D for movement, Q and E for up and down, and Z and C for camera zoom. There is an option to use W A S D without holding the right-click under the Preferences menu in the Flight Camera Controls. If you use this you'll have to switch from using W to hide StaticMesh models to using Alt + W.

  4. In the orthographic views you can pan the view using left or right click, zoom using both together or by mouse scrolling. Middle mouse dragging creates a handy ruler that measures units as you draw a red line.

  5. Many of the icons down the side of the editor and along the top of each viewport are just graphics for the same tools or commands in the menu at the top of the editor.

  6. The File menu lets you save and open maps, as well as packages, and import and export terrain content. There is also a list of Recent files which becomes very handy.

  7. The Edit menu allows you to Select, Copy, and Paste actors and also Find Actors through search filters. The icon for that is a pair of binoculars [ ].
  8. The View menu has a lot of functionality including access to the Browsers (Content, Actor Classes, Levels, and so on), actor properties, surface properties and world properties windows, and also the Kismet and Matinee editors. You can enable and adjust the grid scale for viewports and the editor autosave period here, or at the lower right-hand side of the screen through the roll-outs shown here:

  9. In the View menu there are some toggles, including Allow Translucent Selection (which is also on the top row of icons) [ ], which makes actors that have a translucent material (like water) selectable. At the bottom of the View menu you'll find some handy Lighting Info tools too. These help you monitor your scene and adjust lighting variables.
  10. The Brush menu, Build menu, and Play menu each provides access to the tools we already mentioned as well as lists their hot keys. The Tools menu offers a few extra utilities, in particular the New Terrain generation window.

  11. With actors in the scene, you can transform them using the Move, Rotate, Scale, and Local Non-Uniform Scaling tools, which can be accessed through icons in the top row or through the Edit menu or by repeatedly pressing Space to cycle them. Non-uniform scale is always in Local space. The hotkey to switch between the World and Local transform modes is the grave key ` or tilde key ~

  12. In one of the UDK updates, a combined transform tool was introduced which can be enabled through the Preferences | Enable Combined Translate/RotateWidget and then cycling the Space bar till it appears. Shown above, this features regular RGB=XYZ axis arrows for movement, a yellow XY movement circle, and a blue arrow to orient an object through a world Z rotation.

  13. Once you have fleshed out a scene, press G to view it in Game mode [ ], where all symbolic object icons, boundaries like collision or volumes, and labels will be hidden. Press Ctrl + R to toggle Real Time mode to see all the effects playing out. Finally, Camera Movement Speed can be adjusted using the icon in each view as shown next. If you right-click on it, you can access it through a roll-out or just tap it until you get the camera speed you like.
 

Navigating the Content Browser


How it works...

The Content Browser opens with each session of UDK. It can be a good idea to use two monitors with UDK and push it off onto a second screen. In older versions, the editor would first display the Start Page, which is essentially a web page within the editor that shows news and tips. Looking at the top of this window, you'll see tabs that include Content Browser, Actor Classes, Levels, Scene, Groups, and Start Page. We are going to be dealing with just the Content Browser and Actor Classes here.

The Content Browser is quite large, so make sure you know how to resize windows and move them around to make screen space. If you accidentally close the Content Browser, press Ctrl + Shift + F to open it back up. In the top of the main editor you will see a graphic icon which also opens it [ ] (dating back to Unreal, the game from which UDK springs, the icon is meant to be a U for Unreal, but it's scaled down to illegibility). Its location in the editor is shown here:

On either side of the Content Browser you'll find black vertical strips with gray triangle arrows. These expose or hide panels for viewing your current UDK folder structure (Packages List on the left-hand side), and sorting objects through user tags (Tags List on the right-hand side, as shown here).

The tags won't be that useful to start with, since this is a tool for arranging large sets of content, but since the arrow icon is near the often used asset list slider you may hit it by mistake and be momentarily disoriented by the tags emerging into view. To use tags, notice how the tag categories have a + icon on the right-hand side which highlights green on mouse-over:

These are used to apply a tag to objects you have already highlighted in the Browser. Highlighted objects are framed in yellow and their tags, if any, are shown in the Applied Tags panel at the very top of the tags area when that is exposed. You can search tags using the field called Type to Filter. If you right-click on a tag, you will see a pop-up menu for further adjusting tags. If you create a tag of your own this way it will appear in whichever Group was current at the time (or one you then assign, as shown here).

You can also use the [ ] Create Tag icon at the bottom of the tags panel, which defaults to a group called None. Next to Create Tag is an icon named Destroy. If you press it, the icon appears next to each tag, as shown next. They highlight red on mouse over, allowing you to destroy by clicking:

Once you are used to tagging, you can search the Browser with a 'tagged' or 'untagged' or 'both' filter, shown in the Status panel of the main search tool:

The status of a search is quite important as it defines the scope of the search either narrow or wide. If you have ticked the radio button to limit your search to the current level (In Use By: Current Level) [ ] and you are starting a scene, you won't see many UDKGame assets at all, just some assets used by the Engine.

Above the Status section of the search tool, there is the icon [ ]. This simply minimizes the search filters so you can see more of the content. Next to this is a Type here to search (Ctrl + Shift + F) field. At the right of this type field (and also the tags type field) is the [ ] icon which will clear text. Beside it, a spanner icon [ ] provides access to the kind of 'match any' and 'match all' that Find tools usually have. Next to the spanner icon is a text button called Clear. This not only removes text in the search field but also any ticked entries in the search by Object Type and Tags areas seen in the next screenshot:

Above the search filter panel there are some small icons that are really useful for those often using the Content Browser (which is everyone really). Two left and right triangle arrows [ ] allow us to browse using a kind of history of filter and search settings. There is also a Refresh button (Ctrl + F5) [ ] alongside these which can ensure your search shows everything current. On the right-hand side of these buttons are three square icon [ ] that allow control of the Browser window itself. You can duplicate a new tabbed Browser window, you can float the Browser (and re-dock it into tabs), and you can kill off duplicated Browsers (the original one ignores this command).

Shown here is a slightly atypical arrangement of the Content Browser. The folder structure usually exposed on the left-hand side is toggled to hidden. Using the layout buttons at the bottom of the image, the panel showing asset icons has been switched to horizontal split view to also show the names of assets as well. The search filters below the text field have been minimized. Tags have been applied to the highlighted SoundCue. Double-clicking an asset will open it in an editor for inspection, or in the case of a SoundCue, preview how it sounds. You can also press Space to preview highlighted sounds. Previously created assets which have not been used or loaded yet in the current editing session are marked in one corner with a small orange box icon [ ] in one corner. Click this to Fully Load the asset. It saves memory to load only the assets you need. The assets are sorted here by Date Added rather than by Name (bottom of the image). The icon size has been reduced to 64 x 64 (also at the bottom of the image). Finally, the frame dimensions of the views have been altered by dragging on their edges.

This example is shown to indicate how the UI of the Browser is flexible and packed full of search and layout tools designed to enable ready access to game content.

There's more...

Right-clicking is the way to go!

Editing assets shown in the Browser is usually done by right-clicking on them and choosing the appropriate task. You will have noticed that right-clicking everywhere in UDK typically provides access to tools related to what is selected in the scene or highlighted in the Content Browser. Using the Find in Content Browser... command through right-clicking over a scene actor is very useful, and likewise so is right-clicking over an asset in the browser to access the Find Package command . Both allow us to find any assets related to the current one. Because a lot of UDK assets are intended to be modular, this is particularly important. Also, right-clicking an object in the Content Browser lets you access any examples of the asset already in the scene through the command Select Level Actors Using This Object. Right-clicking in empty space in the assets panel of the Content Browser lets you create new items, which leads us to the next topic.

See also

  • The next recipe, Accessing assets in the Content Browser, looks closer at handling assets

  • The recipe following that, Creating and managing packages, covers the process for introducing or modifying the actual assets in the Content Browser

 

Accessing assets in the Content Browser


The Content Browser is the key staging area of assets used to furnish levels. Before you make a level, this is the window UDK opens up onto. If your job is making assets then you may do a lot of work here without even doing any level layout. In this recipe, we look at how to find something that we need to find, how to move content around, how to create or import new content, and shortcuts to using the Browser effectively.

How to do it...

Examining the assets belonging to a plant model

  1. After starting UDK, the Content Browser should be open. If not, press Ctrl + Shift + F or the icon: [ ]
  2. Locate the Type here to search field, which is near the top. Click in there if your cursor isn't already flashing there and type PLANT.

  3. You will probably see a lot of textures of leaves display in the assets panel under the filters. If not, make sure ALL [ ] is ticked in the Object Type filter, just below the search field. Click on All Assets. This ensures that we're searching the entire body of provided content.
  4. Now filter only Static Meshes in the Object Type list.

  5. Look for S_BananaPlant_01 in the resulting display of assets. If necessary use the sliders on the edges of the red-edged asset panel to scroll and locate it. You can also scroll the middle mouse scroll wheel.

  6. When you mouse over S_BananaPlant_01 it turns orange. When you click on it, it turns yellow. Assets the scene is not using aren't loaded with the editor, which saves memory for the scene. When an asset is fully loaded, its dependencies are also loaded, for instance the material and textures used by a model like the Banana Plant. Click on the small orange square [ ] in the corner of the banana plant asset's icon, which will fully load the mesh. The asset will state there is NO COLLISION MODEL! This means that if the model is placed in the level then a player will be able to run right through it. For now, ignore that. We discuss collision later.
  7. Drag the icon over the perspective view to drop an instance of the asset into the editor. You should see a purple tinted banana plant in the editor. This tint indicates it is selected. You should also see a movement cursor.

  8. This screenshot shows the highlighted BananaPlant asset in its specific package. Right-click on the model in the editor window (not in the Browser) and choose Show in Browser. Notice how the Browser will jump from showing just PLANT in the search field to showing other objects too. These are all the objects in the same package as the banana plant asset. You don't actually need to pull the object into the editor for this step. Instead, you can right-click on the asset in the Browser and choose Find Package.

  9. For convenience, you can also right-click on the asset and choose Copy Full Name to Clipboard. This allows you to paste its name into search strings or assign it to property channels where needed.

  10. Look to the left, in the Packages list, and see how the package displaying is UDKGame/Content/Environments/Foliage/FoliageDemo/Mesh. This indicates the folder structure for the package FoliageDemo. The current model is properly indicated as FoliageDemo.Mesh.S_BananaPlant_01 because the naming convention is Package.Group.Asset for all assets in UDK.

Accessing materials used by a model

  1. Double-click the Banana Plant model to open it in the Static Mesh Editor , which provides us with a closer look at the asset and allows key properties to be set for the asset, including collision, mesh simplification, and materials. On the right of the mesh viewer you will see a list of Properties (as with most panels in UDK this can be dragged by its heading to be floated and docked on either side of the view). Here, expand LODInfo, to reveal the Material the object uses.

  2. Next to the Material name there are three small icons [ ]. If you click the green arrow you can load a new Material, if one is highlighted in the Browser. The magnifying glass takes you to the current Material asset in the Browser. The square clears the Material channel. For now, click on the magnifying glass.
  3. Notice that in the Content Browser the Material for the plant is highlighted. It just so happens this mesh uses a Material Instance Constant, a special type of material which depends on a parent Material for certain variable parameters (which can be animated or allow you to create many variations from one parent). The Material Instance Constant, discussed in depth later, has its own editor. Double-click MI_BananaPlant_01_INST to open the Material Instance Editor, and notice the Parent channel in the left-hand side Properties panel also has a green arrow, magnifying glass, and a Clear texticon. Click the Parent's magnifying glass [ ] to highlight the Parent Material in the Content Browser.
  4. That's quite a long thread to follow if you're new to these ideas, but it does expose how elements in UDK may connect together. You'll find that from editor to editor the icons for navigating between the assets remain the same, and hopefully you'll quickly get used to the assign icon [ ], the find in browser icon [ ] and the add entry icon [ ], which appear everywhere.
  5. To see what textures a Material uses (and there may be many) you can right-click on a Material in the assets panel of the Content Browser and choose List Referenced Objects. This will display a lot of information. Amongst this, the texture nodes are the ones named Texture2D in the list, for example: Texture2D FoliageDemo.Speedtrees.T_ShaneTobacco_D.

  6. You can also simply double-click on a Material to edit it and follow the Material channels back to their Texture2D or Param2D nodes in the Material Editor. Doing so is a good way to become familiar with Material shader instructions. Without going into the Material Editor, you can see how many Texture Samplers nodes are in use by the Material by holding your mouse over the Material and reading the floating display info. A Texture Sampler is a node that holds a Texture asset.

  7. Double-click the highlighted Parent Material which the MIC of the banana plant is based on. The Material Editor is discussed later, but you should be able to spot in the network the texture assigned to the Material by following the nodes from the Diffuse channel. You'll also see a huge network of nodes controlling the orientation of the leaves of the tree (which are mostly math operations).

 

Creating and managing packages


Let's consider how packages work and how to manage them both inside UDK and through Windows. All the assets you use are saved in packages. They have the suffix .UPK and are distinct from .UDK files, which are maps or levels. Both of these are external files stored in folders within the UDK installation, typically in C:/UDK/~/UDKGame/Content/ where ~ is the version number you have installed, such as UDK-2011-08. When using package files keep in mind that they can be transferred between users sharing a project or between computers independently of maps or scenes you may have been working on. However, maps that depend on certain packages will not load completely if those packages have been removed or renamed. An important thing to watch for is pasting packages to a different computer which have the same name as existing packages but have different content.

We'll be creating a particle asset in this recipe, in a very basic way, not at all to focus on the particle procedure, but the way to deal with the asset itself and the package the asset is created in. The intention is to get used to package naming, renaming, saving, and moving assets around.

Getting ready

This book assumes you have installed UDK using its default folder option. If you already have UDK open, close it down.

How to do it...

  1. In Windows Explorer, within the folder C:/UDK/~/UDKGame/Content/ create a Yourname sub-folder named after yourself or your project. It is highly advisable to put everything you personally create in here, rather than in default folders, because then you can readily transport content from computer to computer or even from one version of UDK to another (assuming you are rolling forward). Since UDK is updated frequently, this can save a lot of noodling around with files. If you work in a team, a folder naming convention may be imposed which you should follow.

  2. Restart UDK. If you then look in the Packages list in the Content Browser you should now see your folder showing there. If you didn't reset, and create a package, you will still be able to save the package into the newly named subfolder but it won't display in the Packages list until you restart. Instead it will display at the bottom of the list, under New Packages in a temporary package called Untitled_1 (and the number will increment if you start a new scene).

  3. A package typically includes some content, and there are two ways to get started. The first is to press the New button at the bottom of the Packages List. This floats a menu for creating content. The other way is to right-click in the gray space of the Content Browser's assets panel and choose New... according to the type of object you want to create.

  4. If you highlight an existing folder in the packages list, such as the one with your name that you created just before, the new object will follow suit and save to that folder. Anyway, you can choose from the floating menu whatever folder you like. You should also give the object a Group and a name. Setting a Group is optional, but really helps a lot. It allows you to organize content that is similar together inside a package. You could put all your meshes in a group called Mesh and all your textures in a group called Texture for example.

  5. Based on the information above, create a New Particle System in your folder, something like this: Yourname.Cascade.DemoPS1 where Yourname is the folder name, Cascade is the group name, and DemoPS1 is the unique asset name. Notice when you create a particle system by using the right-click approach it automatically assigns a Factory preset called Particle System in the creation menu, and after you hit Okay then Cascade opens. Cascade is UDK's particle asset editor. If you use the New icon, you have to set the Factory type yourself from a roll down list, shown above. You should then see a thumbnail in the Content Browser, as shown in the next illustration. Notice the asterisk * next to both the package name and the asset name. This indicates the need to save changes, and is visible in the following screenshot:

  6. This new particle system is nothing special. We'll edit particles later. The goal here is just to have a new asset to play with. For now, set an icon thumbnail for it in the Cascade editor menu by going to View | Save Cam Position. This ensures that the thumbnail of the asset displayed in the browser doesn't remain empty and instead looks more like the particles in the Cascade editor, which is important if you want to browse through a large number of asset thumbnails. To set a thumbnail you can also use the icon which looks like a black and white camera [ ]. When ready, close the Cascade editor then right-click on your package folder and press Save, which will save all of its content.
  7. If you get a warning saying Cannot Save via the Browser then your new particle system must be in the Untitled_0 package. You should redefine it by pointing it to your own package Yourname in the folder C:\UDK\~\UDKGame\Content\Yourname. To do so, right-click on the asset and choose Move or Rename... and then just enter a specific folder; it would be good to use the folder name you created at the start for your custom assets. If you are starting out with UDK, and have never saved a package of your own already you'll be prompted for a .UPK file save location in Explorer, and should use the folder we've pointed to: C:\UDK\~\UDKGame\Content\Yourname.

  8. You can set as many packages in your folder as you want, or put all your assets in one package. If a single package grows over 300 MB or so, you may hit a performance ceiling for it and get a warning when you save.

    Tip

    A good way to keep package size down is to use simpler Lightmaps. To do so, avoid raising the StaticMesh and BSP sampling resolution too high. StaticMesh resolution is higher when its value raised, BSP resolution is higher when its value is lowered. This is further discussed in Chapter 8, Then There Was Light!

  9. If you now delete your folder in Explorer or a .UPK inside of your folder, the Content Browser will no longer include what you deleted next time you run UDK. So, if you save your scene or map, and reload it after deleting content, you will get missing content errors. This is something to be very careful of. Deleting a folder containing a package with an unused, empty particle system won't matter, but deleting a folder with packages full of textures used by model assets in different packages could keep you up fretting long into the night. It is a good idea to periodically copy out and rename backups of your key packages.

  10. If, in the Browser, you want to modify the content which ships with UDK, you shouldn't directly edit it but instead right-click on it and choose Create a Copy... then set the new package name to one of your own, located in your C:\UDK\~\UDKGame\Content\Yourname subfolder, and probably rename the asset too. You can then modify the copy as you wish.

  11. Finally, if you have content from another graphics software you want to import, like a texture or a model, click on the Import button at the bottom of the packages list or right-click in the assets Browser panel and choose Import there. It is the top entry and you may have to scroll up the list to see it.

 

Importing your own content


If you don't have any resource files, you can download sample content from http://www.packtpub.com/support (select Unreal Development Kit Game Design Cookbook from the drop-down list) including textures, models, sounds, and animation. Note that UDK likes textures which have squared dimensions (or powers of 2) such as 256 x 256.

How to do it...

  1. Download the book's content from the above mentioned URL and extract it into a folder such as C:\Packt\. In the main extracted folder ...\Files\ select the \Development and \UDKGame subfolders and copy or merge them into your UDK installation C:\UDK\~\ where ~ is the version number. These files do not replace any default UDK files, but add additional content referred to in the book. The extra folder ...\Files\Provided Content contains a few additional files such as 3ds Max source scenes. Look for the included archive ImportTest.rar and extract that to a subfolder \ImportTest.

  2. In UDK, in the Content Browser, select YOURFOLDER and choose Import as discussed above. You can import multiple assets at one go. Select the files extracted to C:\UDK\~\UDKGame\Content\Packt\ImportTest and press Open.

  3. When UDK notices the SWF file it will give the following warning:

  4. All the other assets will still come in. As mentioned earlier, SWF file import should be from assets in the C:\UDK\~\UDKGame\Flash\UI\ folder, not from the \UDKGame\Content folder. Don't import the SWF now; instead, move it where it should be, then import it separately. When they are used later in the lessons, each important file's requirements are talked about more.

  5. The rest of the content will go into a package we'll call Packt UDK (just treat it as a throw-away package). While it's possible to do so, it isn't a good idea to press Okay to all if the content is not all of the same type, and here it isn't. There are textures, meshes, and .WAV files. So check that each item you import has the appropriate Group (Mesh, Texture, Mesh, Wav) and press OK for each one. The next few steps detail this.

  6. The included mesh file is an .ASE and was sent out from Autodesk 3DS Max using File | Export Selected with .ASE as the file type. Now you can also use .FBX to transfer between Autodesk modelers and UDK. To import it, it just needs its group name set to Mesh or something to distinguish it from a texture. This goes for the included WAV file, which are sounds, and should have a group named Wavs or Sounds.

  7. The textures mainly import with default settings. Give them the group name Texture. The exception is 256x256_SampleIII_NRM.TGA. The filename ending _NRM is so named to indicate that it contains a normal map. If you are importing Normal map assets which help describe bumpy surfaces in a material in the Import dialog, they require the Compressing Settings: TC_Default setting to be changed to TC_Normalmap. A properly imported normal map will show up pale pink in the Browser. If it shows up dark blue in the Browser, then it has probably been imported without the correct compression settings.

  8. Having imported all the files, your package needs to be saved. Right-click on it and choose Save. The next screenshot shows the imported content, and the Save Package dialog for committing your .UPK file. When prompted for the folder location to save Packt UDK.UPK choose your own folder that you created earlier. Actually this package is not one we'll use directly in the upcoming projects; so deleting it later on and using content from \Yourname\Yourname.UPK and \Packt\Packt.UPK instead will be what's mostly likely to happen.

There's more...

How to open an external package

From time to time you will come across a useful package that someone else has made, such as those that come with many of the video tutorials that exist for UDK. The usage here is for when you want to extract content from an existing package without putting it into your UDKGame folder structure (and then put the extracted content to your own package).

  1. To load the .UPK file click in the Content Browser on the folder icon next to New and Import which has the tool tip (mouse-over): Open an External Package, shown next. This method is okay if all you want to do is select assets from the external package and move them into other packages.

  2. If you simply paste a .UPK into your folder structure C:\UDK\~\UDKGAME\Content and restart UDK, the pasted content will show up in the Packages list when you restart. Normally this is considered a safer way to bring in new content.

Copying and pasting content between scenes

UDK allows you to open one scene, select any number of objects in the world, and copy them to be pasted into a second scene. Copying and pasting is fairly easy between scenes; just use Copy and Paste from the editor's main Edit menu. You can also right click in the scene and choose Paste Here. Pasting generally works unless you are pasting an object that references another, such as terrain, which also includes Terrain Layer Setup and Terrain Material assets, where those assets may be tied into a particular scene. This example may be unusual, which is why it provides a good illustration for how important package handling can become. Changing UDK default library assets causes all kinds of headaches like this one and should be avoided:

The image above is what shows if you have tried to copy content from one scene to another and some dependencies are not included, and the validity of the pasted content is therefore called into question. The solution is to list the required assets and copy those over too, then reassign them where they ought to go.

Over the last few topics, while learning about package handling and assets, we opened up several editors within UDK: the Properties Editor (F4), the Static Mesh editor, Cascade, and the Material Instance editor. Most actors have their own editor type. You can examine the types of assets that UDK provides by going to the Actor Classes list, which is in the tab alongside the Content Browser. Once you highlight any given actor type you can add it into the scene by right-clicking in the viewport and assign it from the context options.

Let's tie this in better with the copying and pasting topic.

  1. Use the Actor Classes list to locate the CameraActor type, and add one to the scene from the right-click menu in the Perspective view, as seen in the previous screenshot.

  2. To match this camera exactly into another scene so that its position and location are the same, go to the Edit menu and choose Copy. If you want, save the scene.

  3. Open a new scene template and from the Edit menu, choose Paste. Another instance of the first camera will appear with exactly the same settings.

    Tip

    This works even when the camera is animated, but you'd also have to copy and paste the relevant Kismet. You can't copy both at once, unless the animated camera is converted to a Prefab. Prefabs are discussed under the first recipe in Chapter 5, It Is Your Destiny!

 

Cooking a map in Unreal Frontend


Once you've made a level, or a set of them, you can cook the content (to distil out from the editor only what is used) and then package that to a game installer that can run on any capable PC without having to have UDK itself there too. In this recipe the cooking process is outlined for a simple test case.

Getting ready

Load any map, or the C:\UDK\~\UDKGame\Content\Yourfolder\Yourfirstmap.UDK you made in the recent recipe Beginning, building and testing a level.

How to do it...

  1. Make sure that the level you've chosen has been built (Build | Build All) or press [ ], because the cooking process uses the baked lighting information.
  2. In the level's View | World Properties | Game Type property set UTGame, if it isn't set already and save to C:\UDK\~\UDKGame\Content\Maps\CookMe.UDK. It is good to have a different folder for final, cookable maps and maps that are still being developed.

  3. Close UDK, then in Windows go to Start | All Programs | Unreal Development Kit | ~ | Tools | Unreal Frontend. Frontend can be used to launch the editor, to launch a game to play, or to package a game. You can also use the search field to pop it up quickly, as shown here:

  4. Once Frontend launches, choose the type of game you are cooking using the preset. Two types are for mobile, and one is for PC. In this case, choose the PC version which is called DM-Deck.

  5. In the Maps to Cook window, highlight the entry DM-Deck and choose Remove. Then click the Add... text button, and choose it from the list (which shows all the valid maps UDK can find in UDKGame\Content). If you haven't got a map to use, the name of any map in the list will do. After all, this is just a test run.

  6. If you intend to bundle together several maps for cooking, you can specify the initial launch map in the field called Launch Map, by turning on Override Default and choosing one from the list, which is based on the maps to cook. Remember, if an included level depends on another (for a menu or go to map upon completion), to avoid errors you will have to include that to cook too.

  7. You can set the Target Directory for the output file (although to be safe, you may as well leave the default setting for this alone).

  8. Along the top of the Frontend interface there are big glossy icons. Click Launch to show the options for it (on mouse release), and click the checkbox to disable this feature. Then, since for now you don't need to compile any scripts, just click on Cook and choose Clean and Full Recook. Then wait till you see the report in the feedback panel showing success.

  9. Now click the icon for Package Game and enable its Step Enabled checkbox, and then click the embedded Package Game command. A dialog will appear asking for a GameLongName and a GameName. GameLongName determines the way your game will appear in Windows in the Start | All Programs menu. The GameName is what's given to the installer filename. Appended to this will be the prefix UDKInstall, so if you typed in MyGame as your GameName, you'd get UDKInstall-MyGame.EXE.

  10. Press Package Game after entering these names, and wait till you get the success notice returned in the messages in Frontend. Once finished you'll have an .EXE installer which installs the same way UDK installs in the folder you specified in the Target Directory field.

 

Mobile device emulation


If you are using a UDK version from June 2011 onwards, once you've made a level, you can test how it may appear on an iPad or similar mobile device. This recipe covers the feature and also briefly explains how to deploy a game to a device.

How to do it...

  1. With your map loaded press the Emulate Mobile Features icon, the first in the row of icons pictured below. This shows how the game may appear visually.

  2. Save your level, then click the icon Edit Mobile Previewer Settings [ ]. Choose Resolution | iPad and also choose Orientation | Landscape. Of course, you can set these according to your target output. In Features, ensure that iPad is set. Press Save Settings. You could alternatively choose all the iPhone 4 settings.
  3. At the bottom of the Settings window there is a Play button.

  4. Alternatively, you can also click the icon in the editor next to the settings icon, called Start this level on Mobile Previewer [ ]. That's really all there is to it. Your PIE session should include a UI with on screen joysticks that emulate iPad controls. Mouse dragging stands in for input from fingers on a touch screen.
  5. When you are happy with your level performance running in device emulation mode, you can actually install to an iOS game directly from the editor using the Install on iOS device icon [ ]. Right-click on this to use a command line in order to enter game-specific settings such as the number of players.
  6. The game will cook through a background instance of Frontend then provide a dialog for deployment.

  7. Bear in mind that to actually send an iOS game to hardware you need to be an iOS registered developer. You can register as one from the dialog after pressing Install on iOS device, or do so through Apple's website: http://developer.apple.com/programs/ios/; though because Apple does levy an annual fee for the right to develop on their platforms you want to be ready to do so before you start paying out. Once you are registered you can proceed through the Unreal iOS Configuration dialog to provision and deploy your game. More information on this is available through a link to UDN inside the dialog itself. If you run this by mistake, it is quite okay just to cancel it.

  8. For provisioning, should you be taking things that far, it is recommended on PC to use Safari, given it is Apple's main web platform, as iOS provisioning is generally aimed at Mac computers. Once through the provisioning stage you'll wind up with certification files to import back into the Unreal iOS Configuration wizard, and once those are imported, the last step is to set the bundled content names and display names that will be used by the device for your game's icon.

  9. Once those steps are complete, and you press Ready to Package, your game is sent to the device. This assumes you have gone through the steps starting from the editor, as currently Unreal Frontend itself doesn't complete this stage.

  10. Existing developers of iOS applications who wish to develop iOS games using UDK must export their certificate and private key from the Keychain Access application in order to import it on a PC running UDK.

 

Kismet debugging


If you are using a UDK version from June 2011 onwards, when you are using Kismet to create events and actions to enliven the actors in the scene, you can track the nodes that are being used (or not used) and also check some statistics for how frequently nodes are firing. There is a lengthy chapter on Kismet operations in Chapter 4, Got Your Wires Crossed? This recipe is not a Kismet lesson, just a procedure for enabling the Kismet debugging tool using an existing scene.

Getting ready

Load the scene from the provided content: Packt_01_BreakPoints_START.UDK.

How to do it...

  1. This map is set to UTGame for its Game Type, so when you Play in Editor (PIE) [ ] you will have a HUD and you can use weapons. The level has a rocket launcher weapon pickup placed near the PlayerStart, and you can shoot it at a platform to allow you to create a set of stairs.
  2. The Kismet for the scene is contained in a sub-sequence BlockAB. Its functionality is covered in Chapter 4, Got Your Wires Crossed? in the recipe Allowing the player to pick up, carry, and place an object. For now, we just want to get the Breakpoints used to check the Kismet is working.

  3. First off, press the Enable Kismet Debugging icon [ ], which is located in the top icon row of the main editor next to the PIE icon as shown here:
  4. Open Kismet [ ], and expand the list in the Sequences window, then click on the Sub-Sequence labeled BlockAB.
  5. Right-click on the first event in the sequence and choose Set Breakpoint. Repeat this with all the other events in the sequence. Events are easy to spot, since they have a hexagon shape, and red outlines (that turn yellow when selected).

  6. Use the Search tool, which is the Magnifying glass icon [ ] in the top row of Kismet icons, and set the Search Type to Object. In the Search For list you'll be able to access a roll-down list and choose Destroy. Click Search, and click on the item that is found in the Results panel. Right-click on the action that is focused, and choose Set Breakpoint for this too. You should now have six breakpoints.
  7. In the editor, press F8. Immediately after the PIE window shows, you'll be paused and shown Kismet again. This is because the first breakpoint is on the Level Loaded event, which fires when the session begins. The icon for breakpoints that have been tripped shows with an arrow over their red dot [ ]. At the top of the Kismet debugging window there is a Play icon (Alt + F8). Press this, and you'll resume playing. And you'll get a pause again to show the Player Spawned event has fired. Again, press Play.
  8. The next Breakpoint will likely occur after you pick up the rocket launcher and fire a rocket at the platform on the ground. Looking at the Kismet debugger you can see some statistics showing above each involved node, the time it was last activated and the number of times it has activated.

  9. Rather than pressing Play this time, select the event labeled KActor_2 Take Damage, right-click on the icon on its right-hand side called Run to Next Action. Choose Selected and the game will let you play up till the point when the Trigger involved takes damage from the rocket. The statistics above the node will show for the Take Damage event the current level of damage to the involved Trigger. You may see many nodes stepping through as they fire one after the other. This is where you can track the order or correctness of your Kismet sequence.

  10. If you are playing and you want to check the Kismet debugger without waiting for a Breakpoint to occur, press Shift + F1. It prevents the cursor being locked to the PIE session. This is useful if you have the debugger open and accidentally set focus on the game again, while it's still paused. That will happen if you jump from one application in Windows to another then back to PIE. You still have to resume playback by pressing the Play icon [ ] in the debugger.
  11. After this point, pressing Play again from Kismet, you may notice that there is a kind of strange, continual pausing every time you hit Play. This is because one of the events involves a Trigger attached directly to the player, which is triggered by the player continually. So, while the Kismet is showing, look for and select the event Trigger_0 Touch and right-click on it and choose Clear Breakpoint.

  12. Unless you shoot the platform continually, the next Breakpoint to fire will be when you place the carried platform in the space for it against the wall. The event is called Trigger_3 Touch. It's inside the Check Block Int comment box. Directly after that event, the game should pause and show the debugging window again because the platform is removed immediately from the scene by the Destroy action on which we set a Breakpoint earlier.

    Tip

    Hotkeys for the Kismet debugger window

    • Alt + F7 = Pause

    • Alt + F8 = Continue

    • Alt + F9 = Step through

    • Alt + F10 = Run to next action

About the Author
  • Thomas Mooney

    Thomas Mooney grew up in New Zealand. He now lives in a jungle with squashed frogs, mosquitoes, and regular thunderstorms and power cuts. He is a lecturer in design and also works as an artist. You can learn more about his work at www.tomofnz.com. Tom tends to work, play, teach, and sit around all day with computers, and also likes to do comics, films, maps, screenplays, novels, storyboards, and iPad doodles. His book Unreal Development Kit Game Design Cookbook, Packt Publishing was published earlier in 2012.

    Browse publications by this author
Unreal Development Kit Game Design Cookbook
Unlock this book and the full library FREE for 7 days
Start now