Skip to content

[BUG] Dance Mods fail to load when switching between two custom dances in the same session (AssetBundle "dance.bundle" name collision) #588

Description

@Haphior

What happened?

When loading a custom Dance Mod (.me) exported with the official MateSDK exporter, the first dance loads and plays correctly. However, switching to a different custom dance mod afterward (without restarting the app) silently fails — the animation and audio never start, with no visible error in the UI.

The Player.log shows the real cause:

The AssetBundle 'MateEngineX\ME_Cache<ModName>\dance.bundle' can't be loaded because another AssetBundle with the same files is already loaded.

Root cause: every dance mod built with the SDK exporter packages its clip/audio under the same internal Unity AssetBundle name, "dance.bundle" (hardcoded in the exporter). In AvatarDancePlayer.cs, SmoothPlayFlow() calls AssetBundle.LoadFromFile() for the newly selected dance BEFORE unloading the previously loaded entry:

e.bundle = AssetBundle.LoadFromFile(bp);   // loads the new one first
...
if (prev != null && prev != e)
{
    UnloadEntry(prev);                      // unloads the old one only after
}

Since both bundles share the same internal name, Unity refuses to load the second one while the first is still resident in memory, because UnloadEntry(prev) runs too late in the sequence.

Workaround: fully closing and reopening MateEngineX resets the loaded state, so the next dance picked works — until you try switching to a second custom dance again in the same session.

Steps to Reproduce

  1. Install two different custom Dance Mods (.me) built with the MateSDK Dance Exporter (e.g. two different songs).
  2. Open MateEngineX and load the first dance mod from the dance menu — it plays correctly.
  3. Without restarting the app, select the second (different) dance mod from the menu.
  4. Observe: nothing happens — no animation, no audio starts.
  5. Check %AppData%/../LocalLow/Shinymoon/MateEngineX/Player.log — it shows:
    "The AssetBundle '...\dance.bundle' can't be loaded because another AssetBundle with the same files is already loaded."

App Version

2.1.4

Store Edition

GitHub Edition

Confirmation

  • I confirm this report includes only one bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions