Answered
0
0

When we package Xbox One builds of our game we find that they fail to start. Using the kernel debugger it appears that fmodl.dll (& I presume I need fmodstudiol.dll?) is not packaged into the build and thus the executable is failing to start.

How do I ensure that fmodl.dll is packaged into Xbox One?

  • Paul Ross

    Looking closer there are some other threads on here about FMOD & Xbox One. I don’t understand how PC packages correctly though with the dlls winding up in the finished build?

  • You must to post comments
Best Answer
0
0

On PC, the UE4 engine automatically takes care of deployment of plugin dlls. But apparently this feature has not yet been rolled out to other platforms. So on Xbox One there are some manual steps you have to do.

You’ve probably found this already, but here is a link to the FMOD UE4 documentation that explains how to deploy the plugin on various platforms:

http://www.fmod.org/documentation/#content/generated/engine_ue4/deployment.html

  • Paul Ross

    Hello. Initially that link above did work but it was because I had a legacy plugin in my engine directory. Once this was deleted the deploy started to fail. It’s because the plugin is now in the game directory so this line:

    string FMODDLLPath = Path.Combine(Path.GetFullPath(BuildConfiguration.RelativeEnginePath), “Plugins/FMODStudio/Binaries/XboxOne/”);

    Needs to be:

    string FMODDLLPath = Path.Combine(Path.GetFullPath(InTarget.ProjectDirectory), “Plugins/FMODStudio/Binaries/XboxOne/”);

    This seems to work after an UnrealEngineBuildTool rebuild & UnrealFrontEnd

  • Geoff Carlton

    Hi Paul,
    Thanks for the feedback. I’ll look in this and update the docs.

  • Paul Ross

    Hello,
    That link now seems to fail when using latest FMOD & UE4.12.4. Specifically:

    Deployment on XBox One
    Add the following to StageRuntimeDependenciesFromReceipt in DeploymentContext.cs, just before the call to StageFile:

    // PLUGIN DEPLOYMENT START
    foreach (BuildProperty p in Receipt.Properties)
    {
    if (p.Name.Equals(“Platform”) && p.Value.Equals(“XboxOne”))
    {
    RuntimeDependency.StagePath = RuntimeDependency.Path.Substring(RuntimeDependency.Path.LastIndexOf(‘\\’) + 1);
    }
    }
    // PLUGIN DEPLOYMENT END

    Is now producing the following error when I try and launch:

    LogPlayLevel: DeploymentContext.cs(433,42): error CS1061: ‘TargetReceipt’ does not contain a definition for ‘Properties’ and no extension method ‘Properties’ accepting a first argument of type ‘TargetReceipt’ could be found (are you missing a using directive or an assembly reference?) [C:\src\PHX\M\Engine\Source\Programs\AutomationTool\AutomationUtils\Automa
    tionUtils.Automation.csproj]
    LogPlayLevel: DeploymentContext.cs(433,15): error CS0246: The type or namespace name ‘BuildProperty’ could not be found (are you missing a using directive or an assembly reference?) [C:\src\PHX\M\Engine\Source\Programs\AutomationTool\AutomationUtils\AutomationUtils.Automation.csproj]
    LogPlayLevel: DeploymentContext.cs(437,26): error CS1061: ‘RuntimeDependency’ does not contain a definition for ‘StagePath’ and no extension method ‘StagePath’ accepting a first argument of type ‘RuntimeDependency’ could be found (are you missing a using directive or an assembly reference?) [C:\src\PHX\M\Engine\Source\Programs\AutomationTool\AutomationUtils\
    AutomationUtils.Automation.csproj]

    Wondering what the work flow is for deploying FMOD on UE4.12.4 now days? Thanks.

  • Geoff Carlton

    I’m looking at this now and I’ll update the answer with the new method.

  • You must to post comments
0
0

Unreal 4.12 still requires a workaround. The updated one is here, which should work regardless of whether FMODStudio is in the game or the engine plugins directory. I’ll update the official docs for next release, as well as pinging Epic for a better ETA on real support.

Add the following to GetFilesToDeployOrStage in XboxOnePlatform.Automation.cs, before the end of the function:

        // FMOD code start
        string FMODDLLPath = null;
        if (Directory.Exists(Path.Combine(SC.ProjectRoot, "Plugins/FMODStudio")))
        {
            FMODDLLPath = Path.Combine(SC.ProjectRoot, "Plugins/FMODStudio/Binaries/XBoxOne/");
        }
        else if (Directory.Exists(Path.Combine(SC.LocalRoot, "Engine/Plugins/FMODStudio")))
        {
            FMODDLLPath = Path.Combine(SC.LocalRoot, "Engine/Plugins/FMODStudio/Binaries/XBoxOne/");
        }
        else 
        {
            LogError("Failed to find FMODStudio plugin in game or engine directory");
        }
        if (FMODDLLPath != null)
        {
            Log("Copying FMOD dlls to loose directory: " + RelativeBinPath);
            SC.StageFiles(StagedFileType.NonUFS, FMODDLLPath, "fmod.dll", false, null, RelativeBinPath, false, false);
            SC.StageFiles(StagedFileType.NonUFS, FMODDLLPath, "fmodL.dll", false, null, RelativeBinPath, false, false);
            SC.StageFiles(StagedFileType.NonUFS, FMODDLLPath, "fmodstudio.dll", false, null, RelativeBinPath, false, false);
            SC.StageFiles(StagedFileType.NonUFS, FMODDLLPath, "fmodstudioL.dll", false, null, RelativeBinPath, false, false);
        }
        // FMOD code end

Add the following to PrepTargetForDeployment in XboxOneDeploy.cs, before the end of the function:

        // FMOD code start
        string FMODDLLPath = null;
        if (Directory.Exists(Path.Combine(InTarget.ProjectDirectory.FullName, "Plugins/FMODStudio")))
        {
            FMODDLLPath = Path.Combine(InTarget.ProjectDirectory.FullName, "Plugins/FMODStudio/Binaries/XBoxOne/");
        }
        else if (Directory.Exists(Path.Combine(BuildConfiguration.RelativeEnginePath, "Plugins/FMODStudio")))
        {
            FMODDLLPath = Path.Combine(BuildConfiguration.RelativeEnginePath, "Plugins/FMODStudio/Binaries/XBoxOne/");
        }
        else 
        {
            Log.TraceWarning("Failed to find FMODStudio plugin in game or engine directory");
        }
        if (FMODDLLPath != null)
        {
            Log.TraceInformation("...copying the FMOD dlls...");
            string FMODDLLName = "fmod.dll";
            Log.TraceInformation("\tcopying " + FMODDLLPath + FMODDLLName + " to " + DestDir + "/" + FMODDLLName);
            CopyFile(FMODDLLPath + FMODDLLName, DestDir + "/" + FMODDLLName, true);
            FMODDLLName = "fmodL.dll";
            Log.TraceInformation("\tcopying " + FMODDLLPath + FMODDLLName + " to " + DestDir + "/" + FMODDLLName);
            CopyFile(FMODDLLPath + FMODDLLName, DestDir + "/" + FMODDLLName, true);
            FMODDLLName = "fmodstudio.dll";
            Log.TraceInformation("\tcopying " + FMODDLLPath + FMODDLLName + " to " + DestDir + "/" + FMODDLLName);
            CopyFile(FMODDLLPath + FMODDLLName, DestDir + "/" + FMODDLLName, true);
            FMODDLLName = "fmodstudioL.dll";
            Log.TraceInformation("\tcopying " + FMODDLLPath + FMODDLLName + " to " + DestDir + "/" + FMODDLLName);
            CopyFile(FMODDLLPath + FMODDLLName, DestDir + "/" + FMODDLLName, true);
        }
        // FMOD code end
  • Tobias Graff

    Hi,

    we tried to follow you documentation but somehow it seems we have an old version or the docu is not up to date. When I add the code part from the post above to the PrepTargetForDeployment function in XboxOneDeploy.cs the variable DestDir is never set. I am using 4.14.3 and the error is correct. The variable DestDir is set during this function but inside a for loop. When I follow the instruction the code part I paste into the file is outside this for loop so the variable is never set.
    Would be great to know to which dir the files need to be copied.
    Cheers

  • Cameron Baron

    As of 4.14 these modifications are no longer needed to deploy to Xbox One.

  • Tobias Graff

    Thanks for the answer. I tried it without the modifications and then get the following error:
    fmodL_vc.lib(fmodL.dll) : error LNK2001: Nicht aufgelöstes externes Symbol “__delayLoadHelper2”.
    Would be great if you could update the documentation which modifications are needed and which not.

  • Cameron Baron

    Sorry Tobias, to clarify:
    If you are using an older version of our UE4 Integration (<1.08.15) it is safe to update to 1.08.16. This is also needed for the changes Epic put in place with Xbox One.

    With that and Unreal Engine 4.14 or later, these modifications should no longer be required.

  • Tobias Graff

    Hi Cameron,
    thanks for the answer and now I deploy everything to Xbox but the game crashes with this error:
    0128:012c @ 00007500 – LdrpFindOrMapDependency – ERROR: Loading DLL fmodL.dll failed with status 0xc0000135
    0128:012c @ 00007500 – LdrpInitializeProcess – ERROR: Walking the import tables of the executable and its static imports failed with status 0xc0000135

    Am I still missing some dlls?
    I found this entry in a thread, but you mentioned there is no need for further editing source files manually?
    https://www.fmod.org/questions/question/cooking-xbox-with-ue-4-9-2/

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.