Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice

How to optimize 2D animations (with bones) ?

Discussion in '2D Experimental Preview' started by AlphaDreams, Aug 12, 2019.

  1. AlphaDreams

    AlphaDreams

    Joined:
    Jan 21, 2015
    Posts:
    29
    Hi everyone !

    On our current project, we use the 2D Animation package (it's still in preview) with Unity 2019.2.0f1. We use it to animate our enemies and our characters with bones.

    But if we try to show on one scene 80+ enemies/characters, the FPS drops to something like 4 fps. When I open the Unity Profiler, the drop seems to come from
    SpriteSkin.LateUpdate()
    ...



    Is there any way to optimize our project (animations ? sprites compression ?) in order to bypass this problem ?

    Thank you !
     
    Softemail likes this.
  2. MikaMobile

    MikaMobile

    Joined:
    Jan 29, 2009
    Posts:
    844
    This is an issue introduced in 2019.2 and it’s current version of the package. The previous package under 2019.1 didn’t exhibit this. I’ve reported a bug which rustum acknowledged, hopefully it will be addressed.
     
  3. AlphaDreams

    AlphaDreams

    Joined:
    Jan 21, 2015
    Posts:
    29
    Oh, ok !
    Is there any public link for your bug report ? If there is any chance that I can follow it maybe ?
     
  4. MikaMobile

    MikaMobile

    Joined:
    Jan 29, 2009
    Posts:
    844
    I’d hope any news on this front will be in the sticky thread(s) on this forum. Development on it has been pretty glacial though, so I wouldn’t expect a fix soon.

    I’m just working on other things while this tool stabilizes, but I’ve been doing that for 8 months and am running out of other tasks to pursue. Pretty soon I fear I’ll be forced to abandon it.
     
    EvOne likes this.
  5. Leo-Yaik

    Leo-Yaik

    Unity Technologies

    Joined:
    Aug 13, 2014
    Posts:
    362
    We are currently working on the issue.
     
    Softemail and Zepa like this.
  6. AlphaDreams

    AlphaDreams

    Joined:
    Jan 21, 2015
    Posts:
    29
    Any idea on how much time it will take to get an update ? Even if it's not completely precise or accurate, just in order to give us an idea. We really don't know if we must spend time to switch to another animation system, or if we can wait for an update soon ?
     
    EvOne likes this.
  7. MikaMobile

    MikaMobile

    Joined:
    Jan 29, 2009
    Posts:
    844
    Thanks for the assurance. I hope I didn’t sound overly grouchy, I love what this tool can already do, and if it were released and supported back in 2019.1 I’d have been satisfied with the features. It is exhausting though to watch it on this rollercoaster of performance and strange interactions with other packages and moving parts between 2019.1-2019.3.
     
    AlphaDreams likes this.
  8. Leo-Yaik

    Leo-Yaik

    Unity Technologies

    Joined:
    Aug 13, 2014
    Posts:
    362
    The current plan is to have it out for both 19.2 and 19.3 in ~3 weeks time.
     
    Softemail and Zepa like this.
  9. ass3ad

    ass3ad

    Joined:
    Dec 13, 2017
    Posts:
    1
    hey is this problem fixed or still not
     
  10. Leo-Yaik

    Leo-Yaik

    Unity Technologies

    Joined:
    Aug 13, 2014
    Posts:
    362
    Yes, we have improved the performance since the last post. It will still be a continuous effort to make it better
     
  11. MichaelHarutyunian

    MichaelHarutyunian

    Joined:
    Aug 9, 2018
    Posts:
    1
    Hello I'm working in unity 2020.1 and still have problem. Thanks advance
     
  12. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    482
  13. Leo-Yaik

    Leo-Yaik

    Unity Technologies

    Joined:
    Aug 13, 2014
    Posts:
    362
    Do note that for performance, you will need the burst package and collection package installed.

    The collections package however might seems to be not discoverable at this moment, so you will need to manually add the following line in you package.json file

    Code (CSharp):
    1. "com.unity.collections": "0.9.0-preview.6"
     
  14. killmark5550

    killmark5550

    Joined:
    Aug 30, 2020
    Posts:
    3
    Do we have to tweak something else or just install the package? Thank you very much in advance!
     
  15. Leo-Yaik

    Leo-Yaik

    Unity Technologies

    Joined:
    Aug 13, 2014
    Posts:
    362
    Just by installing the package will work.
     
  16. rheirman

    rheirman

    Joined:
    Sep 30, 2019
    Posts:
    16
    I feel stupid for asking, but where to find this package.json file? Do you mean I should add that line to the package.json file found in Library\PackageCache\com.unity.2d.animation@5.0.4? Where should I include the line in that file, if that's the right file?
     
  17. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    482
    @rheirman, sorry for the confusion. It should be the manifest.json file. You can find this file at [Project Root]/Packages/manifest.json
    In this json, the line should be added in the dependencies scope.
    Let us know if you have any issues
     
  18. Leo-Yaik

    Leo-Yaik

    Unity Technologies

    Joined:
    Aug 13, 2014
    Posts:
    362
    Absolutely my bad, so sorry for the misinformation.
    Alternatively, you can add it via Package Manager as follow
    upload_2021-3-1_15-55-22.png
     
    zhuchun likes this.
  19. rheirman

    rheirman

    Joined:
    Sep 30, 2019
    Posts:
    16
    Got it. Thanks for the quick reply!
     
  20. rheirman

    rheirman

    Joined:
    Sep 30, 2019
    Posts:
    16
    I must say, I'm impressed with the performance increase with both packages installed. It was pretty worrying to see the animations take up to 10ms per frame before with a bunch of animated characters walking around. Lucklily, that's almost completely gone now.

    It would be great if this performance increase can be made available for the broader audience, and not just the ones that manage to find this thread.
     
  21. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    482
    I'm happy to hear that you see such good improvements by installing the additional packages.

    Apart from this thread, we have also published this information in YouTube videos, blog posts and on the front page of the package documentation. But it is always good to know that we should keep informing devs about these packages. In a future release we are also aiming to make these additional packages dependencies of the 2D Animation package, which will allow everyone to get the performance improvements by default.

    Thanks again for the feedback, and do let us know if you have any other feedback or suggestions on how we can make the animation experience better in Unity.
     
unityunity