Animancer can be more efficient than other systems if used correctly, though in most cases the differences are small enough not to matter either way.
The following benchmarks compare the performance of several animation systems:
- Animancer: this plugin.
- Mecanim: Unity's main animation system.
- Simple Animation: another animation system made by Unity with the Playables API and available on GitHub.
- They compare
Spriteanimations separately for each system. Overall,
Spriteanimations are the most efficient, followed by
Generic, and then
Humanoids are least efficient.
These tests each focus on a single performance metric and even then they show relatively small differences between systems, especially when taking into account everything else a game will be doing. So it is generally better to choose the system which will make development easiest.
The Unity Manual has a page about general Animation Optimization which is still applicable when using Animancer.
Animancer is about the same as Mecanim and takes 13-29% less time than Simple Animation.
This benchmark tests the time taken to call
Object.Instantiate on a prefab 100 times in a row.
Animancer is tested in two different ways:
|Immediately initialises all the animations that the character might play. It is used as the baseline since Mecanim and Simple Animation also work like that.||Does not initialise any animations other than the Idle and would instead only do so "on-demand" when they are actually played. This allows Animancer to instantiate 20-35% faster by splitting parts of the initialisation cost into later frames, essentially cheating this test by moving the cost into the Average Frame Rate instead.|
Click here to see the results:
Average Frame Rate
Animancer is ~5% faster than Mecanim and Simple Animation for most Rig types except for
Spriteanimations where Simple Animation is about equal to Animancer.
|The DefaultHumanoid model used in most of the Animancer Examples.||The Paladin J Nordstrom model used in the Weapons example.||The Knight
This benchmark counts the total number of frames rendered in 30 seconds to calculate the average number of frames rendered per second while animating 100 characters.
- During the test, each model is periodically commanded to play a particular animation from a set of options to include the cost of their commands/fading/etc. in the factors being tested.
- The sequence was set so that the number of commands given in a row and the number of models fading at a time would change throughout the duration, however the exact same sequence was repeated every time for every system to ensure a valid test.
- Tests were conducted with the models off-screen (with the
Culling Modeset to
Always Animate) so their rendering would not affect the frame rate. Otherwise the results are simply smaller numbers that fluctuate much more.
- This means that the actual practical differences in a real game will be extremely small.
- In addition to the Startup and Demand modes used in the Instantiation tests, these tests also compare having the
AnimancerPlayable.KeepChildrenConnectedproperty set to both
|Disconnected (default is false for Humanoid Rigs)||Connected (default is true for Generic Rigs)|
|Disconnect animations from the Graph Structure when they are not being used (
||Avoid the performance cost of disconnecting and reconnecting things which can outweigh the benefits of having them disconnected.|
Generic Rigs are also slightly more efficient with
KeepChildrenConnected set to
Sprite animations gain a much larger benefit from setting it to
true so that is the default for all
Generic Rigs because it is not possible to automatically differentiate between
Sprite animations and other
Generic animations at runtime.
Click here to see the results using the full 0-300 range:
Click here to see the results using a partial 250-300 range to make the differences clearer:
- Tests were conducted in a runtime build so results would not be affected by editor-only functions.
- Tests were conducted using Animancer Pro since the code obfuscation of the Animancer Lite DLLs has a (very small) negative impact on performance.
- Each test was conducted 10 times and the results averaged with any significant outliers removed.
- Unity 2019.3.1f1
- OS: Windows 10
- CPU: i7-7700HQ @ 2.8GHz
- GPU: GTX 1050
- RAM: 8GB