UDK iOS Game Development Beginner's Guide — Save 50%
Create your own third-person shooter game using the Unreal Development Kit to create your own game on Apple’s iOS devices, such as the iPhone, iPad and iPod Touch with this book and ebook.
The UDK iOS Game Development Beginner’s Guide takes a clear, step-by-step approach to building a small third-person shooter game using the Unreal Development Kit with plenty of examples on how to create a game that is uniquely your own.
In this article by John P. Doran and Christos Gatzidis, authors of UDK iOS Game Development Beginner's Guide, we'll:
- Learn about the Unreal Engine and what we expect to create
- Install UDK on our computer
- Go through an overview of UDK's directories
- Download and install UDK Remote
- Match the Mobile Previewer settings with your iOS device
- Describe the project we are going to be creating
Unreal Development Kit (UDK) is a freely available version of Epic Games, a very popular Unreal game development engine.
First developed in 1998 to power the original Unreal game, the engine (which is C++ based) has gone from strength to strength, and has not only formed the backbone of household-name Epic Games titles, such as the very popular Gears Of War series, but has also been very successfully licensed out to third-party developers. Consequent titles range from Batman: Arkham City to Mass Effect 3, many of which are as equally successful as the games developed by its parent company.
Currently, the Unreal engine itself is in its fourth iteration and is considered to be a top of the range visualization tool. It is not only used in the gaming industry, but has also been used for doing any kind of work that demands real-time computer graphics. UDK uses Unreal Engine 3, but it is still a powerhouse in itself and is quite capable of delivering amazing experiences on iOS software.
The offering of UDK as a concept has evolved from Epic Games content generation tools very early on with Unreal titles; tools which proved to spawn a very healthy and thriving modification (modding) community. Originally, tools like these, such as UnrealEd (the editor tool with which a user can create their own in-game level), were available to anyone who bought the game.
In 2009, however, Epic turned that logic on its head by making their tools available to anybody, whether they owned an Unreal game or not. This proved to be a very successful move which expanded the Unreal developer user base thoroughly.
More recently Epic Games, as part of their constant and persistent updates of UDK, have added iOS functionality (in 2010), making sure that UDK can provide games for the ever-expanding mobile customer base that the iPhone/iPad/iPod Touch devices by Apple introduced. This was first demonstrated to the public by a live tech demo called Epic Citadel; a freely available download on the iTunes store which played like an interactive walkthrough of a medieval town. This attracted a record number of downloads as at that time it was truly groundbreaking to experience high quality real-time graphics on a mobile device. Take a look at the following screenshot:
In fact, although it is not within the scope of this book, very recently certain demos have surfaced highlighting a potential UDK / Adobe Flash Player pipeline, showcasing the very impressive penetration this games development application has made to a number of different platforms.
Of course, we are interested in iOS here, and we'll be covering that extensively in this book, starting from the bare basics and moving on to some more advanced concepts.
So what is it that we need to know about UDK and its mobile iOS limitations? Does it have any?
Don't expect to make Gears of War
Let's start with a fairly realistic statement; we can't make an AAA gaming title as seen on a contemporary console or PC, such as Gears of War, on iOS using UDK! It is a general limitation of doing mobile development using UDK.
The main reason for this is rather obvious; we just do not have access to the same hardware. The problem is not the software! UDK can deploy the same game on a PC or an iOS device, but it is the end-hardware specification that has the final say in what can be handled in real-time or not.
Mobile devices (and this of course includes iOS devices) have progressed by leaps and bounds over the last few years, and after many false starts mobile gaming today is a force to be reckoned with, both commercially and technologically. That still, however, does not change the fact that as an iOS UDK developer, you will work with more restricted hardware as opposed to, for example, someone developing for an Xbox 360 platform.
Let's look at this in more detail; these are some of the current iPhone 4S technical specifications:
- 960 x 640 pixel display
- 16 GB, 32 GB, or 64 GB Flash drive
- Dual-core 1 GHz Cortex-A9PowerVRSGX543MP2GPU
- 512 MB RAM
The newest iPad released in early 2012 has the following specifications:
- 2048 x 1056 pixel display
- 16 GB, 32 GB, or 64 GB Flash drive
- Quad-core PowerVRSGX543MP4GPU
- 1 GB RAM
While these specs are fairly impressive compared to both mobile devices of the past, and also the fact that we are talking about what is essentially a pocket gadget, they cannot really compare with the specification of a top-of-the-range gaming PC or even a current generation console.
This, of course, does not mean we can only develop poor or second rate games with UDK. Indeed, some of its contemporary examples highlight the huge potential it has in delivering AAA gaming experiences, even with its current limitations, borne, as described previously, from the hardware limitations of a mobile device.
The best example by far has got to be Chair Entertainment's and Epic Games' Infinity Blade, an epic third-person sword-fighting game which came out in late 2010 and is considered the ideal showcase for UDK's technical prowess on the Apple devices.
Already spawning sequels and with huge commercial success behind it from its iTunes Store business model, Infinity Blade was, and is, a big eye-opener for all aspiring games developers who want to use Unreal engine technology for a successful iOS title with a very modern feel and visuals.
To see just how powerful an iOS game can be, just look at the following screenshot for a fine example:
eBook Price: $26.99
Book Price: $44.99
Downloading and installing UDK
We will download and install UDK on our computer for developing the games!
Time for action – installing UDK on your PC
UDK can be installed using following steps.
- Start up your choice of Internet browser and visit UDK's website, http://www.udk.com. This is shown in the following screenshot:
- Click on the blue Download UDK button on the top right-hand side corner of the page. This is shown in the following screenshot.
- Download the latest release on the left-hand side by right-clicking on it and selecting Save link as.....
- It is likely that you will also get a prompt for a Microsoft .NET installation, please install that too. This shouldn't take as long as the UDK download (as you can see in the following screenshot).
- Once the UDK installer has finished downloading, open the file and select to Run the file, if a security warning comes up allow the installer to make changes to your computer, if your computer asks.
- The installer, at this point, will ask you to sign an End User License Agreement (EULA).To continue installing the program you have to agree to the terms by clicking on the I Accept button.Please be aware that Epic Games wants you to sign an end user license agreement at this stage.Typically, particularly for free applications downloaded from the Internet, people tend to disregard this bit and not read these in any great detail, and merely sign them by clicking on the I Accept button.I would, however, strongly urge you to read this, particularly if you have aspirations towards becoming a professional UDK developer. You need to understand the agreement you are entering into for a number of reasons.In general, using UDK for educational use or for non-profit reasons for the most part is completely free, but if you intend to charge for your game or make revenue off of it for any reason, you will have to pay Epic $99 up front as well as a percentage of revenue after the game has made over $50,000.
- Next, install the program to your directory of choice. I used the default location. The installation process typically take a few minutes to complete (remember the large file size of the executable file you downloaded!).
- Upon installation, you will have the option to Launch UDK.
- Go to the directory that you installed UDK in (the one you selected in step 6). The default directory is C:\UDK\UDK-2012-05, as shown in the following screenshot:
(Move the mouse over the image to enlarge.)
We will discuss how to download UDK in the next step, but for those just getting started with UDK, I would also urge you to take some time and explore this website further. It has a very thorough explanation of UDK and the features it has, regularly updated showcase projects (including commercially available games), information on licensing, and in short, it is a must-visit site (on a regular basis in fact) for any self-respecting UDK developer as here you can also find the latest up-to-date version of UDK for your use.
Epic Games also has a very active forum as a part of their community. For those tackling iOS development like we are, there are also community forums for us. You can find it by either hitting the Community tab at the top or then selecting iOS Development or just visit them directly at http://forums.epicgames.com/forums/396-iOS-Development.
First of all, remember that you are now installing the full UDK application, not just the iOS-oriented one. There is in fact no such thing; UDK adopts a very holistic approach when it comes to multi-platform development.
Remember as well that Epic Games releases updates of UDK on a fairly regular basis. However, as there can be incompatibility issues with older and newer versions, they have made every single update (its installer file) available with its release date clearly visible, from the very first one released (November 2009) to the current one (May 2012). Please note that the May 2012 UDK Beta is the version we will be using in this book and while everything that we are doing in this book should work with later versions, UDK is constantly evolving and in months to come, there may be certain quirks in the engine that may not work until Epic will fix it in a later version.
However, please note that this step may also trigger a restart of your PC, so save your work in any other applications beforehand.
What just happened?
You've now installed UDK on your computer and taken your first step towards UDK development.
eBook Price: $26.99
Book Price: $44.99
UDK directory overview
Epic Games provides a number of example maps and files which are worth exploring (including mobile ones), before setting off on the development of your own game. Now that the software is installed, let's take a look at what exactly the directories we created are holding.
The Binaries folder holds a number of executable files, including the main UDK program and tools for artists and animators. Besides the UDK executables, we probably won't be touching anything here, but I'll briefly go over what the other folders hold.
- ActorX: It includes plugins to export models from 3dsMax or Maya.
- FaceFXPlugins: It has tools for character facial animations.
- GFx: It has tools used with Flash to integrate Scaleform in your game for HUDs or other things.
- iPhone/Mac: It contains Packager programs used to export your game to be published on either the iOS or Mac platforms, respectively.
- SpeedTreeModeler: This is a very quick way to make nice-looking trees and vegetation for game levels.
- Win32/Win64: It contains the 32-bit and 64-bit versions of UDK and all of the libraries needed to run it.
Development holds the UnrealScript files of different classes created for the game. We won't be looking at it in this book, but feel free to look there some time to get a feel for how the gameplay logic works. For those comfortable with coding, you should feel free to read and extend things that were already created, but it is incredibly important to mention that you should never alter Epic's code.
Engine is where the engine files, holding resources, and configuration files are located. We won't be touching them in this book, but of special note is the iPhone folder, which can be used to set specific iPhone functionality for your game.
UDKGame will include following directories:
- Autosaves: This folder does not exist yet,as we haven't used UDK yet, but when you are working on levels later, this folder will be created in order to create backups of files you are working on. This isn't a replacement for you saving your work yourself, but in case UDK unexpectedly shuts down, you may have a chance to recover most of the work you did.
- Build: This folder contains assets that are required for publishing on different platforms. Of note is the iPhone folder which contains Resources that we will be using later in the book such as music and graphics for the App Store.
- Config: This folder contains .ini files, which we can use to change how the game itself functions. While we won't be touching this in the book, we will be using knowledge contained in the files, such as the key bindings which are found in the DefaultInput.ini file.
- Content: This is the folder where all of the assets that we create will go into. The file organization doesn't matter too much, as long as it makes sense to you. As long as it's in here, UDK will be able to find it. If you go into the UDKGame folder, then in Content | Maps | Mobile, you will be able to find a number of iOS-intended levels, including the aforementioned Epic Citadel, but also a very cool version of one of their earliest games (recreated lovingly on UDK); Jazz the Jackrabbit. This was originally a 2D platform game and it is a great nod to Epic Games' history to see it remade with a modern tool like UDK.
- Flash: For those of you interested in integrating Scaleform into your projects, here are examples of files created just for that purpose. You will need to have Flash in order to open the files and they will not work unless you set it up correctly. For more information about that, check out http://udn.epicgames.com/Three/ SettingUpScaleformGFx.html.
- Localization: This folder contains files for converting your game into other languages.
- Logs: UDK keeps a record of what happens while you run it, so if errors occur, you can see exactly what went wrong. Useful for debugging, but you shouldn't need it.
- Movies: Any cut scene movies that you would like to use would be placed here, if you were developing for PC/Mac. We will not be using this folder for iOS development or in this book at all for that matter.
- Script: All source code generated ends up here when it is compiled. As we don't have any coding in this book, it will not be of much use to us.
- Splash: This folder contains images that show up when the game is starting up, as well as links to the Unreal Developer's Network (UDN) and the Epic Forums.
Setting up for iOS development with UDK
Before we get your iPhone interacting with UDK, here are a few brief notes you should be aware of. We've looked at installing UDK on our PC, but what about the mobile device requirements?
While we will go into detail about deploying your game on the actual device with all the issues this entails in a subsequent step-by-step and illustrated chapter, there are still some very important initial topics that need clearing up in terms of becoming a UDK iOS developer.
First of all, the devices currently supported by Epic Games for UDK iOS games production, according to Epic Games, are the following:
- iPhone 3GS
- iPhone 4/4S
- iPod Touch third generation (other than for 8GB capacity third generation devices)
- iPod Touch fourth generation
If you have an older iOS device, then unfortunately you won't be able to carry out UDK development for it. Also worth noting is that the iPad third generation currently works in UDK by using the iPad 2's system settings, and will most likely be fully supported with its own system settings by the time you have this book in your hands.
Additionally, you will need to be running iOS version 3.2 or higher on your device, plus iTunes installed on your PC in order to do UDK development. However, in order to publish your game to the iOS App Store, you will be required to use a Macintosh computer.
Walkthrough of Unreal Remote
So, with the practicalities out of the way, let's get our first taste of what it's like to develop for an iPhone with UDK!
The first foray we will be undertaking in this section and chapter will be a modest one indeed, but it is still a good showcase of the capabilities of iOS game development with the Unreal engine, particularly in terms of interacting with the player.
UDK Remote is an application designed by Epic Games to push, touch, and also tilt controls - essentially everything you need to control an iPhone or iPad game - from the mobile device onto your development machine (PC).
The Mobile Previewer is an option that can be triggered inside the main UDK executable, which can be used to run the mobile UDK game on your PC. It is created for minor testing in much the same way that playing in the editor itself is an option in the main UDK executable. Think of the option as an emulator of what your game may look like on a specific mobile device. The option is not an entirely perfect one though, remember that the graphics processing unit on the PC will be more powerful than your iOS device's which could result in it being much faster in rendering content. Some visual effects results may be different too, for example, anti-aliasing. A good idea would be to very occasionally deploy the game on the mobile device just to make sure you are not exceeding its technical capabilities and also that everything looks the way it is supposed to.
Both of these applications (UDK Remote and Mobile Previewer) can work in conjunction - as we will see!
The example in this section will not work without both your PC and your iOS device being connected to a Wi-Fi network; it is not enough for the device to be connected on a 3G network. Please make sure your device has its Wi-Fi settings on and is on the same network otherwise the following example will not work.
Time for action – downloading and installing UDK Remote
- Before you do anything else, fire up the UDK editor. Then, go to the iTunes Store, which, as an iOS user, you should be fairly familiar with by this stage. Type in udk remote, as shown in the following screenshot:
- Click on the Free> button to change it to say Install. Click on the button again to install the UDK Remote application on your iOS device.
- Sync your device with the new app. Make sure your iOS device is properly synced by disconnecting it and looking at the menus of your device till you find the application installed.
- Start up the UDK Remote application by tapping on its icon. You will be prompted to fill in details about your machine.
- You can go back to the settings by clicking on the i button at the top right-hand side corner of the screenas shown in the following screenshot:
- On your computer, click on the Start menu and select All Programs | Accessories | Command Prompt, as shown in the following screenshot:
- Type in ipconfig when you reach the command prompt and make a note of the IPv4 address that comes up. Go back to UDK Remote on your iPhone, click on Computer Addr and put in the value of the IPv4 address shown in the command prompt,and then click on the OK button to finish.
- Go back to Settings on UDK Remote (as you can see you can interface the application with more than one computer) and click on Done.
- Now, next to your IP address and port, you will see the following message, as shown in this screenshot:
- Your IP address and port will also be highlighted in yellow color as this means you have not hooked up with UDK yet, so let's do that next.
- Open up the UDK editor that we launched in the previous section. Along the main toolbar, you will see an icon that looks like an iPhone with a play button next to it in the top-right corner. This is the Play on Mobile Previewer button.
- Alternatively, you can also select Build | Play on Mobile Previewer from the top menu above it. This is shown in the following screenshot:
- Wait till this fires up (it will take a few moments even for a very basic scene such as the default one) then look at your iPhone. The previously mentioned Waiting for connection… will have changed to Connected to… as shown in the following screenshot:
Epic Games has actually made this a free application too like UDK itself, so it will not cost you anything.
The only setting you need to change in order to get UDK Remote to work is typing in the IP address of your computer so that your iOS device can communicate with it. Let's leave the other ones as they are for now.
You can, however, before we resolve the IP address issue, quickly click on the Done button on your iOS device to check out UDK Remote.
You should now be taken to the UDK Remote runtime screen which as you can see is very basic.
Of course, there is no way this could work without setting up a communication between this and a host machine (your computer), as you can see from the error message.
So, ‘what is my IP address?' you may ask. There is a quick way to find this out in case you do not know it.
You will be prompted with the settings of UDK Remote (most of which are quite self-explanatory).
What just happened?
Look at your computer screen while dragging your finger(s) on your iPhone, you can now navigate around the basic UDK scene in a three dimensional space on your computer using your iPhone over the wireless network!
Use the multi-touch functionality to play around with this and get a feel for what you can do with the interactions provided.
The circular touch pad on the left-hand side, as shown in the following screenshot, can be used for movement while the one on right-hand side for strafing.
If you have played 3D games before, and, in particular, first-person shooters (not necessarily on an iOS platform either), this should be a very familiar way of controlling a player in a scene!
Spend some time experimenting with your first attempt at iOS game development!
Time for action – matching the Mobile Previewer settings with your iOS device
Now that we have our interactions working between our iOS device and our PC, let's make sure that it is being created for the specific device that we are using. Thankfully, it's very simple to do that.
- Before we move on, you should be aware that you can change some of the options on the Mobile Previewer, and indeed you should, in order to suit your device. Click on the Edit mobile previewer settings button as shown in the following screenshot:
- As in this chapter we are using an iPhone 3GS, I changed it to allow for that, you can also change the orientation of your display from landscape to portrait if you want. This really depends on the type of game you are developing.
Let's leave it on landscape. This is done as shown in the following screenshot:
What just happened?
No matter which iOS device you have, you are now ready to use the UDK Remote and Mobile Previewer to test out all ideas and ultimately our prototype game in subsequent chapters, so already the step we have made towards this is a very important one!
Speaking of the prototype game, what exactly will we be developing?
Describing the concept of Urban Warrior, a third-person shooter title
We have talked about Gears Of War earlier and how difficult it would be to try to recreate it, with the same level of detail and complexity on an iOS device with UDK (which is based on the same engine, remember, that Gears of War was developed on).
How about we have a stab at that then and see how close we can get?
Rather than trying to produce a more casual, basic game with UDK, it would be of more interest to approach the work carried out in this book as small building blocks towards creating your own AAA title!
We have titled the game (tentatively and perhaps not particularly imaginatively) as Urban Warrior and it will have the following characteristics:
- It is a very typical single-player third-person shooter game, very much in the Gears of War style
- The playable 3D environment will be (mostly) a large open area of a city that will have interactive elements, such as doors that open when you walk up to them
- The player will traverse the game world getting involved in different scenarios depending on the path that he makes as he moves along towards his goal
- We will be creating our own custom AI system for enemies
- There will be custom assets of our own creation added into it to provide a unique experience for players
For now, despite being very broad, this brief is good enough for us to make a start on as we can begin exploring the very vast UDK functionality to accommodate some of the preceding goals and work our way towards some of the finer details of the game.
I will be returning to this key game idea throughout each subsequent chapter to discuss what progress we have made and, more importantly, how it is all fitting together into one cohesive gaming experience.
Hopefully you've enjoyed taking the first few steps towards becoming an iOS games developer with UDK!
There's still plenty to do, but we have already managed to cover the following in this chapter:
- Learned about what UDK is
- Seen what can/cannot be achieved with UDK using an example
- Explored Epic Games' dedicated UDK website and download and install the application
- Downloaded and installed the UDK Remote
- An overview of what you will need to develop games with UDK on the iOS platform
- Interfaced your device with UDK on your PC and used it for basic interaction with Mobile Previewer
Resources for Article :
- Configuration and Handy Tweaks for UDK [Article]
- Unreal Development Toolkit: Level Design HQ [Article]
- Introduction to Game Development Using Unity 3D [Article]
- Xcode 4 ios: Displaying Notification Messages [Article]