Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Too much memory getting used

Discussion in 'Animation' started by phoenixknight88, Oct 15, 2013.

  1. phoenixknight88

    phoenixknight88

    Joined:
    Oct 15, 2013
    Posts:
    4
    Hi

    I was wondering if anyone can help me. I am creating quite a animation intensive game (fighting genre) and we are on a tight memory budget (about 50MB for animations). The issue we are having at the moment is when we load the animation controllers it is allocating about 90MB worth (we have 200 - 300 animations per character). Is there any way to make the animation lazy load?

    If anyone has any pointers or any other solutions they could suggest it would be greatly appreciated

    Thanks
     
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,792
    Mecanim or Legacy? You can manually add and remove clips from the legacy Animation component.

    I don't know of any way to lazy load animation clips in Mecanim. However, you can assign animator controllers at runtime. Could you use different animator controllers for different situations?

    What about sharing more clips between characters and between moves? With blending, especially additive, you might be able to squeeze more out of each clip. Say you have four clips: standing punch, crouched punch, standing chop, and crouched chop. If you have an additive layer for crouching, you could use the same additive crouch and apply it to standing punch and standing chop.

    Blend trees might help, too. Say you have six kicking clips at various heights, from leg kicks to head kicks. You could implement them as a blend between two clips (lowest kick and highest kick) and get rid of those in-between clips.

    These are just some ideas off the top. You might already be doing them all. I hope something's helpful.
     
  3. phoenixknight88

    phoenixknight88

    Joined:
    Oct 15, 2013
    Posts:
    4
    Hi Tony

    Sorry forgot to reply the other day. We are using Mecanim. Thanks for the advice. I spoke to the animators and they said there isn't enough similar areas in the animations which would allow us to blending which is a shame. I will look at seeing if we can separate them out a bit more :)

    Thanks