- Home /
Animations causing big Performance Drop
I'm working on an fps and I've recently noticed that my AI's animations seem to have a huge performance cost. Specifically, when I have several AI with disabled animation components I get between 80 and 90 frames per second. When I run the game with the same AI, but with their animations enabled, I get around 15 frames per second.
Does anyone know what could be causing this and/or how I can fix the problem or at least optimize it?
This would interrest me too! $$anonymous$$any animated enemys drop my framerate too, expecially on Android. But maybe it is the price for animations? Optimisation tips would be very appreciated.
What program did you use to animate and model your ai characters?
Answer by Bonecrusher52 · Apr 12, 2012 at 02:08 AM
We made the models and animations in blender.
It seems my colliders are mostly to blame for the performance drop. I'm thinking that moving colliders, especially complex ones (like the mesh colliders I was using for accurate shot detection) with animations somehow causes a lot more calculations to be made.
I'm not sure about the details of the problem, but I know that when I optimized the collision meshes in blender I got a small framerate boost, and when I replaced the mesh colliders with primitives I got a significantly higher framerate (about 45 fps with 10 AI on screen). I also tested them without any colliders at all, except for their character controllers, and I got a around 90 fps with 10 AI on screen.
So it basically comes down to a curve of performance vs. hit detection accuracy. I'll probably work around it a bit by using simpler colliders on cannon fodder enemies and when there are large amounts of AI on screen, and then using mesh colliders for enemies that are more important and tend to be in less crowded places.
Your answer