Search Unity

  1. Dismiss Notice
  2. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  3. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  4. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Assets APE - DeepMotion Avatar Physics Engine for Robust Joints and Powerful Motors

Discussion in 'Works In Progress' started by DeepMotionPhysics, Jul 31, 2014.

  1. IronDuke

    IronDuke

    Joined:
    May 13, 2014
    Posts:
    132
    Awesome!
    I was thinking of asking for an update, but decided against it, figuring that you were working as hard as you could. Glad to see I was right. :)
    Also, why Tnt? Is that just some obsession with exploding things or is it something else?

    --IronDuke
     
  2. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    243
    it's just a short hand prefix for our API. Tnt sounds powerful
     
  3. eaclou

    eaclou

    Joined:
    Mar 17, 2015
    Posts:
    53
    Just wanted to pop in and say keep up the good work! I'm extremely interested in this asset, as I'm working on a project with articulated creatures, and the deeper I get into Unity 5's PhysX 3.3 (heck, don't even need to go that deep) the more apparent it becomes that the standard PhysX library just isn't going to cut it. (even ignoring the bugs)

    Do you have any plans for a Function like PhysX's AddForce() and AddForceAtPosition()? (right now I'm using those to implement a custom buoyancy / underwater model). With something like that, and access to source code (in case I run into a critical limitation down the line and need a custom fix/extension) I'm a guaranteed sale.

    If you decide to do any Beta testing, I would be very interested in participating.
     
  4. JJLLceline

    JJLLceline

    Joined:
    Feb 17, 2015
    Posts:
    1
    Hi,

    This is exactly i am looking for! I am doing in robotics and we are designing a tool in unity to help user design robots. As you pointed it out in the post, the physics engine in unity is just not strong enough to support any complicated structure, which extremely limits the amount of robots we can design. I am very interested in your engine and would like to be a tester if possible. Please keep us updated. Great work! Thanks
     
  5. IronDuke

    IronDuke

    Joined:
    May 13, 2014
    Posts:
    132
    Lol, good one!
    Keep up the good work!:)
    ...
    And what eaclou said about adding forces - I'm using them for thrusters on the spacecraft.:cool:

    --IronDuke
     
  6. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    243
    Hear hear. We'll add equivalent to the following C# APIs:
    - AddForce/AddRelativeForce
    - AddTorque/AddRelativeForce
    - AddForceAtPosition
     
    Hayaweh likes this.
  7. IronDuke

    IronDuke

    Joined:
    May 13, 2014
    Posts:
    132
    Fixed that for you.;)

    --IronDuke
     
  8. Hayaweh

    Hayaweh

    Joined:
    Oct 21, 2015
    Posts:
    9
    Hi,

    This is some incredible work and it feels good to see an active project about this!
    I am a developper that worked with UE4 for the past 2 years and spent an hilariously ridiculous time fighting against PhysX and it's junk joints...

    Thus I am really interested in this project and hope to see a beta/testing/release state in a near future! :D
    The feature list for 1.0 is really impressive and I love the fact that it could allow for concave colliders ~

    I hope that we could get our hand on this quite soon as.. Well.. Physics is.. Important for our project! :)
    (have you ever tried to make a 0DOF physics joint between 2 objects in PhysX?... Hahaha. Have fun there :') )

    I am really looking forward to using your systems.

    Good luck for the continuous development of your APE. It rocks! :)
     
  9. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    243
    Thank you for the support. Springy "fixed" joint has its use cases, it's a P2P spring joint to be more accurate and APE offers that option too. However what makes APE unique is that we want to give you the capability to stay 100% "rigid" where you want it. Alternatively, you can also implement "0DOF" between two bodies by adding them into the same tntCompoundCollider and treat them as one single rigid body. The advantage of using an actual "fixed"/0-DOF joint is that we can read out the joint reaction force feedback so that you will know the amount of stress induced by external forces, contacts or motors at the joints.

     
  10. unityuser94

    unityuser94

    Joined:
    Mar 29, 2013
    Posts:
    39
    Hello, this looks extremely useful. I am creating a modular spaceship/building game, and would at some point like to add joints like these; the phys-x joints do not work very well.

    Some questions:
    How well do the compound colliders work, would they be able to handle multiple 1,000+ gameobjects with simple mesh or primitive colliers?
    Is it possible to manually set the inertia tensor and center of mass (without weird behavior)? Currently unity does not like a center of mass that is different from the gameobjects world space position.
    How well does APC handle collisions of very large masses with small masses?

    This looks extremely well done, looking forward to release!
     
  11. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    243
    The joint reaction force sensor is implemented for APE.

    The following is a quick demo of joint reaction force sensors with a motorized robotic arm. As we can see the harder we drag the arm with mouse spring the higher the joint reaction force ("applied impulse") is read from the sensor. When the arm is paused the amount of joint reaction force decreases as we go from the inner joint to the outer joint which makes sense because the joint closer to the anchor point endures bigger stretching force than the joints further away the anchor point.

    The joint reaction sensor fields are memory mapped to the engine so C# can directly read the sensor values in real-time from the m_feedback property under tntLink without incurring any pInvoke overhead.

    Applications of such sensors in game can be physics based joint damage system for characters or machines.

    https://drive.google.com/file/d/0BwboCvm6PSvBVlFTdkREclFUX00/view?usp=sharing
     
  12. cbethax

    cbethax

    Joined:
    Dec 1, 2015
    Posts:
    5
    HI, how's APE going? I stumbled on this thread while looking for a solution for Unity's terrible joints.
     
  13. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    243
    APE is going well. We just added Unity style force APIs to APE so that custom force elements/impulse can be easily added to APE simulated bodies or mechanisms.

    tntRigidBody and tntLink now have the following functions for adding force to them:
    - public void AddForce(Vector3 force, ForceMode mode = ForceMode.Force)
    Note: force is in world space, for mode please see below.
    - public void AddForceAtPosition(Vector3 force, Vector3 position, ForceMode mode = ForceMode.Force)
    Note: force is in world space, position is in world space
    - public void AddRelativeForce(Vector3 force, ForceMode mode = ForceMode.Force)
    Note: force is in local space
    - public void AddRelativeTorque(Vector3 torque, ForceMode mode = ForceMode.Force)
    Note: torque is in local space
    - public void AddTorque(Vector3 torque, ForceMode mode = ForceMode.Force)
    Note: torque is in world space
    - public void AddExplosionForce(float explosionForce, Vector3 explosionPosition, float explosionRadius, float upwardsModifier = 0.0f, ForceMode mode = ForceMode.Force)
    Note: explosionPosition is in world space
    upwardsModifier :
    By default, the direction of the force is the line going from the explosion centre to the rigidbody's centre of mass. If you pass a non-zero value for the upwardsModifier parameter, the direction will be modified by subtracting that value from the Y component of the centre point. For example, if you pass a value of 2.0 for upwardsModifier, the explosion will appear to be centred 2.0 units below its actual position for purposes of calculating the force direction (ie, the centre and the radius of effect are not modified). Using this parameter, you can easily make the explosion appear to throw objects up into the air,which often gives a more dramatic effect than a simple outward force.
    ForceMode
    *Force : Add a continuous force to the rigidbody/link, using its mass.

    *Acceleration : Add a continuous acceleration to the rigidbody/link, ignoring its mass. NOT FULLY IMPLEMENTED! You can now only use this for AddForce() and AddRelativeForce()
    *Impulse : Add an instant force impulse to the rigidbody/link, using its mass.
    *VelocityChange : Add an instant velocity change to the rigidbody/link, ignoring its mass. NOT FULLY IMPLEMENTED! You can now only use this for AddForce() and AddRelativeForce()
     
  14. ExtraAmmo

    ExtraAmmo

    Joined:
    Mar 12, 2015
    Posts:
    11
    I've been working on a mech building game for the past year and this would be amazing to have. It's hard to have stable physical walking mechs when everything is so springy and unpredictable.
     
  15. cbethax

    cbethax

    Joined:
    Dec 1, 2015
    Posts:
    5
    Yeah, I'm trying to make my own Inline 4 (car engine) by actually making the pistons push the crankshaft, but you can imagine what happens when the crankshaft has too much angular resistance due to vehicle load.
    @ArticulatedPhysics can you give an ETA? 1 week, 1 month, 1 year? Will it be accessible to the hobby user, or is it targeted at serious game dev studios (i.e. is it gonna be around the $100 mark or $1000 mark?)
     
  16. IronDuke

    IronDuke

    Joined:
    May 13, 2014
    Posts:
    132
    I'll add my question to the procession...
    Will we be able to perform raycasts, spherecasts, and all that stuff like normal? Or will you have to implement that?
    I don't remember that being discussed already, but my number one talent (after being a pain in the butt) is somehow missing important things...:oops:

    --IronDuke
     
  17. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    243
    Sure, we recently implemented the following RayCast API roughly following the Unity/PhysX's raycast API.

    public bool Raycast(Vector3 from, Vector3 direction, float maxDistance, int layerMask, QueryTriggerInteraction triggerInteraction,
    out CTntRayHitInfohitInfo)

    public struct CTntRayHitInfo
    {
    public Vector3 baryCentricCoord;
    public float distance;
    public Vector2 lightmapCoord;
    public Vector3 normal;
    public Vector3 point;
    public Vector2 textureCoord;
    public GameObject gameObject;
    public int triangleIndex;
    public IntPtr hitBody;
    public IntPtr hitBase;
    public in thitLinkIndex;
    }

    public enum QueryTriggerInteraction
    {
    UseGlobal,
    Ignore,
    Collide
    }

    We don't have sphere cast implemented although it's pretty easy to add if priority is there. There are many features we added recently to APE that we have no time to document yet. Will try to put together some documents when we have the time.
     
  18. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    243
    Sorry I can't give definitive ETA. But we will definitely release some version next year, as early as we can. We love physics based games and our dream is to help more developers create awesome physics based games. So we will consider the needs for both indies and AAA studios.
     
  19. IronDuke

    IronDuke

    Joined:
    May 13, 2014
    Posts:
    132
    Awesome with the raycasts! I can use much lazors! :cool:
    Also I'm fine with however long it takes to release; I've been testing my damage model on non-rigidbody objects and haven't gotten it quite working yet. I won't be needing the concave colliders for a while yet.
    Other people might be whiny though...;)

    --IronDuke
     
  20. GiuPor

    GiuPor

    Joined:
    May 15, 2013
    Posts:
    7
    GREAT! I can't wait...
     
  21. ExtraAmmo

    ExtraAmmo

    Joined:
    Mar 12, 2015
    Posts:
    11
    I greatly desire this.
     
  22. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    243
    If you think APE can only be used to simulate machines, think again:
    https://drive.google.com/open?id=0BwboCvm6PSvBeTEwSDN0N3lGX2s

    The cobra and the towers in the video are all created with APE joints. The Cobra moves by the friction between its body segments and the ground like how a real snake does.

    What's more, we are preparing for a limited beta test of APE soon ! Stay tuned.
     
    Last edited: Feb 26, 2016
    RatherGood and IronDuke like this.
  23. GiuPor

    GiuPor

    Joined:
    May 15, 2013
    Posts:
    7
    WOW! there is a huge potential.
     
  24. IronDuke

    IronDuke

    Joined:
    May 13, 2014
    Posts:
    132
    Jghar ethgnnnn dbanoguuuuuuuuuuh!
    *Coughs*
    Sorry, that awesomeness removed my linguistic abilities.

    Something I'm planning to use APE for is the persons in my space game. I want them to be completely physics based, so that, in zero-g, bullet impacts, pushing a wall with an arm, curling up, even waving a hand all have effects on the person.
    Just imagine being able to turn a little to the left by swinging your arm right! Other goodies also would result.
    I can't wait to give it a shot!

    --IronDuke
     
  25. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    243
    Don't know how many of you guys are going to GDC. We will be there to do some meet-up for APE demo and physics game chat. More information will be released soon...
     
  26. eaclou

    eaclou

    Joined:
    Mar 17, 2015
    Posts:
    53
    Looks great!

    I'd love to hear what kind of control scheme you were using to control the joint motors on the cobra in the latest video if you're able to speak about it.

    Looking forward to hearing more.
     
  27. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    243
    Sure, at the high level it's WASD based steering for the overall movement. One key for raising up the head and one key for releasing the head pecking attacks. The locomotion on the body segments are powered by motors on ball joints. Motors on each segment have a small phase shift from the previous segment to emulate the crawling movement of real snake. It's made possible by APE because we handle actuated many-joints articulated creature in a very robust way.

     
  28. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    243
    Hi All,

    Here is our official product page. Follow us for the latest APEngine updates.

    deepmotion.com/avatar
     
    Last edited: Dec 7, 2017
  29. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,242
    Hey, I'm coming to GDC, would love to join :)
     
  30. macdude2

    macdude2

    Joined:
    Sep 22, 2010
    Posts:
    685
    Very curious about the backend implementation of your system. I assume its fundamentally different than physx? Is it verlet integration or something like that? Really curious why yours is so stable and what tradeoffs it has.
     
  31. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    8,298
    Hey... @ArticulatedPhysics great looking stuff! I heard from friend, that I know you. You worked on SWC, yes?
     
  32. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    243
    Haha, feel free to drop me a message at the INBOX if you know me :) May the force be with you, and APEngine !

     
  33. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    243
    Great Peter, we will twit our location during the conference and see you there!

     
  34. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    243
    Right it is fundamentally different from PhysX and designed for articulated rigid body at its core. Integration method definitely helps in stability in general, but more for forward dynamics than joint solving.

     
  35. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    243
    Last edited: Dec 7, 2017
  36. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    243
    Last edited: Dec 7, 2017
  37. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    243
    Last edited: Dec 7, 2017
  38. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    The comparison isn't really correct. It doesn't make sense to compare MuJoCo (Featherstone) with game physics engines (sequential impulse solvers) as their purposes are quite different.
    Havok, PhysX and Bullet, all have special features to deal with articulated bodies. In PhysX it's Articulations (another Featherstone), in Bullet it's MultiBody (Featherstone again), in Havok it's ConstraintChains (full-matrix solver, most likely Conjugate Gradient). Why game engines like Unity or UE4 don't use them, that's different question.
    Anyways, it would be more interesting to see the comparison of comparable things. Otherwise it looks a little bit unfair :)
    And sure we want to see APE (most likely Featherstone) in this comparison too :)
     
  39. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    243
    DeepMotion Avatar is here!
    As Avatar Physics Engine users, many of you are aware of our love for interactive experiences and all things physics. And, as a continuation of this passion, we are proud to invite you to participate in the closed alpha of DeepMotion Avatar!

    DeepMotion Avatar is a physics-based character engine designed to replace traditional keyframe animations with lifelike simulations. Reduce the cost of producing complex animations using our self-balancing, autonomous character rigs, and soft body simulation. Optimize real-world machinery by running articulated physics-based simulations and take VR to the next level using 3 point tracked, full body avatars.



    Avatar Physics
    deepmotion.com/avatar
     
    Last edited: Dec 7, 2017
    John-G and Venryx like this.
  40. deathleppard

    deathleppard

    Joined:
    Jun 20, 2013
    Posts:
    1
    Looking forward to trying this, been involved in real-time engineering/robotics simulation in the past and looking in to building a system for small bespoke simulations and this should help a lot as PhysX is really not up to the task compared to some of the more advanced physics engines for simulation Vortex/Algoryx etc.
     
  41. Zeblote

    Zeblote

    Joined:
    Feb 8, 2013
    Posts:
    1,102
    That video really needs a performance comparison too, for example 1000 physx hinges vs 1000 ape hinges :D
     
    Venryx likes this.
  42. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    243
    If someone builds an interesting mechanism of 1K hinges for me we'd love to give it a try :)

    The following Tower Crane demo simulated by APEngine has 160+ DOF in the build, every chain segment is a collidable rigid body. Try coil up a PhysX simulated rigid body chain with a heavy cargo at the end you will see the difference :) We will reveal more DEMOs over GDC next week and welcome to come by and experience yourself.

    https://drive.google.com/file/d/0BwboCvm6PSvBZF9Xek11dVBXczg/view?usp=sharing

    Avatar Physics
    deepmotion.com/avatar
     
    Last edited: Dec 7, 2017
  43. macdude2

    macdude2

    Joined:
    Sep 22, 2010
    Posts:
    685
    I'm extremely excited about this ability. Was thinking I'd have to build my own verlet system to simulate proper ropes and pulleys, but it seems APE should save from needing to do this!
     
  44. Hayaweh

    Hayaweh

    Joined:
    Oct 21, 2015
    Posts:
    9
    Well. One of the first thing that I was thinking of doing is to try to finally create that physically based tank that I tried to create in UE4 with PhysX... :p
    Which involves quite a lot of.. Well. hinges. :D
    I would be pleased to give it a try with fully physicallized tracks, suspensions and turret/gun. (could be interesting to see how well it can be driven ^^)
     
  45. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    243
    Last edited: Dec 7, 2017
  46. Zeblote

    Zeblote

    Joined:
    Feb 8, 2013
    Posts:
    1,102
    Maybe a tank with chains? One tank is boring, so have a 10 player tank race / obstacle course :D
     
    Hayaweh likes this.
  47. ElectroMantis

    ElectroMantis

    Joined:
    Sep 15, 2013
    Posts:
    78
    As someone who is very frustrated with exploding Physx joints (especially in rope simulations), this looks absolutely incredible.
     
  48. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    243
    Sounds really exciting !

    Avatar Physics
    deepmotion.com/avatar

     
    Last edited: Dec 7, 2017
    Hayaweh likes this.
  49. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    243
    A quick search on youtube turned up the following Algoryx crane demo. It looks like this particular demo is using volume-less ropes instead or rigid-body ropes which is not exactly comparable to the APE crane demo above.



    APEngine does provide an ultra-cheap "volume-less/collision-less" rope constraint as well and it's basically a pair of force elements that enforce a distance constraint. It's so light-weight that you can employ a LOT of them without any performance hit.

    Avatar Physics
    deepmotion.com/avatar
     
    Last edited: Dec 7, 2017
  50. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    243
    This is a quick demo of the "spring rope" that APEngine supports as well. If all you need is collision-less spring ropes like this APEngine can support hundreds of them

    https://drive.google.com/file/d/0BwboCvm6PSvBU05NNVVEV2NubWs/view?usp=sharing

    Avatar Physics
    deepmotion.com/avatar
     
    Last edited: Dec 7, 2017
unityunity