Hi! I’m using
Unity 6000.0.24f1
Fmod to Unity 2.03.06
When integrating in a clean Unity project, I may have encountered a course of action which leads to a state where the configuration is faulty, and cannot be corrected (easily?). Either my assumptions are wrong, or I may have discovered an issue.
Context
I presume the intended usage for configuring a Single Platform Build,
is pointing the ‘Build Path’ to the ‘platform specific build sub-folder’ (e.g. “Desktop”). When doing so in the intial setup Wizard, everything performs as expected.
However, selecting the ‘root build folder’ creates a state where the banks are no longer loaded when the path is correctly reconfigured later in the ‘FMOD Settings’.
Detail
When selecting the ‘root’ directory in the inital setup wizard (which I presume is unintended usage), banks still get correctly loaded in editor play mode. A user could suspect nothing is incorrectly setup at this point. Until they inspect the ‘FMOD Settings’ window. It warns the user that the path is setup incorrectly.
Trying to correct that path to the ‘platform specific build sub-folder’ (e.g. “Desktop”), does indeed display the full settings window, confirming to the user that the path is now correct! However, at this point the banks no longer load, giving an error like so:
[...] Could not load bank
'Fmod_Build/Desktop/Desktop/Master.strings.bank' [...]
- Note the duplicate ‘platform’ in this path.
I would also like to point out the documentation does not mention the ‘Single Platform Build’ expects the ‘platform specific build sub-folder’. This is implied by the FMOD Settings inspector window, but since the banks do get loaded when configuring the ‘root’ directory, this becomes confusing quickly.
I will now document the steps I took to compare selecting both the “Platform specific path” vs the “Root path” when first configuring the integration; hopefully showing that the user can end up in a configuration which looks identical, but behaves different:
Reproduction Working Case:
(Optional, since i presume this is the intended usage)
- 1
[...]\IssueRepro\UnityProject\
Create a Unity Project - 2
[...]\IssueRepro\FmodProject\
Create a Fmod Project - 3 Create a ‘Test’ event, assign to the “Master” bank
- 4
[...]\IssueRepro\UnityProject\FmodBuild\
Configure Fmod to Build to this path - 5 Drop the integration package ‘fmodstudio20306.unitypackage’ on Unity, click ‘Import’
- 6 (The setup window pops open), click ‘Start’
- 7 (Updating), click ‘Next’
- 8 (Linking), click ‘Single Platform Build’
- 9 In the ‘Locate Build Folder’ dialog:
select [...]\IssueRepro\UnityProject\FmodBuild\Desktop
, the specific platform folder
- 10 continue the integration (replace camera, disable unity audio), click ‘Close’
- 11 In the SampleScene
- Add a new GameObject
- Add the FMODStudioEvent component, set to trigger on ‘Object Start’
- Assign the ‘Test’ event to it
- Save the scene
- Press the Unity ‘Play’ button to enter play mode
- 12 Observe the sound plays correctly
- 13 Open Fmod > Fmod Settings
- 14 Observe the ‘FMOD Settings Window’ correctly displays settings
- 15 Observe Building this project will result in a working build with audio
Reproduction Faulty Case:
- In a different root folder, repeat steps 1 through 8, creating brand new projects
- 9 pick a different folder in the ‘Locate Build Folder’ dialog:
select [...]\IssueRepro\UnityProject\FmodBuild\
, the build root
- 10 Observe the Wizard indicates ‘green’, signaling this is a valid folder
- 11 continue the integration (replace camera, disable unity audio), click ‘Close’
- 12 In the SampleScene, setup the FMODStudioEvent, as in step 11 of ‘Working Case’
- Press the Unity ‘Play’ button to enter play mode
- 13 Observe the sound plays correctly (which is interesting, since we’ve configured the wrong Build Folder path)
- 14 Open Fmod > Fmod Settings
- 15 Observe the ‘FMOD Settings Window’ warns the user ‘Build path does not contain any built banks’.
- 16 click Browse, in the ‘Locate Build Folder’ dialog:
select [...]\IssueRepro\UnityProject\FmodBuild\Desktop
, the specific platform folder
- 17 Observe the ‘FMOD Settings Window’ now correctly displays settings
At this point, the initial ‘wrong folder selection (root)’, is now rectified for the correct one (platform specific). To the user, both the ‘Working Case’ and ‘Faulty Case’ projects are now set up in an identical way.
- 18 Press the Unity ‘Play’ button to enter play mode
- 19 Observe errors failing to load the bank, since the expected path contains duplicate ‘platfrom’ folders:
[FMOD] RuntimeBankModel::openFile : Failed to open file 'FmodBuild/Desktop/Desktop/Master.strings.bank'
- 20 Observe Building this project fails for a similar reason, though reverting the Bank Import path back to the ‘errorous’ Fmod Bank ‘root’ directory does provide a build, with working audio.
Conclusion
Apologies for the long writeup, but I could not conceive of another way to communicate this clearly. I’m still not sure if I’m making a wrong assumption, or reporting a bug at this point, since the limited information on intended usage makes this integration quite confusing to setup.
This post is the only specific reference to this issue I can find.
If this is indeed a bug, the integration experience will be way more transparent when this case is resolved.
Greetings to the team!
I hope someone can provide some clarity on this.
Dries
(edit: typos)