FAQ: Platforms

FAQ includes content originally written for UDN.

Packaging for Platforms

What is the correct “procedure” to define primary asset types? Is it just adding a line into DefaultGame.ini, [/Script/Engine.AssetManagerSettings] as PrimaryAssetTypesToScan?

  • The procedure is covered in our Asset Management docs, you can take a look at the ActionRPG sample for a good example.

What is the suggested flow to assign assets to chunks? Organizing them into the collections?

  • There isn’t a single suggested flow, the Cooking and Chunking doc discusses multiple options. The one thing we plan to add to that doc is how to actually make a label, it’s via Create Advanced Asset->Miscellaneous->DataAsset then picking label as the type.

Do we only need to assign the Primary assets to the collection, or all assets we want to be in the chunk? Will a Primary asset automatically pull all its referenced assets into its chunk, or do we need to assign Secondary assets to the collections manually?

  • If the collection or tagged directory includes primary assets, it will also grab any secondary assets that are not already assigned to a primary asset with a higher priority. The best example of basic dependency setup is in the ShooterGame sample. You can look at the label assets in the Maps folder. New labels can be defined by making a DataAsset, as they are a subclass of that.
  • For resolving multiple dependencies, it uses the Priority of the label (or ini setting). It basically starts with the highest priority and works down, so if you have a priority 2 map and a priority 1 map, all assets shared by both would end up in the pak of the map assigned priority 2. However, if the maps have the same priority, it will actually put the shared assets in BOTH pak files, and the engine will use the copy in the last-added pak file. This is useful if you’re doing something like downloading paks on demand, but if they’re all on disk you probably want to set priorities to avoid it.
  • All of this logic is controlled by virtual functions in the AssetManager, if you’re doing anything complicated with soft prs then you’re probably going to have to subclass and override some because the engine can only do so much to guess at your data layout. The logic mentioned is implemented in UAssetManager::ShouldSetManager, but you can also override GetPackageChunkIds and other functions if needed. All your changes can be previewed in the editor as described in the Cooking and Chunking doc page. You can also set many overrides in the AssetManager project settings instead of using labels.

What are the ways to list assets per chunk, as well as to list the assets from the content that were not included into any of the chunks?

  • Covered in Cooking and Chunking under “Analyzing Asset-to-Chunk Assignments. Anything not assigned to a chunk will end up in chunk 0, so you can inspect that chunk.

How does patching work with chunks? Will each patched chunk have its own patch package created? Or will there be a single patch for all chunks, even those that are only downloaded on demand?

  • Patching is currently done in a very game-specific way for Fortnite and Battle Breakers, and none of that code is available in the engine since it hasn’t been generalized to work with other projects. We’re hoping to have some of that functionality available to share soon

Any suggestions on how to organize PAK files with materials, textures, meshes, etc.?

  • We use the FileOpenOrder, which arranges them in the order they are loaded in.
  • It runs through the game once to create the FileOpenOrder.
  • There might still be some cases it does not get loaded in the optimal order, we have considered grouping by asset types such as textures.

Mobile General Tips

How did you deal with mobile platforms challenges related to minimizing content and memory footprint?

Are there any best practices for mobile development beyond what is in the published documentation?

  • Start testing on devices early
  • Thermal and CPU are big issues on low-end devices. We are close to being CPU bound
  • CPU performance contributes more to thermal than GPU
  • We have various threads, and “stat unit” shows you the breakdown of the threads. Useful for determining bottlenecks
  • In general, core gameplay loop logic should not be in blueprint code, should be in C++ or only using blueprint sparsely (mainly on events). Fine to prototype with blueprint, but best to convert to C++ in the end

What are some battery management and best practices in Unreal on Android and iOS?

  • Battery life has not currently been a major focus on Mobile compared to other areas such as memory and performance, though we do have options available.
  • We generally alter Engine or hardware settings based on different events to better optimize and preserve battery life. Those events are customizable, like “In Lobby”, “In Game” or after no user interaction for a period of time. Other events could be triggered when the device runs below a certain percentage of missed frames or even via a user facing toggle. We use a user facing toggle to drop the settings to a lower quality and resolution at the player’s choice. It is recommended to only hook into events that occur infrequently or at a transition point.
  • We generally perform minimal battery lifetime tests for initial release, but this is not yet a regular part of our automated testing. Once the current memory and performance initiatives are complete, battery life will become a heavy focus, as well as heat generated. We have active conversations with Samsung and Google to integrate APIs from them for this effort and have working relationships with other vendors to discuss how to improve here.

Are there minimum specs for mobile devices?

Will the UE4 networking and online subsystem connect mobile phones to servers that have VR and PC players, without further work in the backend of the device (Android Studio/Xcode)?

  • Our networking is largely device agnostic, but there will be some device-specific steps as required by the platform in questions (i.e. requesting permission for various things in the Android or iOS SDK). If the mobile devices get disconnected, reconnecting mid-match would require a project specific solution.

Does Mobile have the same implementation as a tablet?

  • For the most part, yes.

For converting to an iPad version, is the process relatively simple or is it something we should prep during production? If so, what optimizations make the biggest influence?

  • The project should be executed on the target platform as often as possible. Performance is a constant battle and it’s much easier to adjust as you go since you can apply your learnings to the new content (vs optimizing at the end.)
  • This link provides some reference as to what features work on iOS.

Mobile Debugging General Tips

What are the pros and cons of debugging Android applications through Visual Studio vs through Android Studio?

  • Android Studio is the only practical way to debug right now
  • Google has a VS plugin in development, but current workflows that work today are around Android Studio. We work closely with Google - if VS plugin is a good workflow we would consider it.

When playtesting on-device, how do we capture and harvest crash dumps?

  • We previously used Crashlytics (migrated to Firebase) for a few years for both Android and iOS and it was successful.
  • We have recently migrated to a proprietary Epic crash reporter to flesh out our own service.
  • Our internal tools are not production ready for licensees, it will be a long time until this happens, we recommend looking into third party solutions like Firebase or something equivalent.

What do you recommend for collecting crash data on customer devices and debugging those crashes?

  • In the past we have used Google Crashlytics via Fabric (migrating to GoogleFirebase in March2020) as a third party crash reporting solution on iOS and Android. We have recently transitioned to an internal crash reporting solution which has yet to make its way to main Engine source for licensee use. Going forward most of our platforms will be transitioned to our own crash reporting system where possible and available for licensees. No ETA on availability of the Epic solution yet, but integrating third party or proprietary solutions are absolutely feasible.

On which mobile devices is output logging supported?

  • Well supported on Android.
  • Not that well supported for iOS on Windows, but it does work with some effort.

Mobile Previewer

What is the recommended workflow for previewing what graphics will look like on mobile platforms?

  • There are a few ways to preview using the mobile renderer on PC.
    • Editor “Settings, Preview Rendering Level, Android ES 3.1 or iOS”. Aka “Feature Level Preview”
      • Mobile versions of the shaders, lighting and materials with Direct3D in editor viewport and in-editor PIE
      • Any settings in Android/AndroidScalability.ini or IOS/IOSScalability.ini settings are applied
      • Applies any Per-platform Property overrides
      • Shader precision limitations on device are not emulated
    • Mobile Preview ES 3.1 (PIE)
      • Same as running -featureleveles31. Standalone game instance on Windows.
      • Slightly more accurate than Feature Level Preview but not by much
    • (Experimental) Device Specific PIE
      • Same as Mobile Preview ES 3.1 (PIE) but applies local device profile ini settings.
      • Artists use and regularly toggle Preview Rendering Level inside the editor viewport and with in-editor PIE.
      • This does a good job of mobile materials, shaders, post processing, scalability settings, and per-platform properties.
      • Does not emulate half-precision related issues in artist materials.
      • Does not test whatever overrides you have in device profiles.
      • But for the majority of content work on Fortnite, this is how artists create content.

Is Mobile Preview configurable for a specific device profile?

  • Currently Mobile Preview only applies scalability settings.
  • But if you set up the scalability in the way it’s intended, you can switch to Preview Rendering Level and Scalability Level and you will get what you would see on various devices in terms of LOD transitions, material qualities, foliage density scales, etc…
  • 4.25 shipped with IOS and Android scalability ini files in the same style we use in Fortnite.

Does Epic use any tools to emulate Android devices on PCs?

  • We do not use any PC based Android emulator, e.g. Bluestacks, for Development

What influences the differences between what you see on the editor vs on the mobile device?

  • Scalability/Post processing causes this difference, but there are INI file settings to help with this

Is there a recommended way to calibrate our preview of lighting in the editor to match mobile devices?

  • 4.25 added eye adaptation, which helps with this
  • Issues with brightness often caused by mismatch on eye adaptation
  • Shading should be the same, but if they aren’t, it’s likely a post-processing issue
  • There are several lighting quality differences, on desktop vs mobile
    • We use half-precision GTX friendly adaptation, which was a major change around 4.23
    • Legacy lighting model setting is available

See more Platform information on the Knowledge Base.

1 Like