UDN
Search public documentation:

UnrealOnMobile
日本語訳
中国翻译
한국어

Interested in the Unreal Engine?
Visit the Unreal Technology site.

Looking for jobs and company info?
Check out the Epic games site.

Questions about support via UDN?
Contact the UDN Staff

UE3 Home > Mobile Home > Unreal Engine 3: Mobile Overview

Unreal Engine 3: Mobile Overview


Overview


Developing games for mobile devices using Unreal Engine 3 requires tailoring certain aspects of the game's design and creation to fit within the guidelines, advantages, and limitations that are inherent to the mobile form factor. This document provides a general overview of some of the features of, and considerations that must be accounted for when developing on, mobile platforms.

Mobile Platforms


Apple iOS

While all mobile platforms share similar form factors and thus the advantages and limitations that come with the territory, developing games for Apple's iOS platform has its own intricacies and particulars. There are also special hardware and software requirements for developing iOS games and publishing iOS games to the App Store.

For information specific to creating games for Apple's iOS platform, see the Unreal Engine 3: Apple iOS Overview page.

Android

For information specific to creating games for Tegra devices, see the Unreal Engine 3: Android Overview page.

  • Android support is available to full UE3 source licensees. If you are developing a UDK title and wish to explore moving from UDK to UE3 in order to target additional platforms, please contact the sales team at Epic to discuss our competitive terms and licensing options.

Getting Started


Information on setting up your development environment for compiling for mobile devices including hardware and software requirements, as well as general workflows for deploying and debugging an Unreal project that runs on a mobile platform can be found on the Getting Started: Developing Mobile Projects page.

Streaming on mobile


Asynchronous level streaming is supported on mobile devices. See this page about the current state of texture streaming.

New Input Subsystem


See this page for information about the whole new input system needed for multi-touch and tilt support.

System Settings for Mobile


Mobile devices are much more varied for a given platform than others. There is one single Xbox 360. There are 5 (and counting) iOS devices that will run a UE3-powered application. As such, the .ini-driven SystemSettings concept had to adapt. It is still .ini driven, but there are multiple sections in your Engine.ini file, and the appropriate section will be used for the device that is being used. Additionally, the mobile previewer can be directed to use a particular device's settings, so you can see the effects of your changes very quickly.

BaseEngine.ini contains defaults for iOS devices for all games. Your game's DefaultEngine.ini can override these as usual. You can see in BaseEngine.ini, in say the [SystemSettingsIPhone3GS] section, that the SystemSettings now have a "BasedOn" tag. This creates a hierarchy of settings so that you can easily apply a change to all devices for your game, and then override only particular settings for each platform.

Currently, the all platforms except the iPhone 4 (which has double the memory) has reduced texture sizes, using the [SystemSettingsMobileTextureBias] section.

There are many mobile-specific SystemSettings. See this page for a guide to mobile system settings.

Framerate


With Epic Citadel, we aimed for 30 fps in the general case. It is possible to run at 60 fps, although you'd have to make content tradeoffs. There is an Engine.ini value that controls the max framerate:

[Engine.Engine]
MaxSmoothedFrameRate=35
bSmoothFrameRate=TRUE

For 60 fps, change MaxSmoothedFrameRate to 62. You can also disable bSmoothFrameRate to let it go as fast as it can, but we do not recommend this, as the framerate may tend to bobble between to different framerates (20, 40, 20, 40, etc), which generally looks very bad.

Saving data on mobile


There are currently three ways of saving data/game state on mobile devices:

BasicSaveObject()

There is a static script-accessible native function in the Engine class that can be used to save an object (and it's properties, naturally). You would generally create a single one of these objects to store all of your settings, then save the object, something like this:

   MyObject = new SomeClass;
   MyObject.Value = 5;
   class'Engine'.static.BasicSaveObject(MyObject, "SaveGame.bin", true, 1);

MyObject is the object variable to save. "SaveGame.bin" is the name of the file to save. true specifies that FILEWRITE_SaveGame will be passed to CreateFileWriter (this must be true for iOS to be able to load the file later). 1 is a game-specified version number, that can be used to not load older version files.

To load the object later (to load save game, etc), you would do something very similar to the save case:

   MyObject = new SomeClass;
   class'Engine'.static.BasicLoadObject(MyObject, "SaveGame.bin", true, 1);

After this, MyObject.Value will now be 5.

Note that only basic properties (ints, floats, strings, names, etc) and arrays/structs of basic properties will be saved. You can save an object pointer, but when loading, the object must already be in memory (it uses StaticFindObject on the pathname of the object, since object properties are stored as strings).

Console commands

[Currently this method only works in iOS]

You can also manually save (and load) a single value via a console command in Kismet or script code:

   mobile SaveSetting <SettingName> <Value>
   mobile LoadSetting <SettingName> <DefaultValue>

With this method, all settings are saved and loaded as strings. It will be up to the code that runs the console command to do any necessary conversion to/from a string. When loading, you specify a default value that will be returned if the setting has not been set yet:

  local int SavedValue, LoadedValue;
  SavedValue = 10;
  ConsoleCommmand("mobile SaveSetting TestSetting " $ SavedValue);
  LoadedValue = int(ConsoleCommand("mobile LoadSetting TestSetting 1"));

Kismet Action

See the Mobile Kismet Reference for information on the Save/Load Values Kismet action.

Mobile Audio


See this page for information about sound effects and music information.

Mobile Textures


See this page for information about texture handling and processing on mobile platforms.

Mobile Materials


See this page for information about creating and modifying materials for mobile platforms.

Compiling materials at start up

Your material usage in your levels can have a significant impact on your game's startup time. Shaders are not compiled offline, so they must be compiled in the game. Because they take some time (would cause hitches during gameplay), the engine will compile as many shaders as it can during startup (as determined by the cooker). Depending on the various material mobile setting combinations that are used in your levels, the number of shaders to compile at startup can get large (and therefore slow to compile).

Shaders that the cooker can pre-determine (which is generally more than 95% of them) are preprocessed into an optimal format for faster compiling. If there is a shader that is needed to render that the cooker didn't detect, it will be compiled at first use time (possibly hitching for a small bit).

Note that two identical materials with only different textures will not cause two shaders to be compiled, only one, as the settings are the same.

Fog


Fog is controlled on a per-level/map basis. Fog volumes are not used. See this section for information on setting up fog.

Network File Loader


The mobile framework introduces a cross-platform networked file loading system for the mobile devices.

It greatly speeds up content iteration (as well as commandline modification). Once activated, all the user has to do is quit the game, rerun it, and it will copy over new files to the device.

How to use

For it to work, you need to use UnrealFrontend:

  • Run Unreal Frontend
  • Go to the Game tab
  • Ensure that "Use Networked File Loader" is set to true
  • Perform a Sync one time.
    • This will put a file in the app that has the IP Address of the machine running UFE
  • Boot the game on the device
  • This will copy files over the network to the phone
  • It is not super fast copying over the network, but the Sync/install time is much faster
  • If you change content:
    • Cook as normal
    • Quit the game
    • Run the iPhone game (no need to touch iTunes)
    • Newly updated files will be copied over
  • If you only change the game's commandline:
    • Go to Game tab
    • Click the "Make Commandline" button
    • Quit the game
    • Run the game
    • The new commandline will be applied

Important Notes

Recompiling code

If you recompile code, you still need to click the Sync button to package up the executable.

You must keep UnrealFrontend running for it to work. UFE is the file serving host application.

This may change to be a service or something in the future, but for now, UFE is required.

Switching back to normal file loading

If you want to stop using the Network Loader, then you can uncheck the "Use Networked File Loader" checkbox, then Sync as before.

HOWEVER you must manually fully delete the application from the phone to clean the cached files from previous runs!

  • This will be fixed via code in the future (if not using the file loader, the app could delete the cached files)

Basic Workflow


Compiling

Debugging

In mobile previewer, you can use the Numpad 1 and 3 keys to step through the draw calls in a particular scene to try and isolate problems. Numpad 0 will then reset this debug mode, returning the scene to normal.

Previewing

The mobile previewer is the best option to quickly preview your game without needing to cook and sync to your device.

Note that many shading effects such as mobile fog, mobile specular, and materials created using mobile switches will not display in the editor. This is because the editor uses Direct3D and mobile devices use OpenGL ES2 and require different shaders to display the effects.