• RuntimesUnity
  • How do animation elements affect game performance/fps?

How do animation elements affect game performance/fps?

Hello!
There is an animation that is exported to Unity/JSON.

And we only use:

  • play animation
  • change skins
  • enable and disable slots
    We don't work with anything else in Unity code.

Will it have an impact on FPS performance:
1) the number of frames per second is 30 by default, but we use 60 - does this add additional load?
2) the number of bones in the skeleton?
3) number of meshes, vertices?

Let me clarify once again that the code makes no calls to either bones or meshes.

Thanks in advance for your answer.

    Related Discussions
    ...

    Hello!

    The performance of your game can be influenced by several factors related to animation elements. Here are the key points based on your questions:

    1. Frames Per Second (FPS):

      • 30 FPS vs. 60 FPS: Increasing the FPS from 30 to 60 does not inherently add additional load in terms of the animation data itself, as Spine animations are interpolated and effectively run at an infinite FPS. However, rendering at a higher FPS means the game engine has to process and render frames more frequently, which can increase the overall load on the CPU and GPU. This can impact performance if the hardware is not capable of handling the higher frame rate efficiently.
    2. Number of Bones:

      • The number of bones in a skeleton can significantly impact performance. Each bone requires transformation calculations, and more bones mean more calculations per frame. For example, if you have a high number of bones, it can add up to a substantial computational load, as seen in the example where 7362 bones were calculated (378 soldiers * 19 bones + 90 buildings * 2 bones).
    3. Number of Meshes and Vertices:

      • The number of meshes and vertices also affects performance. More vertices mean more data to process and render, which can increase the load on the CPU and GPU. Additionally, if you have multiple meshes, it can lead to more draw calls, which can further impact performance. Optimizing the number of vertices and ensuring efficient use of meshes can help mitigate this impact.

    Given that your code does not make calls to bones or meshes directly, the primary factors affecting performance will be the complexity of the skeletons (number of bones) and the rendering load (number of meshes and vertices). It is also important to consider the overall draw calls and batching, as these can influence performance.

    For more detailed insights, you can refer to the spine-unity FAQ on performance and the Spine Metrics guide.

    James1990 1) the number of frames per second is 30 by default, but we use 60 - does this add additional load?

    What exactly do you mean by that? Which parameter did you modify?
    Changing timeline fps alone does not really have any impact on performance. What does increase the CPU load is if you increase the FPS parameter of a Physics Constraint.