• RuntimesUnity
  • Slow processing when switching platforms on Unity

Hi, we've been working with SPINE for the last 5 years now and it's been wonderful. Our game, Shujinkou, is finally releasing next month and we're gearing up to fix a bunch of remaining bugs and apply polish as the release date inches closer.

With lots of small issues across different platforms coming up, we've found the need to swap platforms (PS4 to PS5, PC to PS4, PC to NX, etc), and every time we switch platform, the 1,000+ SPINE projects we have in the game (not .spine, but the resulting .png/.json/.asset etc files) seemingly get reimported. This has been present ever since we became able to swap platforms in order to port the game (over 2 years ago), and it wasn't a big deal back then (we could wait), but with urgent bugs and the need to quickly implement fixes and test at a fast pace, we're being slowed down by the reimports taking up 20-30 minutes each time we switch platform.

Is there a reason for this happening and is there a way to stop it from reimporting every time a platform is switched? No files / project files actually get modified in terms of Git differences FYI.

Version: SPINE 4.1
Unity: 2021.3.41f1

Warm regards,
Julian

Related Discussions
...

Hi Julian,

The issue you're experiencing with reimporting Spine assets when switching platforms in Unity is likely related to how Unity handles asset imports and platform-specific settings. When you switch platforms, Unity may reimport assets to ensure they are compatible with the target platform's requirements, such as texture compression formats or shader settings. This process can be time-consuming, especially with a large number of assets.

To mitigate this, you can try the following approaches:

  1. Cache Server: Use Unity's Cache Server to speed up the import process. The Cache Server stores imported asset data, which can significantly reduce import times when switching platforms.

  2. Asset Bundles: Consider using Asset Bundles to manage platform-specific assets. This can help reduce the need for reimporting by separating platform-specific data from the main project.

  3. Check Import Settings: Ensure that your import settings are optimized for all target platforms. Sometimes, unnecessary reimports can occur due to mismatched settings.

  4. Unity Version: Make sure you are using the latest stable version of Unity, as performance improvements and bug fixes are regularly included in updates.

Unfortunately, there is no direct way to completely stop Unity from reimporting assets when switching platforms, as this is part of its asset management system. However, the above strategies can help reduce the time it takes.

Is this the accepted answer? Just want to make sure unless a developer has advice or thoughts.
Thanks,
Julian

    JulianRice Unfortunately, our Unity expert, Harald, is currently on an extended leave of absence, and he may be able to give some additional advice when he returns, but with the members we have now, it would be difficult to give more advice than Spinebot has already answered. (He is actually scheduled to return next month, so we may not be able to advise you in time for your project).

      5 jours plus tard

      Misaki Thanks for letting us know! We'll see if we can figure something out in the meantime.

      13 jours plus tard

      @JulianRice Sorry for the delay. This has been a long standing issue with Unity.
      Solutions seem to be using Accelerator or Cache Server, depending on your Unity (asset pipeline) version:
      https://docs.unity3d.com/Manual/UnityAccelerator.html
      https://docs.unity3d.com/2022.1/Documentation/Manual/CacheServer.html

      It's somewhat puzzling that they have never provided a simple Editor Preferences setting like "use separate directories" to write to a separate Library directory for each platform. This is something which many users have been using in the past, effectively switching platforms via a scripts that changes the active platform in a text file and sets the symlink from Library to the respective Library_platform directory.

        Harald Thank you for the answer and clarification (and welcome back)!! I will take a closer look at these two potential solutions in the coming weeks 🙂