All -
Anyone had success running multiple Maya-created animations in their app? We’re under the 7K tri/30 draw call iPhone limitations (5K/25 calls max), but as soon as more than one animation plays, framerate drops from 30 to <15. If animations are turned off, we get buttery smooth perf.
Animations have been created in Maya and exported in FBX @ 30FPS. Looks like the full model and all frames are coming through so thinking that perhaps the size of the animation files are causing too much overhead for the iPhone to handle (works fine in Unity). We have anywhere from 1 (idle) to 5 (idle/weapon draw/firing/hit/death) animations playing.
Thoughts?
Are you telling unity to perform keyframe reduction on import? How many bones do your characters have?
Animation data can be a big memory hog if its uncompressed and you’re dealing with a complex skeleton. My current project is running very smoothly on iphone with up to 8 characters on screen playing multiple mixed/blended animations, but each character has an extremely low bone count (between 7 and 10).
EDIT: The other likely culprit is the sheer amount of vertex deformation going on. Bone deformation is pretty CPU intensive.
Thx - looks like we’re working with uncompressed animation, which certainly is a no-no. We have about 10 bones/character, so pretty low there and deformation is minimal.
Thanks for the advice.
@Mr Animator - are you getting 30fps with your 8 animations on screen at one time? We have done key frame reduction, and our models only have 10 bones each and animation is being imported into Unity @ 30fps. When three characters are on screen at one time,game perf drops from 30 to 15 fps (similar symptoms to Yogibear’s recent post, actually).
We’ve been working with our animations without much luck. Here’s a complete description of our situation:
- We have about 40 .fbx files, each about 1.1MB each, originally sourced from 40 separate Maya files (animations are about 0.5 seconds long each). 20 for the good guy, 20 for the bad.
- The .fbx files have primarily animation-only data. The extraneous geometry information listed in Unity is null in size. Our assumption is therefore that the 1.1MB worth of data is nearly 100% animation data and that this is causing performance degredation.
- We have looked at the following support documentation and are deep into the 2 solutions described there: http://unity3d.com/support/documentation/Manual/Character-Animation.html
- Solution 2 (Importing Animations using Multiple Model files) is the optimal solution for us because we have separate Maya source files that we are exporting from. We have experimented with this, but it is not going to solve our performance problem.
- Solution 1 (Animation Splitting) would require us to combine multiple animations in Maya, which is something we’ve researched and are under the working assumption that this is not possible without redoing the animations. This would remove all of the extraneous null geometry information that is replicated 40 times over in each .fbx file, however. We uncertain whether doing this will do much more than solution #2 (importing using multiple model files)
Several questions arise here:
-
Is there a way to see the final size of each animation within the Xcode project created? Our 40 animations are quite short, but 1.1 * 40 of them certainly adds up if the entire .fbx file is included in the final build.
-
Is there a way to either compress or reduce the quality of animations beyond keyframe reduction? Maybe spread the keyframes out??
-
Has anyone used Solution 1 above for the iPhone with several animations? Mr. Animator, it would appear as though this is what you’re doing.
Any other ideas? Animation is pretty key to our title, so we’d welcome any feedback/input anyone may have.
While my framerate isn’t a perfect 30 at the moment, its mostly due to script optimization that needs to be done, and not due to the amount of animation we’re pushing. That said, it sounds like I have a lot less animation - certainly less than 40 animations total at the moment, and no more than 4-5 unique animations playing at the same time - while I might have 8 characters on screen at times, they’re all sharing animation assets(playing the same run cycle for instance).
There shouldn’t be any way that your animation data is clocking in at 1.1 megs per half second - that figure must include geometry, skinning and other information as well.
We are using solution 1 as you posted above - creating all animations for a character within a single maya file and having unity split and name the clips on import, but that really shouldn’t make a difference as far as animation clip size goes. If you want to try it and test it out though, you can simply copy/paste your animation curves from each of your seperate maya files into a single maya file.
Have you tried running tests to eliminate all other variables? For instance, does your fps still suffer with just an otherwise empty scene, no scripts, just a whole ton of textureless characters on screen looping various animations? Does your game play perfectly smoothly if you just disable your animations temporarily?
Thx much for the fast response. We’ve isolated the issue to be one of animation as we get 30fps when we disable animation only, we’re @ 20-25 draw calls max, and 5K tris max.
On screen, we too only have 4-5 unique animations playing at any one time. However, we have a bunch of non-essential animations like pull out weapon and put away weapon (in addition to fire weapon). BTW: each of these 3 are the same size (1.1MB), so I think we have a lot of extra junk in our .fbx file as pull out is much faster than fire but both are similar in size.
Will continue testing to see what happens when we only use/build the essential animations and will see if we can get the junk out of our .fbx files.
Our designer didn’t believe combining animations into one Maya file was possible, but you indicate it’s a relatively trivial item. Could you advise what I should suggest to our designer to copy/paste animation curves?
to easily copy/paste animation between two maya files:
-
Select all of your character’s controls in a specific order - when copying and pasting, you will get mangled results if the origin and destination of your animation curves differ in any way, so you have to make sure that you select your various rig components in the same order. To make things extra easy, you can make yourself a shelf button to select your entire rig.
-
Hold shift and left-mouse-drag in your animation timeline to select all of your keys. The selected region will turn red
-
Click and hold right mouse button on the selected region and choose “copy”
-
Open your other scene, select all of your controls in the same order as before, move your current time to the desired position, right click the timeline again and choose ‘paste’.
ok, um, found our problem… 44 bones in our rig!!!
Bringing this down to 10 per yours and dreamora’s suggestion. Re-rig done, re-animating. Hopefully we can still open the little guy’s mouth
Thanks to all for their feedback. Helped a ton. Will update on perf improvements when done.
Why not create multiple models: one that is used for the majority of the game where you see it from further away, and a “head model” with the lip bones etc for sequences where you see that for example.
Hey Dreamora - our character is literally front center and quite large most of the time. He’s also a little “unique” in that his head is the focus of the character (will make more sense when we publish in a couple weeks).
In any case, point well taken on having multiple models by use case and I can definitely see that we’ll need a mid-range model for certain circumstances. Thanks for your advice.
OK in that case if the focus is that much on facial aspects, then its natural that you want to have a bit more there
But I guess even then you could benefit from having multiple models, one with the large amount of the bones, one with the small amount for example.
Then you could only have the detailed one on the model(s) that are meant to talk right then or right after. Would potentially still save quite a bit of performance.
something that generally helps to have a higher performance is restricting the amount of bone weights, using as few as possible (optimally 1 ;)).
Less bone weights means less work for the cpu to do the animation.