Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Released] DOTS Dynamic Bone

Discussion in 'Assets and Asset Store' started by NT_Ninetails, Nov 8, 2021.

  1. NT_Ninetails

    NT_Ninetails

    Joined:
    Jan 21, 2018
    Posts:
    195
    This is the forum post for DOTS Dynamic Bone! please post your feedback and questions below and I'll try my best to get back to you as soon as I can. I will also be posting updates in this post so stay tuned! For those looking for documentation and more information, please check the links below:

    Store Page: https://assetstore.unity.com/packages/tools/physics/dots-dynamic-bone-204257
    Discord: https://discord.gg/WXGeAxXQ
    Documentation: https://steven9smith.github.io/DOTS-Dynamic-Bone/

    Video:


    Updates & Notes:

    - fixed DOTSDynamicBone update system.
    issue: bones were experiencing weird calculations.
    cause: after performing tests with systems I changed some Job components without changing them back when I was done. This cause the DOTSDynamicBone calculations to be run twice in 2 different Jobs.
    solution: added strict component parameters to prevent the Jobs from running on each other's entities.

    -Update 0.9.5.6.1 11/16/2021
    I have V0.9.6.0 ready which includes the DOTSDynamicBoneCollider but the asset is still pending on the store. There are 2 types of collisions: Natural and Preset Collisions.

    Natural Collisions are collisions that occur with any DOTS Physics Colliders. since DOTS Colliders shapes are used, all DOTS Physics Colliders are supported but Mesh and ConvexMesh have pretty high performance costs (like always) so I would avoid using them when possible.

    Preset Collisions are just pre-set collisions. If you add a DOTSDynamicBoneCollider to an entity and add that collision to a DOTSDynamicBone Component then that is considered a preset collision. Currently only Spheres,Capsules, and Planes are supported. I can support more, I just haven't set up the math yet.

    Preset Collision is subject to change if I manage to get Natural Collision to perform faster than Preset Collisions. I'm thinking of starting a Dev-log to keep you all updated (let me know if you want that).


    - Update 0.9.6.0.3 11/27/2021:
    I removed the first version of Collisions since I didn't think it made sense to use a CollisionEvent job to manually add the DOTSDynamicBoneCollisers when I created a better alternative. Not only did V1 take up extra memory, but it was also had a very specific setup and was honestly sorta annoying to deal with since you had to have physics enabled, AnimatedLocalToRoot overrides, and some other stuff. The current offical collision system is will be the V2 version which only requires that you add a PhysicsCollider to your bone....its so much easier and you can disable DOTS Physics on that bone and the collisions will still work (don't worry there's a exclude physics boolean value for each particle if you want to turn on and off physics calculations.).

    I added a new Component call DOTDynamicBoneIndependantMultipleComponent. This is a merging of the IndependantDOTSDynamicBoneComponent and the DOTSDynamicBonesComponent so you can put this on any Entity and have it handle multiple Bones. I also added a boolean value that when set to true, you can have the Entity handle multiple bones and particles from multiple RigComponents. This essentially gives you the ability to either have a single entity handle all DOTSDynamicBone entities or you can organize it into with different entities.

    Now you be wondering, "that's cool and all but isn't the Independent DOTSDynamicBone stuff not associated with ParallelSchedule()?". Yes, this is true for all versions before V0.9.6.0.3 however with V0.9.6.0.3 I added a "Link" tag that links RigCoomponent entities with their respective Independent DOTSDynamicBone Entity thus, each can write to their respective buffers with .ScheduleParallel() and Burst!

    Also, v0.9.6.0.3 is 100% Burst compatible! (At least no errors pooped up when i compiled it with burst lol)

    Also, DOTSDynamicBonesComponent and the Independant DOTSDynamicBone Components support the V2 Collision System so not all components support the V2 Collision System.

    -update version 0.9.6.0.5 12/2/2021
    - added Preset Collision System
    - added Natural Collision System
    - Updated Docs
    - Updated Tutorials
    - Added samples
    - added DOTSDynamicBoneIndependantMultipleComponent (Multiple DynamicBones places on any Entity)
    - updated DOTSDynamicBoneEntityEditScript to v2 (Easier to work with)
    - added new Jobs for Collision processing
    - added Collision support for all DOTSDynamicBone Compoent types.
    - added Burst support for all Jobs excluding the Transform override system (going to work on making the Transform Override system burstable after this update)
    - added collision optimizations
    - removed some unnecessary data
    - fixed some mathematical calculations
    - fixed some glitches with some features
    - added some missing features

    Update 12/26/2021:
    - Updated some variable types to
    - Fixed an issue of IndependantDOTSDynamicBoneMultiple Component not updating the Unity.Animation.AnimatedLocalToRoot of 2 or more bones (I forgot to remove a break statement)
    - Tested Building some scenes with DOTSDynamicBone and DOTS Animation in scenes and sub-scenes successfuly on Unity 2021.1.28f1 & Unity 2020.1.9f1
    NOTE: I do not recommend building with LiveLink yet.

    Update 1̶2̶/̶1̶9̶/̶2̶0̶2̶3̶ 12/26/2023:
    Current Plan:
    • Release Dots Dynamic Bone (DDB) v0.9.8.0 - In Progress
      • Get Non-Physics DDB working with Entities 1.0.16 - Done
      • Some new changes:
        • New Systems For Resetting and Setting Transforms.
        • New workflow order to accommodate new entities workflow.
        • Helper structs and methods that mimic the important core aspects Unity.Animation had.
        • New Bone settings
        • Get Physics DDB working with Entities 1.0.16 & Physics 1.0.16 - In Progress
          • Get Natural Colliders Working - In Progress
            • Get Natural Colliders Working with DDB Physics. - Done
            • Get Natural Colliders With Default Physics - Done (Needs testing in Entities 1.1 & 1.2)
          • Get Preset Physics Colliders Working - Updated but Untested Due to lack of Use Case
      • Refactor/Simplify/Cleanup code & improve Burst performance - In Progress
    • Release DOTS Dynamic Bone (DDB) v0.9.8.1 - Coming Soon
      • Get DDB working with LatiosFramework Kinemation using Unity Transforms - Coming Soon
      • Get DDB working with LatiosFramework Kinemation using Unity Transforms & Physics - Coming Soon
      • Get DDB working with LatiosFramework Kinemation using Latios Transforms - Have Working Prototype.
      • Get DDB working with LatiosFramework Kinemation using Latios Transforms & Physics - Coming Soon.
     
    Last edited: Jan 15, 2024
    andreiagmu, Luxxuor and recursive like this.
  2. NT_Ninetails

    NT_Ninetails

    Joined:
    Jan 21, 2018
    Posts:
    195
    Update: I got DOTSDynamicBone to work with DOTS Physics Colliders! I just got it working so I need to play around with it a bit more to reduce the execution time of the system as well as add more support for other colliders.

    Test was performed with a static sphere and dynamic spheres that represent the tail bones. Once I get the system all fixed up and perform more tests I can provide more details cause my code is a mess right now :)

    upload_2021-11-11_13-16-36.png
     
    Last edited: Nov 12, 2021
    andreiagmu likes this.
  3. NT_Ninetails

    NT_Ninetails

    Joined:
    Jan 21, 2018
    Posts:
    195
    waiting in line still...
    upload_2021-11-13_10-36-28.png

    Also don't miss Unity's Black Friday sale!
     
    andreiagmu likes this.
  4. andreiagmu

    andreiagmu

    Joined:
    Feb 20, 2014
    Posts:
    175
    If it's gonna be like other assets I was waiting for release during this year (Rival DOTS Character Controller, DoozyUI v4), then I think Unity will take like 3 weeks after you submitted the asset, for it to become available in the store.
    It may still take a while... :confused:

    And thanks for the heads up about the Black Friday sale! :D
     
    Last edited: Nov 14, 2021
    NT_Ninetails likes this.
  5. NT_Ninetails

    NT_Ninetails

    Joined:
    Jan 21, 2018
    Posts:
    195
    I've been thinking of adding noise options for the Force and Gravity options.

    What do you think?
     
    andreiagmu likes this.
  6. NT_Ninetails

    NT_Ninetails

    Joined:
    Jan 21, 2018
    Posts:
    195
    I also just realized that if I store the values of the calculation positions during an animation cycle, I can theoretical output those values as an animation. If this is true then the tool can be used to create neat/realistic animations that can be exported as anim files or fbx files. I think that's pretty cool and plan on looking into that after the noise options with the Force and Gravity.

    Also I have V0.9.6.0 ready which includes the DOTSDynamicBoneCollider. There are 2 types of collisions: Natural and Preset Collisions.

    Natural Collisions are collisions that occur with any DOTS Physics Collider. since DOTS Physics Colliders are used, all DOTS Physics Colliders are supported but Mesh and ConvexMesh have pretty high performance costs (like always) so I would avoid using them when possible.

    Preset Collisions are just pre-set collisions. If you add a DOTSDynamicBoneCollider to an entity and add that collision to a DOTSDynamicBone Component then that is considered a preset collision. Currently only Spheres,Capsules, and Planes are supported. I can support more, I just haven't set up the math yet.

    Preset Collision is subject to change if I manage to get Natural Collision to perform faster than Preset Collisions. I'm thinking of starting a Dev-log to keep you all updated (let me know if you want that).
     
    Last edited: Nov 16, 2021
    andreiagmu likes this.
  7. razzraziel

    razzraziel

    Joined:
    Sep 13, 2018
    Posts:
    395
    A comparison between the popular dynamic bone asset and this would be great in terms of performance. I think everyone has it already :)
     
    Last edited: Nov 16, 2021
    andreiagmu likes this.
  8. NT_Ninetails

    NT_Ninetails

    Joined:
    Jan 21, 2018
    Posts:
    195
    yeah I plan on doing a performance tests when I get a performance testing environment setup. Currently I have a lot of safety checks, fullstacktraces,and backup debugging and more in my dev environment so I can't reliable perform fair tests in there.

    If you want, you can try to perform comparisons with the Demo version though the demo version is of an older build and may be missing some optimizations.
    https://github.com/Steven9Smith/DOTS-Dynamic-Bone-Demo

    once I finalize V0.9.6.1 I plan on updating the Demo version with the new optimizations.
     
    andreiagmu and razzraziel like this.
  9. NT_Ninetails

    NT_Ninetails

    Joined:
    Jan 21, 2018
    Posts:
    195
    So fun fact....I had Burst Compilation disabled this whole time (this explains the quick compile time lol). So after the 5 minute burst compilation I took a peak at the profiler.

    Here shows the time it took to complete Collision V1 Post Physics Job. The Collision V1 system utilized a burst compiled CollisionEvent system to populate the entity with DOTSDynamicBoneCollider_BufferElement elements. So the Collision V1 system really contained 2 jobs: One that ran in the FixedStepSimulationSystemGroup (It perform Scheduled the CollisionEvent job as well as updated the positions of the PhysicColliders) and another Job(s) after the TransformSystemGroup (the second Job(s) updated the bone and particles). Here's a picture of the second part of the job.

    upload_2021-11-22_20-22-34.png

    Here's an image of the first part of Collision V1 System:

    upload_2021-11-22_20-27-11.png

    So in this instance with 4 Nasuki models are used with the Collision V1 system. Those 4 models contained a total of 28 bones with physics colliders that were being modified by DOTS Physic Joint System (which is why I have to override the Transforms). the first Job took 0.105ms and the second job took 0.05ms with a total of 0.155ms. So this means in order to Update the Transforms, Deal with collision Events,and updating the DOTSDynamicBone and Particles data, took ~0.155ms....not bad.

    It worked and was pretty speedy so I was like cool, but I didn't like how the CollisionEvent job had to be on .Schedule instead of ScheduleParallel so I looked at another way to do it so I created the Collision V2 System. So using a ReadOnly version of the CollisionWorld I iterated through each particle (that had collision enabled) and performed a Distance Query and grabbed the closest collision. This took only 1 Job and didn't need to update any transforms and didn't even need the PhysicsCollider to be enabled (The only thing really required was the PhysicsCollider*). Here's a snapshot:

    upload_2021-11-22_20-35-10.png

    So just like before I used 4 Nasuki models. Those 4 models contained a total of 28 bones with physics colliders that were being modified by DOTS Physic Joint System but had a PhysicsExclude component on them (this made is so the tail movement didn't affect the parent in any way). So performing the Physics Collision and updating the DOTSDynamicBone and Particles took 0.049ms with one job using .ScheduleParallel().

    nice.

    I'm also in the process of redoing the DOTSEntityEditor and making that script's code available for everyone so you can see how some stuff needs to be handled. For example: if you want to disable a particle you have to call the Particle.Disable() method instead of setting disabled to true. stuff like that.

    after that I plan on finishing up the options that allow you to choose where the particles are recieveing updated information from like either from AnimatedLocalToWorld, LocalToWorld, or Translation&Rotation. Then I plan on working on a Recoding and fbx Export system for animations.
     
    andreiagmu and razzraziel like this.
  10. NT_Ninetails

    NT_Ninetails

    Joined:
    Jan 21, 2018
    Posts:
    195
    - Update 0.9.6.0.3 11/27/2021:
    I removed the first version of Collisions since I didn't think it made sense to use a CollisionEvent job to manually add the DOTSDynamicBoneCollisers when I created a better alternative. Not only did V1 take up extra memory, but it was also had a very specific setup and was honestly sorta annoying to deal with since you had to have physics enabled, AnimatedLocalToRoot overrides, and some other stuff. The current offical collision system is will be the V2 version which only requires that you add a PhysicsCollider to your bone....its so much easier and you can disable DOTS Physics on that bone and the collisions will still work (don't worry there's a exclude physics boolean value for each particle if you want to turn on and off physics calculations.).

    I added a new Component call DOTDynamicBoneIndependantMultipleComponent. This is a merging of the IndependantDOTSDynamicBoneComponent and the DOTSDynamicBonesComponent so you can put this on any Entity and have it handle multiple Bones. I also added a boolean value that when set to true, you can have the Entity handle multiple bones and particles from multiple RigComponents. This essentially gives you the ability to either have a single entity handle all DOTSDynamicBone entities or you can organize it into with different entities.

    Now you be wondering, "that's cool and all but isn't the Independent DOTSDynamicBone stuff not associated with ParallelSchedule()?". Yes, this is true for all versions before V0.9.6.0.3 however with V0.9.6.0.3 I added a "Link" tag that links RigCoomponent entities with their respective Independent DOTSDynamicBone Entity thus, each can write to their respective buffers with .ScheduleParallel() and Burst!

    Also, v0.9.6.0.3 is 100% Burst compatible! (At least no errors popped up when i compiled it with burst lol)

    Also, DOTSDynamicBonesComponent and the Independant DOTSDynamicBone Components support the V2 Collision System so now all components support the V2 Collision System.

    NOTE: I won't be updating the DOCS until this version is out in order to avoid confusion.
    NOTE NOTE: the package is almost there! (NOTE: the version for review is v0.9.5.6 and not v0.9.6.0.3)
    upload_2021-11-27_12-51-5.png
     
    Last edited: Nov 27, 2021
    andreiagmu likes this.
  11. razzraziel

    razzraziel

    Joined:
    Sep 13, 2018
    Posts:
    395
    That is a lot of notes :) How much is the price?
     
  12. NT_Ninetails

    NT_Ninetails

    Joined:
    Jan 21, 2018
    Posts:
    195
    upload_2021-12-2_9-20-42.png

    The initial pending beta release (v0.9.5.6) is $20 which includes the default updates systems.
    The available Components are the
    - DOTSDynamicBoneComponent (Single DynamicBone placed on specific Entity)
    - DOTSDynamicBonesComponent (Multiple DynamicBones placed on specific Entity)
    - IndependantDynamicBoneComponent (Single DynamicBone placed on any Entity)
    - DOTSDynamicBoneEntityEditScript (version 1 script that allows you to edit DOTSDynamicBone related data in real time)

    version 0.9.6.0.5 is $30 (with a 30% release discount for a week). This includes all the latest changes as of 12/2/2021 which include these changes:
    - added Preset Collision System
    - added Natural Collision System
    - Updated Docs
    - Updated Tutorials
    - Added samples
    - added DOTSDynamicBoneIndependantMultipleComponent (Multiple DynamicBones places on any Entity)
    - updated DOTSDynamicBoneEntityEditScript to v2 (Easier to work with)
    - added new Jobs for Collision processing
    - added Collision support for all DOTSDynamicBone Compoent types.
    - added Burst support for all Jobs excluding the Transform override system (going to work on making the Transform Override system burstable after this update)
    - added collision optimizations
    - removed some unnecessary data
    - fixed some mathematical calculations
    - fixed some glitches with some features
    - added some missing features

    NOTE: v0.9.6.0.5 should be one of the last releases before v1.0. This is because v0.9.6.0.5 has all the core features I believe the system should have. However, if you have a suggestion, please let me know. My earlier suggestions releating to noise and animation fbx exports I decided were not a Core feature since they can be done externally without any drawbacks. I tested attempted to make both those features but decided that since the calculations were done outside the DOTSDynamicBone Core systems, they would not fit with the DOTSDynamicBone Core systems.

    Also, don't forget that all DOTSDynamicBone data is editable at runtime. I even have a few public functions to make a few things easier. So please check out the Documentation page when everything is released and please ask questions, I don't mind answering them :)

    I am currently working on updating the Documentation page, samples, and tutorials.
     
    Last edited: Dec 2, 2021
    andreiagmu likes this.
  13. NT_Ninetails

    NT_Ninetails

    Joined:
    Jan 21, 2018
    Posts:
    195
    One thing I am having trouble with is finding more models that really showcase the DOTSDynamicBone systems and can be used in the samples. The Nasuki model provided by @andreiagmu provided is excellent at showcasing a lot of the functionally, I just need some models for other usecases and samples. If you have any models or suggestions please let me know. some of the things I looking for currently is a rope model, an animated quadraped, and maybe a tree.
     
    andreiagmu likes this.
  14. NT_Ninetails

    NT_Ninetails

    Joined:
    Jan 21, 2018
    Posts:
    195
    Got some Updates

    Bad News: Unity rejected the asset because I didn't add offline documentation. This is fair and all I need to do is resubmit with offline documentation....now I need to finish updating the documentation...

    Good News: as far as all my tests are concerned, I believe the Preset and Natural collision system is working. In Preset Collisions I added the ability to use either Unity.Physics colliders or some simple shapes (though I recommended using the Unity.Physics colliders). I was working on the Documentation and decided this feature needed to be added.... so now I'm back to working on the documentation.
     
    andreiagmu likes this.
  15. Sunstrace

    Sunstrace

    Joined:
    Dec 15, 2019
    Posts:
    40
    waiting to see this in store
     
  16. NT_Ninetails

    NT_Ninetails

    Joined:
    Jan 21, 2018
    Posts:
    195
    Update

    Sorry about not responding over the past week and a half. A bug came up during a build and I had to debug it however, due to the state of DOTS and the Animation package, I had a very difficult time debugging failed builds. After 4 days I finally I'm able to build in a normal scene, and a subscene. The culprit happened to be the Collider* parameter I stored in the Particle struct. Even though using a Collider* worked in the editor and normal builds, it just completly broke the subscene build. To remedy this was to use the Unity.Physics.PhysicsCollider instead which uses a BlobAssetReference to get the collider*. Now I am updating the docs, and verifying everything builds properly. If you want to know more check out this thread

    https://forum.unity.com/threads/ent...ld-in-unity-2021-1-28f1.1215783/#post-7760655
     
    andreiagmu likes this.
  17. NT_Ninetails

    NT_Ninetails

    Joined:
    Jan 21, 2018
    Posts:
    195
    Update 12/26/2021:
    - Updated some variable types to
    - Fixed an issue of IndependantDOTSDynamicBoneMultiple Component not updating the Unity.Animation.AnimatedLocalToRoot of 2 or more bones (I forgot to remove a break statement)
    - Tested Building some scenes with DOTSDynamicBone and DOTS Animation in scenes and sub-scenes successfuly on Unity 2021.1.28f1 & Unity 2020.1.9f1
    NOTE: I do not recommend building with LiveLink yet.
     
    andreiagmu likes this.
  18. NT_Ninetails

    NT_Ninetails

    Joined:
    Jan 21, 2018
    Posts:
    195
    Good News: the bug has been solved! So now I will update the doc with build information, make an offline version of the docs, and then send the package to Unity to be reviewed! :D
     
    Last edited: Dec 30, 2021
    hugokostic and andreiagmu like this.
  19. NT_Ninetails

    NT_Ninetails

    Joined:
    Jan 21, 2018
    Posts:
    195
    upload_2022-1-5_23-30-32.png

    DOTS Dynamic Bone is ready to be Published!
    For the first week of publishing the asset will be 30% off!

    DOTS Dynamic Bone is set to be Published at 9 PM GMT

    NOTE: DOTS Dynamic Bone works in the editor With versions of Unity up to 2021.1.28 and has been successfully Built on the latest DOTS supported Unity version 2020.3.25f1
     
    andreiagmu likes this.
  20. NT_Ninetails

    NT_Ninetails

    Joined:
    Jan 21, 2018
    Posts:
    195
  21. NT_Ninetails

    NT_Ninetails

    Joined:
    Jan 21, 2018
    Posts:
    195
    andreiagmu likes this.
  22. NT_Ninetails

    NT_Ninetails

    Joined:
    Jan 21, 2018
    Posts:
    195
    New Video released!
     
  23. NT_Ninetails

    NT_Ninetails

    Joined:
    Jan 21, 2018
    Posts:
    195
    With the official release of DOTS 1.0, DOTS Dynamic Bone V0.9.8.0 is in development However, with the Animation package still being worked on the new version will be a more bare bones approach due to the lack of standards. I will look through this forum post https://forum.unity.com/threads/dots-animation-options-wiki.1339196/ for some animation solutions and mostly likely add specific support for these projects separately.
     
  24. duckreaction

    duckreaction

    Joined:
    Mar 27, 2022
    Posts:
    2
    Hi there!
    We are looking for a spring bone plugin for ECS, does this plugin is still updated for the last version of unity?
     
  25. NT_Ninetails

    NT_Ninetails

    Joined:
    Jan 21, 2018
    Posts:
    195
    Not yet, still working on it.
     
  26. NT_Ninetails

    NT_Ninetails

    Joined:
    Jan 21, 2018
    Posts:
    195
    [Update]
    Just Confirmed that the LatiosFramework works with DOTSDynamicBones. I will be using this for testing and assiting in the further development of DOTSDynamicBone. After fixing up the code and updating some systems There will capatability with Unity Entities and LatiosFramework
    Currently working with Entities 1.0.16.
     
  27. NT_Ninetails

    NT_Ninetails

    Joined:
    Jan 21, 2018
    Posts:
    195
    [Update]
    DOTS Dynamic Bone works in Entities 1.0.16 & comes with some changes/improvements
    - DOTSDynamicBoneComponent, DOTSDynamicBonesComponent, IndependantDotsDynamicBone will be merged into a single Component.
    - The Entity that has the RigComponent will no longer contain the DOTSDynamicBone but a Buffer of entities that contain the information (this is how multiple DDBs and Independence is achieved (Note: these entities are Parented to the RigComponent Entity)).
    - Preset Collisions will be updated but may not be supported in the future due to lack of use case. It's essentially creating a seperate physics system that will only work a specific objects you set. For now I don't see a need for this when you can use the Unity Physics system (Natural Collision) and set the right Collision Filters.
    - Natural Collision has been updated and improved
    - 3 ways to use it:
    - With Physics Colliders (Does not take part in normal Unity Physics)
    - With Physics Colliders & Rigidbody (With a PysicsExcludeComponent which makes it not take part in Unity Physics)
    - With Physics Colliders & RigidBody & takes part of Unity Physics.

    Working on refactoring and improving code so sit tight, more news will be coming soon.

    If you have a use case or need to use the Preset Collision feature, let me know and I'll add it back.
     
    Last edited: Jan 15, 2024