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.
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.
EDIT:
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.
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.
@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.