Forum rules - please read before posting.

AC trying to load editor-specific FMOD classes resulting in build errors

AC version 1.63.2
Unity 2018.1.5f1
FMOD 2.00.01

We're using FMOD to handle sound and we've been running into this error running a Win64 build in development mode when changing to a new scene:

I was working with the FMOD folks to try to troubleshoot the issue and they pointed me back here noting that AC was referencing FMOD editor-specific resources in the build. You can read the relevant troubleshooting info over on their forums: https://qa.fmod.com/t/error-with-win64-build-a-script-behaviour-probably-fmodunity-editorparamref-has-a-different-serialization-layout-when-loading/14753

Is there anything we can check that may shed light onto this issue, or anything we can adjust so AC doesn't try to load the Editor files? We aren't easily able to update at this point since we've made some additions to the AC code and we're trying to remain version locked. Thanks for the help!

Let me know if there's anything else I can provide that may be helpful.

Here's some of the errors from the output log (they repeat over and over after this):

The referenced script (Unknown) on this Behaviour is missing!
UnityEngine.Resources:LoadAll(String, Type)
AC.LevelStorage:UnloadTransformData(List`1, SubScene) (at D:\Repos\SpiritOfMidnight\Assets\AdventureCreator\Scripts\Save system\LevelStorage.cs:382)
AC.LevelStorage:SendDataToScene(SingleLevelData, Boolean, SubScene) (at D:\Repos\SpiritOfMidnight\Assets\AdventureCreator\Scripts\Save system\LevelStorage.cs:119)
AC.LevelStorage:ReturnCurrentLevelData(Boolean) (at D:\Repos\SpiritOfMidnight\Assets\AdventureCreator\Scripts\Save system\LevelStorage.cs:77)
AC.SceneSettings:OnStart() (at D:\Repos\SpiritOfMidnight\Assets\AdventureCreator\Scripts\Game engine\SceneSettings.cs:129)
AC.MultiSceneChecker:Start() (at D:\Repos\SpiritOfMidnight\Assets\AdventureCreator\Scripts\Game engine\MultiSceneChecker.cs:72)

[C:\buildslave\unity\build\Runtime/Mono/MonoBehaviour.cpp line 1576] 
(Filename: D:/Repos/SpiritOfMidnight/Assets/AdventureCreator/Scripts/Save system/LevelStorage.cs Line: 382)

The referenced script on this Behaviour (Game Object '<null>') is missing!
UnityEngine.Resources:LoadAll(String, Type)
AC.LevelStorage:UnloadTransformData(List`1, SubScene) (at D:\Repos\SpiritOfMidnight\Assets\AdventureCreator\Scripts\Save system\LevelStorage.cs:382)
AC.LevelStorage:SendDataToScene(SingleLevelData, Boolean, SubScene) (at D:\Repos\SpiritOfMidnight\Assets\AdventureCreator\Scripts\Save system\LevelStorage.cs:119)
AC.LevelStorage:ReturnCurrentLevelData(Boolean) (at D:\Repos\SpiritOfMidnight\Assets\AdventureCreator\Scripts\Save system\LevelStorage.cs:77)
AC.SceneSettings:OnStart() (at D:\Repos\SpiritOfMidnight\Assets\AdventureCreator\Scripts\Game engine\SceneSettings.cs:129)
AC.MultiSceneChecker:Start() (at D:\Repos\SpiritOfMidnight\Assets\AdventureCreator\Scripts\Game engine\MultiSceneChecker.cs:72)

[C:\buildslave\unity\build\Runtime/Mono/MonoBehaviour.cpp line 1789] 
(Filename: D:/Repos/SpiritOfMidnight/Assets/AdventureCreator/Scripts/Save system/LevelStorage.cs Line: 382)

A script behaviour (script unknown or not yet loaded) has a different serialization layout when loading. (Read 48 bytes but expected 896 bytes)
Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?
UnityEngine.Resources:LoadAll(String, Type)
AC.LevelStorage:UnloadTransformData(List`1, SubScene) (at D:\Repos\SpiritOfMidnight\Assets\AdventureCreator\Scripts\Save system\LevelStorage.cs:382)
AC.LevelStorage:SendDataToScene(SingleLevelData, Boolean, SubScene) (at D:\Repos\SpiritOfMidnight\Assets\AdventureCreator\Scripts\Save system\LevelStorage.cs:119)
AC.LevelStorage:ReturnCurrentLevelData(Boolean) (at D:\Repos\SpiritOfMidnight\Assets\AdventureCreator\Scripts\Save system\LevelStorage.cs:77)
AC.SceneSettings:OnStart() (at D:\Repos\SpiritOfMidnight\Assets\AdventureCreator\Scripts\Game engine\SceneSettings.cs:129)
AC.MultiSceneChecker:Start() (at D:\Repos\SpiritOfMidnight\Assets\AdventureCreator\Scripts\Game engine\MultiSceneChecker.cs:72)

[C:\buildslave\unity\build\Runtime/Serialize/SerializedFile.cpp line 1967] 
(Filename: D:/Repos/SpiritOfMidnight/Assets/AdventureCreator/Scripts/Save system/LevelStorage.cs Line: 382)

The referenced script (FMODUnity.EditorBankRef) on this Behaviour is missing!
UnityEngine.Resources:LoadAll(String, Type)
AC.LevelStorage:UnloadTransformData(List`1, SubScene) (at D:\Repos\SpiritOfMidnight\Assets\AdventureCreator\Scripts\Save system\LevelStorage.cs:382)
AC.LevelStorage:SendDataToScene(SingleLevelData, Boolean, SubScene) (at D:\Repos\SpiritOfMidnight\Assets\AdventureCreator\Scripts\Save system\LevelStorage.cs:119)
AC.LevelStorage:ReturnCurrentLevelData(Boolean) (at D:\Repos\SpiritOfMidnight\Assets\AdventureCreator\Scripts\Save system\LevelStorage.cs:77)
AC.SceneSettings:OnStart() (at D:\Repos\SpiritOfMidnight\Assets\AdventureCreator\Scripts\Game engine\SceneSettings.cs:129)
AC.MultiSceneChecker:Start() (at D:\Repos\SpiritOfMidnight\Assets\AdventureCreator\Scripts\Game engine\MultiSceneChecker.cs:72)

Comments

  • Welcome to the community, @Zeke.

    As the thread you point to mentions, AC is invoking Resources.LoadAll as part of its scene loading operation. This isn't run in the very first scene, which is why you're only experiencing it when switching to a new one.

    I'm not clued up on FMOD itself and the way its Editor files are structured, but unless you can move those files out of Resources, then you can rely on AC's SaveableData folder structure.

    See the Manual's "Performance and optimisation" chapter. When loading data, AC will search your Resources folder for saved assets (in this specific error, it's looking for prefabs, but I suspect you'd have the same issue with all asset types).

    For performance, you can optionally place such assets inside subfolders named e.g. SaveableData/Audio (for audio), SaveableData/Prefabs (for prefabs), etc. This instructs AC that all relevant asset files are only within those subfolders, and to avoid searching the entire Resources folder.

    Try recreating this folder structure inside your Resources directory. You'll need at least dummy asset inside each (e.g. a single prefab inside the Prefabs folder, or AudioClip inside Audio) for it to work. Doing so, however, should prevent AC reading the FMOD Editor file that's causing issue.

  • Wow, thanks for the fast and detailed answer, @ChrisIceBox.

    Creating a SaveableData/Prefabs folder with a placeholder looks to have resolved the errors we were seeing.

    I'm still a bit puzzled as to how this was causing an issue as the entire FMOD plugin lives in the Plugins folder. Maybe it could be due to the fact that there's a \Assets\Plugins\FMOD\Resources folder inside the directory that Resources.LoadAll() is picking up on?

    At least that's my guess after checking out the documentation.

    https://docs.unity3d.com/ScriptReference/Resources.LoadAll.html

    The path is relative to any Resources folder inside the Assets folder of your project.

    Anyway, thanks again for your help. :smile:

  • Likely so - a Unity project can have multiple Resources folders, and Resources.LoadAll will search all of them.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.
Do NOT follow this link or you will be banned from the site!