Hi, there’s currently an issue with using Multiplayer Play Mode (MPPM) and FMOD in Unity.
When the sourceBankPath exists outside the Assets folder, FMOD is unable to refresh the banks on virtual players.
Forum thread here: Multiplayer Play Mode FMOD audio - #4 by EdEddnEddy - Multiplayer & Networking - Unity Discussions
Would be great if this could be added into FMOD without needing to modify the source code.
Or perhaps dispatch a callback that allows us to modify the source bank path in editor at runtime.
My current solution is to modify the SourceBankPath property like so:
public string SourceBankPath
{
get
{
#if UNITY_EDITOR
// Support MPPM
if (!Unity.Multiplayer.PlayMode.CurrentPlayer.IsMainEditor)
{
if (string.IsNullOrEmpty(virtualClientBankPath))
{
string clientPath = Application.dataPath.Replace('\\', '/');
int libIndex = clientPath.IndexOf("/Library/", StringComparison.OrdinalIgnoreCase);
string rootPath = clientPath.Substring(0, libIndex);
virtualClientBankPath = Path.Combine(rootPath, sourceBankPath).Replace('\\', '/');
}
return virtualClientBankPath;
}
return sourceBankPath;
#else
return sourceBankPath;
#endif
}
set
{
sourceBankPath = value;
}
}
Hi,
Thanks for bringing this to our attention. Testing the Multiplayer FPS template, I was not able to reproduce the issue. Could I get some reproduction steps? Could I also grab the integration version you are using?
We’re using FMOD 2.03.14, build: 167255. Unity 6000.6.0f1
reproduction steps:
- Create a “FMODAssets” folder in the root project folder, e.g:
- Assets
- Library
- ProjectSettings
- FMODAssets
- Export banks into that folder from FMODStudio
- In FMOD unity settings, set the bank path to that folder
Install the package: “com.unity.multiplayer.playmode”: “3.0.0”
Click the play mode scenario dropdown from the toolbar:
Create a new Scenario “Host and Client” and configure like so:
Switch the scenario to “Host and Client” and hit Play
On the virtual client, you will see FMOD unable to load the banks:
VirtualPlayers in Unity exist within the root Library folder, for example:
{ProjectFolder}/Library/VP/mppmdb0322ed
And Unity creates these as essentially a few Symlinked directories:
But FMODAssets is located at:
{ProjectFolder}/FMODAssets
And since “sourceBankPath” is a relative path from the root. Virtual clients can’t resolve the banks.
On VirtualClients, Application.dataPath = {ProjectPath}/Library/VP/{virtualClientId}/Assets
Thank you for the reproduction steps. I have been able to reproduce the issue and your workaround does solve it. I will pass on the information to our development team to investigate further.