What’s happening here is actually fairly complex, so this answer might end up being a little long.
- Is it clear what happened here? I.e. the missing duplicate instances of the same source file, and why Studio created copies of a bunch of wav files instead of just pointing the project to the source path?
You have discovered a previously-unknown bug. The bug’s direct consequences are fairly simple, but they can cause additional knock-on effects under some circumstances.
I’m getting a bunch “Missing File” instances in the Asset browser, and I’m generally confused by how Studio handles source assets. The file structure I’m working with is:
Source folder (wav files): C:\Audio\SFX
Project A folder: C:\Audio\ProjectA\ProjectA.fspro
Project B folder: C:\Audio\ProjectB\ProjectB.fspro
My workflow is: I’m dragging and dropping wav files from my SFX folder into events (as I create them). At one point I copied a whole folder of events from Project A to Project B, and it mostly worked fine, but then I noticed that any wav files that were used more than once were listed as missing. More specifically, the first instance was present in the event that used it, but any instances after that were missing.
I also noticed that a wav file had been copied and renamed from soundA.wav to soundA (2).wav at some point, and Studio was using that copy.
This is the bug: When you copy and paste an event that uses the same asset twice from one project to another project that shares the same external audio folder, a copy of the asset is created with a slightly different name and the original asset is deleted. This results in one of the instruments in the pasted event using the new copy of the asset and the other using the old deleted (and therefore missing) asset. I’ve added this issue to our bug tracker, and it will be fixed in an upcoming release of FMOD Studio.
For now, you should be able to work around this issue when it occurs by “consolidating” the missing assets with their non-missing versions: In the Assets browser, multi-select the missing and non-missing version of an asset, then right-click on the non-missing version and select “Consolidate…” from the context menu. You will have to do this in both projects.
I tried changing the Asset folder location in case that was the problem, but that didn’t solve it, so i just copied the instance of each wav that Studio could locate and pasted it into the events that couldn’t find the wav.
Then I noticed that every wav file from the events that I copied over were now present in the root directory (C:\Audio), and if I deleted those wav files it caused both Project A and B to no longer be able to locate the source assets for those events. I.e. at some point Studio stopped using the original path of the wav assets.
This behavior isn’t a bug in itself, but a consequence of the way you added new versions of the missing files to your project.
As I mentioned above, the bug you’ve discovered deletes affected audio files from your assets folder. When you paste an audio file into your project and the file isn’t already present in your assets folder, FMOD Studio automatically copies the file into your assets folder - and, since the files you were pasting had been deleted, they definitely weren’t present. FMOD Studio detected that they weren’t present, and did what it’s designed to do: Created copies of the pasted files in your assets folder, also known as “
..”, also known as “C:\Audio”.
You only re-imported the files because they went missing due to the bug, so fixing the bug will prevent it from happening again. In the mean time, you should be able to avoid this issue by not dragging “missing” audio files directly onto events; instead, paste the missing files into the assets folder sub-directories they’re supposed to be in via Explorer, or drag the files from an Explorer window onto the folders they’re supposed to be in in the assets browser and choose “Replace” when prompted.
- Is this all related to the copy and pasting of events from one project to another?
Yes, though copying and pasting events from one project to another is usually safe, as it’s something we explicitly support. As far as I can tell, this particular bug only occurs when pasting an event that contains two references to the same asset file from one project to another when both projects share the same audio source directory.
You should be able to avoid this issue in future by giving each FMOD Studio project its own assets folder. We usually recommend doing this, partly because it reduces clutter and overhead and makes projects easier to manage, and partly because it allows you to rename and edit audio files used by one project without breaking other projects you might have. This bug you have discovered is another good reason.
- Is there some tool to help Studio find the missing files? E.g have it scan the “Asset folder”. I’d rather not have it bloat the directory by making unnecessary copies of assets that are present in the “Asset folder”. I also don’t understand how both ProjectA and B had the path of these wav files changed to the root folder.
Yes and no.
There is no way to scan a project for assets with identical filenames but different paths and consolidate them automatically, and there is definitely no way to scan for and automatically consolidate audio files with different filenames and paths, as is the case here.
However, the “Consolidate…” feature that I mentioned above allows you to replace a selection of assets with just one of those assets, and automatically updates all references to the replaced assets in the process. It’s primarily used for replacing redundant assets in large projects or outdated assets that have been replaced with new versions, but it’s also useful in this situation. Just make sure that the asset you right-click on to open the context menu is the non-missing asset, as that’s the asset that will replace the others.
As I mentioned above, the reason why the files paths were changed to the root folder is because you re-imported the files by adding the assets to events when they were missing. If you instead consolidate the missing files with their non-missing versions, copy the missing files into the locations they’re supposed to be in on your hard drive, or import the files into the correct folders in the assets browser, the paths will not be changed.
Having Studio create copies of assets and using those instead of the ones I originally dragged into the project is a bit worrisome to me. E.g. I might think I’m editing the source file and not realize that Studio is using a copy it created. Is there a setting to have things behave more akin to how things worked in Designer?
No, and we’re not going to add one. The behavior you have observed is the result of a bug, and we will fix the bug, but we have no plans to allow users to reference audio assets in more than one external directory.
The way FMOD Designer handled assets made FMOD Designer projects extremely fragile. A Designer project could make use of audio files scattered anywhere in a user’s directory structure. Moving any of those audio assets (or the project itself) would break the project in a way that wouldn’t be obvious until the project was opened and that particular asset was tested. This made Designer projects effectively non-portable, made archiving old projects so error-prone that it was almost impossible, and pointlessly punished anyone who reorganized their files, folders, drives, or network for any reason.
A user could potentially avoid all these issues by carefully copying all the audio files needed by a project into a single directory, and treating this asset directory and the project it was associated with as a single unit. When we made FMOD Studio, we therefore made this best practice the default. We still allow the assets folder to be an external to the project, as there are often good reasons to do that, but we have no interest in allowing a single project to make use of multiple external asset folders.
Any time I type
../ into the field, Studio auto-changes it to
.. . Maybe this is related to these issues I’m encountering?
The presence or absence of a terminating slash or backslash in your assets folder path has no effect on the folder targeted by that path; as far as FMOD Studio is concerned, there is no difference between “
../” and “
..”, nor between “C:\myFolder/” and “C:\myFolder”. There are rare applications that require a terminating slash in a path because of the way they concatenate paths and filenames, but FMOD Studio is not one of them.