Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Crowd Skinner - Massive Crowd Rendering With High Performance

Discussion in 'Assets and Asset Store' started by mgabillard, Oct 2, 2018.

  1. mgabillard

    mgabillard

    Joined:
    May 16, 2017
    Posts:
    23
    Hi everyone! My new asset is available in the Asset Store!

    Crowd Skinner allows you to render and animate a large number of skinned meshes with great performance!

    ASSET STORE LINK

    Documentation (included in package)

    Windows DEMOS
    Hybrid Mode
    Full Mode

    The default unity animation system can only run hundreds of full skinned and animated characters before noticeable framerate loss occurs. With Crowd Skinner, thousands of fully animated meshes can be displayed at the same time!

    How it works
    Crowd Skinner uses GPU Skinning and GPU Instancing, along with the new Unity Entity Component System, to achieve incredible performance!

    2 Modes
    Crowd Skinner comes with two modes : Hybrid and Full.

    Hybrid Mode
    Hybrid mode works with the traditional unity Game Object system. Each skinned mesh will have its Game Object and Transform in the scene.
    Hybrid mode is great for beginners, and can display 15 000+ characters.

    Full Mode
    Full mode takes full advantage of the new Entity Component System, and has great performance! In this mode, skinned meshes are pure ECS entities.
    Full mode is great for advanced programmers, and can display 100 000+ characters.

    - Full Source Code
    - Compatible with Mecanim Animations
    - Animation Transition Support
    - LOD Support



    Feel free to reply in this thread or email me with any questions you may have.
    Thanks!
     
    Last edited: Oct 4, 2018
    flckev and ZJP like this.
  2. walledcityinfotech

    walledcityinfotech

    Joined:
    Oct 10, 2016
    Posts:
    712
    This looks like a game changer! Awesome stuff bro, can you please make a tut video or can we have some documentation of how to use this Awesome Asset.?
    Also, in the video, what are the specs of the system you used ?
    it is needless to ask coz I can sense that it will be great but still, what can we expect the performance of this asset on mobile platforms.? Can we have Any benchmark on mobile?

    I can see that this Asset will be huge in few days! Keep up the good work!

    Best
    Hamzah
    Walled City Infotech
     
    Neviah likes this.
  3. mgabillard

    mgabillard

    Joined:
    May 16, 2017
    Posts:
    23
    Thanks for your interest!

    Here is the documentation included in the package : http://mutiny-software.com/CrowdSkinner_DOCUMENTATION.html

    The video was captured on an i5-4690k quad core and a GTX 1070, at a 1920x1080 resolution. You can see it hits the 200 000 characters bar. That's why I think you can hit 100 000+ characters on a smaller config or a higher resolution.

    I can't guarantee mobile compatibility, as I didn't have the time to test it yet. It should work on theory, but since it's using an advanced shader, I guess it would only work on modern mobile architectures. Plus it makes heavy use of the Entity Component System / C# Jobs to balance the workload on multiple CPU cores, I don't know how mobiles would handle that. Sorry to be so vague about it, I do this as a hobby so I don't have much time to spend on it ;)
     
  4. westryder907

    westryder907

    Joined:
    Dec 28, 2016
    Posts:
    61
    Would this asset give me full control over my characters...Could I add a ragdoll to a character created using this asset and have them go limp when they die? If so I will buy ASAP..
     
  5. mgabillard

    mgabillard

    Joined:
    May 16, 2017
    Posts:
    23
    Hi!

    Absolutely! In hybrid mode, you have a game object for each character, so you could easily add a ragdoll and activate it when it dies.

    On full mode, you don't have game objects, but you can keep track of each character position and rotation, and instantiate ragdolls accordingly.

    Let me know if that's clear enough.

    Thanks!
     
    Last edited: Oct 8, 2018
  6. westryder907

    westryder907

    Joined:
    Dec 28, 2016
    Posts:
    61
    Alright to make thing absolutely clear here before I buy.

    I have a game that at requires 10's... 100's... 1,000's of enemies on screen created with about 60 different models using Humanoid Mechanim. The enemies need to be dynamic enough that they can be ragdolled at anytime or blend animations via Mechanim, my enemies also need to have dynamic animation applied at certain points in my game.

    You're saying this asset can handle all that while maintaining "1,000s" of enemy npc on screen at a time???
     
    Last edited: Oct 7, 2018
  7. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,469
    1000/60 = 16 clones per model
     
  8. westryder907

    westryder907

    Joined:
    Dec 28, 2016
    Posts:
    61
    Thanks, but that doesn't answer my question.
     
  9. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,469
    I mean does your game support 60 different models without slowing down already? At best you will have duplicata of those model (16 instances), and that highly depend on which machine the game will runs.
     
  10. westryder907

    westryder907

    Joined:
    Dec 28, 2016
    Posts:
    61
    I have 60 different human models. I want to create a mob out of these 60 human models. I need about 1,000 human models in my mob. Can this asset handle 1,000 humanoid models in this fashion?

    My models need to be dynamic to the point I can blend their animations using Mechanim masks etc.

    My current game (PC) can handle about 50 normal models before slowing down.

    Can this asset produce 100's of models with IK???
     
    Last edited: Oct 7, 2018
  11. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,469
    I'm not the creator so it will answer better than me, but it's not a character controller it's a "skinner". What it does is it offload the weight of skin calculation from the cpu, by either moving it to multithread optimization (ecs) or the gpu. So the question of IK doesn't come up, really, it just take your object data apply skin. So the answer should be along the line of performance of your game - skinning processing weight, since there is generally a lot of vertices to skin, it should be able to handle 1000 of character, as it announce a low ceiling of 15 000.

    My calculation was about the overhead saved by the gpu instancing, since you have 60 models (assumed at the same time on screen) it would divide the cost by 16 in an hybrid set up.
     
  12. westryder907

    westryder907

    Joined:
    Dec 28, 2016
    Posts:
    61
    Thanks for that.

    I just need to know if models created by this asset can use IK, Animator animations and ragdolls without doing coding much like MeshAnimator does.

    This sounds a lot like MeshAnimator which I already have, I don't like how non-dynamic my enemies are and want to add more of a dynamic touch to them by using PuppetMaster,FinalIK and swapping out animation sets etc.
     
  13. mgabillard

    mgabillard

    Joined:
    May 16, 2017
    Posts:
    23
    Crowd Skinner only supports 50 different archetypes (combination of model + material) out of the box. But it can be easily extended if you're not afraid of modifying the source code (I would not guarantee the performance beyond 50 models though).

    For the Ragdoll part, you would have to handle it separately from Crowd Skinner (instantiate game objects with classic skinned mesh renderer).
    Crowd Skinner uses baked animation data, so it does not support realtime bones controlled by physics.
     
  14. kricheis

    kricheis

    Joined:
    Nov 20, 2015
    Posts:
    5
    Hi, nice to meet you. sorry, I can't speak english.
    I bought your asset.

    . My unity Ver : 2018.2.12f1
    . Windows 64bit

    1. I'm done setting.(Player Settings, Deferred Rendering, Burst/Entities install)
    2. Editor playing : Very Good!
    3. Standardalone build : Below error code and Fps Down!
    4. What problems? plz...
     

    Attached Files:

    • 1.png
      1.png
      File size:
      48.1 KB
      Views:
      902
    • 0.png
      0.png
      File size:
      116.4 KB
      Views:
      849
  15. mgabillard

    mgabillard

    Joined:
    May 16, 2017
    Posts:
    23
    Hi, thanks for buying the asset!

    Looks like you are missing some Visual Studio SDK ("No MSVC installations were found on the machine"). Try reinstalling Visual Studio 2017 and Visual Studio tools from the Unity Installer.

    Here is a thread with similar problem : https://forum.unity.com/threads/burst-for-standalone-players.539820/#post-3749032

    Let me know if it works, thanks!
     
  16. Zenithin

    Zenithin

    Joined:
    Jun 7, 2016
    Posts:
    35
    would you know if this would be of any use in case of webgl builds?
     
  17. mgabillard

    mgabillard

    Joined:
    May 16, 2017
    Posts:
    23
    I'm not sure, it depends on the way webGL handles multithreading.
     
  18. TimeSniper

    TimeSniper

    Joined:
    Nov 26, 2012
    Posts:
    18
    Hi?
    I am testing the FullModeExample with my custom characters. As you can see from the below screenshot, I added more than one character for my own purpose. But the character that shows up is the only one in the CrowdSkinnerManager Archetype Prefabs first slot.

    https://drive.google.com/file/d/1ov0fN_gL2mdkukzjeoLZG9LnhaRlWLjO/view?usp=sharing

    https://drive.google.com/file/d/1zTA1CPZ6Bh_u-OZXYNivfwP4fso-GnNL/view?usp=sharing

    Please be advised that I already set those Archetype IDs from A0 to A5 to each Crowd Skin setting ID slot. Also, please be advised that I assigned proper materials which is derived from SportyGirl material.

    This is the result that I have. I tried every possible way that came to my mind. But no luck.
    https://drive.google.com/file/d/12gAWEYqVJqVb9vvcEsLNFYAfZ0wxBFwS/view?usp=sharing

    Can you give me some advice?
    Thanks
     
  19. mgabillard

    mgabillard

    Joined:
    May 16, 2017
    Posts:
    23
    Hi,

    This is difficult with only a couple screenshots. I would need to see at least your other prefab settings. Or even better, your entire project so I can try to run it :)
     
  20. TimeSniper

    TimeSniper

    Joined:
    Nov 26, 2012
    Posts:
    18
    Please let me send you my whole project, which is very simple. I am going to use the Start Conversation interface, which is found from your profile for this.

    Thanks
     
    Last edited: Nov 5, 2018
    mgabillard likes this.
  21. mgabillard

    mgabillard

    Joined:
    May 16, 2017
    Posts:
    23
    Thanks for your project, I took a look and modified it, it works now (I sent it in the private conversation).

    Two things :
    - You have to set the right Archetype ID on your prefab (Sporty girl 2 prefab had Archetype ID A0, I set it to A1).
    - It's up to you to instantiate the characters. In the Demo, it's done in the GameController code. I modified it to also instantiate sporty girl 2.

    For more information on how it works, don't hesitate to take a look at the included documentation ;)
     

    Attached Files:

    apan-bin likes this.
  22. TimeSniper

    TimeSniper

    Joined:
    Nov 26, 2012
    Posts:
    18
    It's working. Thanks a lot.
     
  23. Squib

    Squib

    Joined:
    Nov 6, 2018
    Posts:
    2
    Does this work with blend shapes and VR?
     
  24. mgabillard

    mgabillard

    Joined:
    May 16, 2017
    Posts:
    23
    Should work with VR.
    Blend shapes I cannot guarantee. The system works by writing animation data (basically vertex positions) into textures. It could maybe work if blend shapes modifications are included in the base animations, but you won't have any control on it at runtime.
     
    ghostitos likes this.
  25. Quaaaid

    Quaaaid

    Joined:
    Nov 10, 2012
    Posts:
    14
    Hi Mgabillard, this looks incredible, I would like to ask what are the limitations of this asset (in Hybrid and Full) when using higher poly models? I was looking into MeshAnimator, but this has very high ram usage as it turns the skinned meshes into lots of standard meshes for each frame of the animation. For my purposes, I would only want 100-200 or so displayed at a time, but I would prefer them being high(ish) poly. I definitely don't need more than 10-20 types of NPC being displayed, and they would only be background npc's for a town (walking, talking, idling). If I kept the number of NPCs displayed low (100-200) but they had high)ish poly count (10-40K Polys with LOD), would this asset work for me with very good performance? Thanks :)
     
  26. mgabillard

    mgabillard

    Joined:
    May 16, 2017
    Posts:
    23
    Hi! Sure no problem, as long as you have optimized LODs, it should run fine ;)
     
  27. Quaaaid

    Quaaaid

    Joined:
    Nov 10, 2012
    Posts:
    14
    Thanks, bought the asset, will test a bit more and leave a review :)
    Quick question, I am planning on using the asset to render mainly static people, but I also want to have some walking around. With the full mode, can I still move them around, or is Full just static? Thanks :)
     
  28. mgabillard

    mgabillard

    Joined:
    May 16, 2017
    Posts:
    23
    Yes, you can still move them around, even in Full Mode (by updating UnitTransformData.Position of each character in a C# Job ;))
     
  29. Quaaaid

    Quaaaid

    Joined:
    Nov 10, 2012
    Posts:
    14
    Wow, this is an amazing asset, thanks for the replies, and for the effort with the asset itself! :)
     
    mgabillard likes this.
  30. Quaaaid

    Quaaaid

    Joined:
    Nov 10, 2012
    Posts:
    14
    Another quick question, is it limited to one material per archetype? Or is there a way to have multiple materials? Thanks
     
  31. mgabillard

    mgabillard

    Joined:
    May 16, 2017
    Posts:
    23
    At the moment yes, an archetype is a combination of a mesh and one material. So if you want the same mesh with a different material, you have to create two distinct archetypes.
     
  32. Quaaaid

    Quaaaid

    Joined:
    Nov 10, 2012
    Posts:
    14
    mgabillard, is it possible for hybrids to cast shadows? the NPCs look a little funny without them :)
     
  33. mgabillard

    mgabillard

    Joined:
    May 16, 2017
    Posts:
    23
    Shadows are not supported by the shader at the moment, I'm working on it and it will be included in a future update :)
     
  34. Quaaaid

    Quaaaid

    Joined:
    Nov 10, 2012
    Posts:
    14
    Brilliant, thanks :)
     
  35. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    239
    Hi, I just bought Crowd Skinner and I have some questions.

    1. Can a character collide with other objects? Such as cube. I tried to add collision bodies to them, but they didn't have a collision effect.

    2. Have you considered adding the Culling function? This will further improve performance.

    3.Can I instantiate a non-humanoid object? I tried to replace the cube's MeshRenderer with the SkinMesnRenderer, but the rendering failed because of the lack of bones.
     
    Last edited: Nov 29, 2018
  36. mgabillard

    mgabillard

    Joined:
    May 16, 2017
    Posts:
    23
    Hi!

    1. Yes you can, but in hybrid mode only. In hybrid mode you can add whatever component you want, such as a collider on your skin prefab. What you can't do is put colliders to arms and legs for example, and expect them to follow the bones animation. As animation is done on a separate process, handled by GPU, you don't have access to bone transforms as in the classic mecanim system.

    2. Culling won't work because the meshes are rendered via Graphics.DrawMeshInstancedIndirect.

    3. No, the rendering system is made for skinned meshes only, and expects bones and animations.
     
  37. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    239
    Understand, thanks for reply.

    1.What if the character has multiple Skinned Mesh Renderers? My zombies have more than a dozen Skinned Mesh Renderers, and their body models are separate. I tried to instantiate with Crowd Skinner, but only the head was rendered.

    2.Do you think that using object pools to generate and reclaim objects in Crowd Skinner is helpful for optimization? I tried disable the character and then enable it but I get the error: ArgumentException: The entity does not exist. Does this mean that the object pool cannot be used in Crowd Skinner?(Hybird mode)

    3.Is it possible for characters to support shadows? No shadows look strange.

    I have an idea about shadows. If traditional shadows are difficult to achieve, maybe you can first cast a fake circular/rectangle shadow on the bottom of the character. This shadow can match any character and looks good.
     
    Last edited: Nov 30, 2018
  38. mgabillard

    mgabillard

    Joined:
    May 16, 2017
    Posts:
    23
    1. You will have to combine your meshes into a single one first. Some assets can do that for you. Personally I use SimpleLOD for my game project.

    2. Calling the InitEntity function of your CrowdSkin when re enabling your character should work. That's a limitation of the Unity Entity Component System. When a game object is disabled, the Entity is killed with all its entity components.

    3. I'm working on it. Shadows will be included in a future update.
     
  39. SmashedAvocado

    SmashedAvocado

    Joined:
    Dec 19, 2013
    Posts:
    45
    Looking forward to checking this out when it has shadow support! :)
     
    mgabillard likes this.
  40. NicoVar

    NicoVar

    Joined:
    Sep 21, 2012
    Posts:
    40
    Hi! Would this work for a stadium crowd animation? I'm thinking a few different models scattered and replicated so they don't look the same.

    Also, can the animations be "staggered" so they move differently?

    Thanks.
     
    mgabillard likes this.
  41. mgabillard

    mgabillard

    Joined:
    May 16, 2017
    Posts:
    23
    Hi! Absolutely, this is the perfect usage for it!
    Yes, you have full control over animation launch for each character :)
     
    NicoVar likes this.
  42. PatHightree

    PatHightree

    Joined:
    Aug 18, 2009
    Posts:
    297
    This asset looks wonderful, but I'm kind of disappointed that shadows are not (yet) supported.
    Because the main image on the asset store clearly shows shadows, this is kind of misleading :(

    Also, to continue on the stagger animation question by @NicoVar, it would be great if the demo(s) would show that.
     
  43. Archie747

    Archie747

    Joined:
    Jan 7, 2015
    Posts:
    25
    Hi, Im interested in this awesome asset for my game, but its a mobile game.
    does this crowd skinner support android and ios ?

    thanks
     
  44. mgabillard

    mgabillard

    Joined:
    May 16, 2017
    Posts:
    23
    Hi, In theory, yes! But I cannot guarantee 100% as I didn't test it yet.
     
  45. PiAnkh

    PiAnkh

    Joined:
    Apr 20, 2013
    Posts:
    126
    Hello,

    this looks like a really interesting asset. I am interested in trying it out.
    Could you answer a couple of questions please?
    1. When you have a model with different LODs, does that count against the limit of 50 archetypes?
    In other words is each LOD counted as a separated archetype?
    2. In the demo each model is playing the same synchronised animation but I assume that there is no such limitation, right?

    Thanks
     
  46. mgabillard

    mgabillard

    Joined:
    May 16, 2017
    Posts:
    23
    Hi!

    1. No. Lods don't count. For each archetype, you can set up to 4 LODs.

    2. No! You have full control over each individual character. You decide when to launch each animation of each character!
     
  47. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,625
    I'm interested in this, but I don't understand exactly what this is doing, and the advantages and limitations of the approach.

    If the characters are instanced, you can change their location and orientation, but the instances will run the same animation in unison ...?
     
  48. mgabillard

    mgabillard

    Joined:
    May 16, 2017
    Posts:
    23
    Hi!

    No, only the mesh rendering part is instanced (with DrawMeshInstancedIndirect). Animations run separately for each character.
     
    hopeful likes this.
  49. samuel-levine

    samuel-levine

    Joined:
    Sep 1, 2012
    Posts:
    8
    Hey, this asset looks terrific - but I need to use it on an Android project, and it looks like none of the crowd renders at all when using OpenGL ES 3.0 graphics emulation (or playing on device).

    Could anyone suggest next steps I could try to get this working on Android?
     
  50. NicoVar

    NicoVar

    Joined:
    Sep 21, 2012
    Posts:
    40
    Just got your plugin and I'm playing with it and it seems awesome.

    Could you elaborate a bit more on how to make each individual character play a random animation state with a random normalized time?

    I'm new to jobs and I'm having a few issues with it to get it working.

    Thanks!