Firelight Technologies FMOD Studio API
Deployment
Package settings
This page describes steps required to prepare your project for deployment. This is relevant to both the Launch option as well as the File > Package Project menu item.
Packaging banks
Banks need to be packaged and included in the game data. This can be done by selecting the Edit > Project Settings... menu item. Navigating to the Packaging section from the left hand pane, under the Game heading, presents you with options for specifying directories that include extra assets. There are two ways of doing this:
- Additional Non-Asset Directories to Package: Will copy banks inside the final package file.
- Additional Non-Asset Directories to Copy: Will copy banks as loose files.
We recommend using Directories to Package so that bank files are bundled into the package file automatically.
Note: that each platform will look for its own type of banks in its own directory. Make sure you have added the platform to FMOD Studio project. The platforms are:
- Desktop (Windows, Mac, Linux)
- PS4
- XBox One
- Mobile (iOS, Android)
If you only have the Desktop banks and want to run on another platform, you can set "Force Platform Name" to Desktop in the FMOD advanced settings.
Bank Files Inside Content Directory
The above directory name is relative to your Content directory. It is highly recommended that banks be placed within the Content directory, as paths outside the Content directory will not deploy correctly to all platforms. For example:
- Mac doesn't allow support directories outside the Content directory at all.
- Windows and Android have issues looking up directories outside the Content directory when used with packages.
This doesn't mean you need to put your whole Studio project inside the Content directory. You can customize Studio by editing the Preferences and choosing a directory to export banks to, as described in the Working with Banks page.
Note: The integration will load the platform bank files automatically. On PC it will load from FMOD/Desktop but on Android and IOS it will look for banks under FMOD/Mobile.
Note: If you use "FMOD" as the directory to deploy and have multiple platform banks exported, then they will all be packaged up. To slim down your final package size, you may need to tweak the Additional Directories setting on a per platform basis. That way you only package FMOD/Mobile for Android, FMOD/Desktop for PC, FMOD/PS4 for PS4, etc.
Deploying FMOD audio plugins
If you are using FMOD audio plugins, you will need to make sure they are deployed as well. See the Using Plugins page for information.
Linking the Integration
For most platforms, the integration should be linked and deployed properly regardless of whether you have a blueprint or code project. It should just work!
However, some platforms still have issues.
Deployment on Linux
To deploy on linux, you will need to rebuild the engine from source via github. For compiling linux from windows, see this page for instructions how to get up and running with UE4. Then, add in both the fmodstudio linux .zip and windows .zip on top of each other into the engine plugins directory.
The last thing you will need to do is to get the FMOD .so libraries into a directory that the executable can read them. The easiest way is to copy them from
<DeployedDir>\Engine\Plugins\FMODStudio\Binaries\Linux\x86_64
to
<DeployedDir>\<GameName>\Binaries\Linux
To see what directories the .so files can be located, look at LinuxToolChain.cs. Currently there are only a set of hard coded directories that are supported.
Deployment on Android
To deploy on Android, make sure FMODStudio is in your game's directory, not in the Engine plugins directory. When FMODStudio is in your game's plugin directory, the engine will rebuild the plugin for Android and deploy all the files properly.
Deployment of Android plugins
FMOD supports DSP plugins, which will be stand-alone .so files that will need to be packaged into the build. Add the .so file into the FMODStudio/Binaries/Android/armeabi-v7a directory. Unreal will also need an APL file so it knows to package the .so file. To do this, you will need to write an APL file and drop it into the FMODStudio/Binaries/Android directory. The FMODStudio.build.cs file looks for any file ending with "_APL.xml" and will pass that along to the unreal build tool for packaging.
The APL is a custom xml file format which is documented in the engine file "AndroidPluginLanguage.cs". Here is a sample APL file for libovrfmod.so:
<?xml version="1.0" encoding="utf-8"?>
<!--Plugin additions-->
<root xmlns:android="http://schemas.android.com/apk/res/android">
<!-- init section is always evaluated once per architecture -->
<init>
<log text="ovrfmod APL init"/>
</init>
<!-- optional files or directories to copy to Intermediate/Android/APK -->
<resourceCopies>
<log text="ovrfmod APL copying files for $S(Architecture)/"/>
<copyFile src="$S(PluginDir)/$S(Architecture)/libovrfmod.so"
dst="$S(BuildDir)/libs/$S(Architecture)/libovrfmod.so" />
</resourceCopies>
<!-- optional libraries to load in GameActivity.java before libUE4.so -->
<soLoadLibrary>
<log text="ovrfmod APL adding loadLibrary references"/>
<loadLibrary name="ovrfmod" failmsg="ovrfmod not loaded and required!" />
</soLoadLibrary>
</root>
Note: You only need to write this if you want to load a DSP plugin on Android.
Deployment on other Android architectures
UE4 supports armeabi-v7a, but doesn't support building for other architectures unless rebuilding the engine from github. Because of this, we only ship that architecture by default. To get the .so files for other architectures, download the "Programmers API for Android" package from FMOD, and copy them into the FMODStudio/Binaries/Android/* directories. FMODStudio has compiled libraries for armeabi-v7a, arm64-v8a, and x86.
Loading blueprints before plugin load
One issue to be aware of is where blueprints are serialized from disk too early, before any plugins are loaded. This can occur from the following code, which is included by default in example C++ projects constructor:
static ConstructorHelpers::FClassFinder<APawn> PlayerPawnClassFinder(TEXT("/Game/FirstPersonCPP/Blueprints/FirstPersonCharacter"));
The finder will serialize the first person character blueprint, but any FMOD references will fail to load since the FMOD plugin has not been created yet. To make sure that the FMOD plugin is loaded first, add the line of code above the class finder.
IFMODStudioModule::Get();
Disabling Unreal Audio Device
By default FMOD Studio works side-by-side with the inbuilt Unreal audio device. To disable the Unreal audio while leaving the FMOD Studio audio, the standard Unreal ini file setting can be used.
For windows, add a new file
[Audio]
AudioDeviceModuleName=
The audio device can be disabled for every platform that you want to ship with.
Enabling Live Update
Note: The default permissions won't allow FMOD to set up a socket properly for live update. Uncheck the "Enable Live Update" option in FMOD settings to avoid errors.
Note: If you get a deployment error "resource.resw is in use by other process", go to the YourGame/Config/DefaultGame.ini and remove the following:
-CulturesToStage=en
+CulturesToStage=en
Deployment on XBox One
This section has been moved to a Deployment Xbox One.