Search Unity

3D Model Animations. Does lower framerate = better performace?

Discussion in 'Getting Started' started by Sparticus, Mar 29, 2021.

  1. Sparticus

    Sparticus

    Joined:
    Mar 15, 2014
    Posts:
    149
    I purchased a 3D model of an enemy character from the asset store that has a nice looking animation. I am making a tower defense game so there could be 80 or so instances of that enemy on the screen at any given time

    This is a mobile game so performance is important to me. I assume that enemies animation by default run at the games framerate (60 fps). Which of the following statements are true?

    1.) Changing the framerate of the animation to 4 FPS would make the game much more performant.

    2.) Changing the framerate of the animation to 4 FPS would make a small increase in performance... but the performance gain you get is so small it's is not worth losing animation quality.

    3.) Unity has to render the enemy every frame anyways so setting the enemy FPS to 4 makes zero difference in performance.


    Thanks for any advice you can give!

    Ryan
     
  2. RichAllen2023

    RichAllen2023

    Joined:
    Jul 19, 2016
    Posts:
    1,026
    Depends how souped up your PC that you're using to make the game is, if it's a Ninja PC, it'll run stuff better.
     
    Last edited: Mar 30, 2021
  3. Sparticus

    Sparticus

    Joined:
    Mar 15, 2014
    Posts:
    149
    Yes, I understand things run better on better hardware..... that wasn't what I was asking.... :)
     
  4. aer0ace

    aer0ace

    Joined:
    May 11, 2012
    Posts:
    1,513
    It's none of those options, but number 3 is the closest. Unity will render every frame, but if the animation is animated at 4 FPS, you can take steps to prevent the animation system from calculating in those "inbetween" frames. Again, rendering will always happen. But you CAN optimize how animation is processed. First, fewer frames means less memory to be stored for the animation. So, there will be a number of render frames that will render the same animation state. You can check if the state has changed, and if not, don't recalculate the animation for that render frame.

    EDIT:
    In most games with rigged and skinned characters, the reason there is a major chug when lots of characters appear on the screen is typically due to all those bone transformations getting calculated for the animation. Other techniques you can use to mitigate these issues is to reduce the number of bones as much as possible, and reduce the number of animation keyframes on those bones for each animation.
     
  5. BrandyStarbrite

    BrandyStarbrite

    Joined:
    Aug 4, 2013
    Posts:
    2,076