Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Skip Frames like Optimization in - PUBG Mobile

Discussion in 'Animation' started by fdsagizi2, Apr 16, 2018.

  1. fdsagizi2

    fdsagizi2

    Joined:
    Nov 4, 2013
    Posts:
    70
    Hi Unity team!
    If you play pubg mobile, you will see, what animation on characters skip some frames

    if player move far, it skip more frames, and - on moble its look good!

    how i can skip updates meshes in animator?

    if i disable Animator - it reset state, but i only want skip some update frames
     
    Last edited: Apr 16, 2018
  2. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Do you have a video example? This sounds like a bug in the game/network latency.
     
  3. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    No it's animation LOD, many game do it
     
  4. fdsagizi2

    fdsagizi2

    Joined:
    Nov 4, 2013
    Posts:
    70
    omg, i find solution - we can just animation.enable = false

    what? When i try, I just made like this: animation.gameObject.SetActive(false);

    and after that, unity give me warnings when i try set some values animator disabled...
     
  5. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    theANMATOR2b likes this.
  6. fdsagizi2

    fdsagizi2

    Joined:
    Nov 4, 2013
    Posts:
    70
    Yes, but it not flexible. I research this fully - now i use Vertex skinning trought matrix buffer - not from texture like in that example!

    i still need some function - like animator.SkipUpdateFramesMs = 50;

    why?, because if i use animtor.enable = false; and make update manualy - animator.Update(skippedDt) - it will ignore multy tread thread optimization :(

    because it look like:

    Code (CSharp):
    1. for(var it in anims)
    2.     it.Update(skippedDt); // animation updated step, by step - ignore multy tread unity optimization for animations...
     
  7. fdsagizi2

    fdsagizi2

    Joined:
    Nov 4, 2013
    Posts:
    70
    or will be cool add to AnimatorCullingMode like this:

    AnimatorCullingMode.Skip
    and
    AnimatorCullingMode.SkipUpdateTransforms

    and we will can skip some frames...
     
  8. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Have fun waiting meanwhile though (seems trivial to code this yourself).
     
    ahihihu likes this.
  9. fdsagizi2

    fdsagizi2

    Joined:
    Nov 4, 2013
    Posts:
    70
    I'm not understand how?
     
  10. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
  11. fdsagizi2

    fdsagizi2

    Joined:
    Nov 4, 2013
    Posts:
    70
    if i will call Update manualy, it will work slower than usual animation - because it ignore multy - thread

    anim1.Update(dt);
    anim2.Update(dt); // it will wait, while anim1 not complite update
    anim3.Update(dt); // it will wait while anim2 not complite update

    when Unity do update animations, it use multy threaded optimizations and update animations work - in all jobs threads!
     
  12. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Also do a test where the animators are out of sync to begin with because Unity does have an optimisation where it will combine redundant work.