• RuntimesUnity
  • Question regarding Unity runtime performance for many characters

Hi, I'm working on a Unity game and I'm wondering if anyone has experience using the Unity runtime with many characters animated on screen at one time. Most demo reels only show singular characters, but my tower defence game will require far more than what I've seen. I'm anticipating having anywhere from 50-200 animated characters on screen at once. So far, I've had good success using Unity's 2D skinned animations. 100 characters on screen remains quite performant. However, I find working with the animator clunky and difficult to manage at times. Please note, I expect my animations to be simple - less than a dozen bones, with simple meshes. That said, I would like to use mesh deformation to make the animations more dynamic. Unfortunately, I'm not able to test this using the trial license and don't want to shell out the cash for pro if my use case is not appropriate. Has anyone tested the limits of the spine unity runtime when rendering a high volume of characters? Thanks in advance.

Related Discussions
...
  • Изменено

Based on the information provided in the contexts, here are some insights regarding the performance of the Spine Unity runtime when rendering a high volume of characters:

  1. Performance Comparison with Unity's Built-in 2D Animation:

    • Unity's built-in 2D animation system generally offers better performance due to its limited feature set and GPU skinning. Spine-Unity currently uses CPU skinning but supports a broader range of features. While GPU skinning is not planned for spine-unity, parallelization (utilizing multi-threading) is planned, as mentioned in this issue ticket.
  2. Handling Many Characters:

    • For handling a large number of characters, it is crucial to consider the complexity of each skeleton, the number of vertices, bones, constraints, and draw calls. Performance can vary significantly based on these factors.
    • You can find performance recommendations in the spine-unity FAQ and the Spine User Guide.
  3. Optimizing Performance:

    • To optimize performance, consider using binary export for faster loading times and object pooling to manage skeleton instances efficiently.
    • Reducing the number of bones and vertices can significantly improve performance. Using techniques like pruning to reduce vertex transforms can also help.
    • Ensure that your skeletons share a single atlas texture and material to minimize draw calls.
  4. Testing on Target Devices:

    • It is essential to test your setup on the target devices to measure performance accurately. Profiling tools can help identify bottlenecks and areas for optimization.
  5. Real-World Cases:

    • While specific benchmarks for 50-200 characters are not provided, you can refer to the Showcase section to see what existing games have achieved using Spine.

In summary, while Spine-Unity offers a rich feature set, achieving optimal performance with a high volume of characters will require careful optimization and testing on your target devices. If you are looking for a more straightforward solution with better out-of-the-box performance, Unity's built-in 2D animation system might be more suitable for your needs.

  • geoffd ответили на это сообщение.

    Spinebot Thanks spinebot. You're not the hero I wanted, but you're the hero I needed. Very clear.

    3 месяца спустя
    • Изменено

    Here are the test results from running with Unreal Engine 5.4 on a Samsung Z Flip3 device. When testing with 50 Skin sample characters, the FPS was around 42 when there was no overheating on the device. For 40 Physics sample characters, the FPS was approximately 30. For 50 Speedy sample characters, FPS was 58.
    Extensive use of physics simulations or deformations will have a significant impact on performance.
    I hope this information is helpful.

    40 Physics sample characters

    50 skin sample characters