Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Showcase DOTS Dynamic Bones (WIP)

Discussion in 'DOTS Animation' started by NT_Ninetails, Jun 6, 2021.

  1. NT_Ninetails

    NT_Ninetails

    Joined:
    Jan 21, 2018
    Posts:
    196
    This is the current progress on my DOTS Dynamic Bone project. I reduced the system to a single system that runs in Burst using Entities.ForEach().ScheduleParallel().

    Doing so basic testing I found that the Main Job runs at 0.02ms-0.03ms with The Main Job + LocalToWorldUpdates taking ~0.03ms.

    Unfortunately It isn't setup to work with Non-Rigged entities (Entities without the Unity.Animation.Rig IComponentData) but that shouldn't be too hard to add.

    Due to life and stuff, my updates may be slowing down a bit but I'll try to make time to put some of my creations on the asset store and update them, as well as make a few tutorials and Demos. Stay posted :D

    NOTE: this system ONLY WORKS IN ECS/DOTS!

    another note: yes, the model use wasn't skinned to perfection - my apologies

    systems in use:
    InputSystem: Unity's new InputSystem running in a DOTS System
    MovementSystem: Custom DOTS system
    CameraSystem: Hybrid DOTS system
    AnimationSystem: Custom DOTS system

     
    Last edited: Jun 6, 2021
  2. Sunstrace

    Sunstrace

    Joined:
    Dec 15, 2019
    Posts:
    40
    nice work.
     
  3. Mockarutan

    Mockarutan

    Joined:
    May 22, 2011
    Posts:
    159
    Maybe a bit unsolicited, but here is something similar we made for our game. It's not something I will sell on the store, so no competition :) But maybe some inspiration!
     
  4. NT_Ninetails

    NT_Ninetails

    Joined:
    Jan 21, 2018
    Posts:
    196
    did you make the GPU skinned spline yourself?
     
  5. Mockarutan

    Mockarutan

    Joined:
    May 22, 2011
    Posts:
    159
    Yes, it's made with some bezier smoothing in the shader as well.
     
    NT_Ninetails likes this.
  6. NT_Ninetails

    NT_Ninetails

    Joined:
    Jan 21, 2018
    Posts:
    196
    nice
     
  7. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,419
    Finally! -- Some DOTS Animation action! :D
     
  8. andreiagmu

    andreiagmu

    Joined:
    Feb 20, 2014
    Posts:
    175
    @NT_Ninetails Great work! Is your DOTS Dynamic Bones system already available to test/early access/buy somewhere?

    Today I was testing animations in my game project (that I'm migrating to DOTS), which used Dynamic Bone asset for some animations. Unfortunately, I was disappointed to discover that regular Dynamic Bone doesn't work with DOTS. :(

    Your system is exactly what I need! I'd gladly buy a license right now if it was available at the store! :D
     
  9. NT_Ninetails

    NT_Ninetails

    Joined:
    Jan 21, 2018
    Posts:
    196
    I guess I could make a demo, though the system itself isn't fully finished yet. I took a long coding break after completing V0.8 cause that took a lot of work to get working in DOTS.
     
    andreiagmu and awesomedata like this.
  10. NT_Ninetails

    NT_Ninetails

    Joined:
    Jan 21, 2018
    Posts:
    196
    Update: So after a day of testing I found that the system still works if you don't specifically have animations with the characters BUT only works if you give you character a rig component to the GameObject and add an AnimationGraphTransformHandle to the root rig. This means that the GameObject will be put through the Animation system but it shouldn't be a big performance hit since the entity doesn't have any associated animations to it. I'll be releasing the demo this week but there is a glitch with root dynamic bone jitter while the entity is in motion with Physics.

    I tried getting the system to work without needing to add a RigComponent but Unity has so many internal processes I can't access normally that I either recreated a system that already exists internally or I'm just not allowed to do anything.
     
    andreiagmu likes this.
  11. NT_Ninetails

    NT_Ninetails

    Joined:
    Jan 21, 2018
    Posts:
    196
    I have Good News and Bad News:

    Bad News: The system still isn't 100% working. There are still 2 known bugs.
    1) physics calculation glitch that causes jittering

    temp solution: set Inert to > 0. This makes if so the player's position is ignored in calculations.

    2) the more children you have, the less accurate the calculations are. i.e. Parent->child->child->child->child (I posted some help about it in the DOTS Physics form if you wanna help)

    temp solution: try not having very complex models with tons of game objects.

    However, problem #2 only surfaces if your Euler rotation is anything other than (0,0,0).

    Good News: I'm uploading a plugin of this into GitHub. feel free to play around with it and let me know if anything else happens.
     
    andreiagmu likes this.
  12. andreiagmu

    andreiagmu

    Joined:
    Feb 20, 2014
    Posts:
    175
    That's awesome news! Have you uploaded it to your GitHub yet? I can't wait to play around with it! :D

    Great timing as I'm almost finishing a custom version of PhilSA's SimpleAnimationSystem, with animation retargeting support (and I also fixed a leak bug that the system had).
    Is your dynamic bone system based on SimpleAnimation, or does it use a completely different animation system?

    Can you link your help post here? For better reference. :)
     
  13. NT_Ninetails

    NT_Ninetails

    Joined:
    Jan 21, 2018
    Posts:
    196
    andreiagmu likes this.