Optimize animation of numerous characters


I’m implementing a scene with lots of agents wandering. The walking animtion is the same for all of them. It is managed by the action actuator.
The animation is demanding (70% now). Humm, if I use the same animation for all agents, is there a way to optimize it?
Best would be to divide my agents in a few groups: all with the same animation but the start frame would be different from one group to another.

Thanks for your advice,
Michael (curious newby)

there are many ways how to improve performance of animations. Here are some of them that I remember:

  1. Use LOD
  2. Keep your polycount for agents low
  3. How many bones do they have ? If possible try to reduce count of them
  4. Try to use less IK
  5. Delete unnecessary channels in dopesheet

Use group duplication for that.


Firstly percentage is not important. It’s the time that you need. Also, to optimise it check the scene panel in game engine mode, you can reduce the animation frame rate and add key frame interpolation or something like that.

Try checking the “Restrict Animation Updates” under the System panel in the Render properties. If your Animation Frame Rate is something like 24 or 30fps, you should see your time on Animation drop by roughly half.

Also, keep in mind that the cost of animations is split into two main parts: updating the pose and deforming the mesh. Updating the pose is what is counted under the Animation category of the profiler. To bring this down, you can try to decrease the number of bones/channels. Also, don’t key channels such as scale unless you actually need them. The deformation part will show up under the Rasterizer and this will be affected by the number of polygons in the character’s mesh.

You can find a bit more info here: https://mogurijin.wordpress.com/2012/01/03/bge-profile-stats-and-what-they-mean/

If you set the animation frame rate to 30fps, but the game runs at 60fps, then your characters’ poses will only update every 30 frames, leading to stuttery movements, correct? Or is there more to it than that?

The animations will still look fine, and they will no longer be locked to your game’s frame rate. In other words, even if your fps drops to 15fps, the animations will still play back at 30fps.

or Dont use any…

@mmerlange - It would appear BluePrint’s video here shows an example of what Moguri mentioned. You can see in it that the Rasterizer percentage is rather high for what is going on (just drawing a few objects in Multi-Texture mode). It would appear that the mesh is relatively simple, so I assume that the Rasterizer usage is because of what Moguri mentioned, the deformation of the mesh itself.

P.S. Thanks for that blog post, Moguri. It’s very useful to know more about the profiler.

He is right, I decimated my model 1 planer 15 degrees and now it’s 5% :slight_smile: