Search Unity

  1. 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. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,114
    Glad to see this is still going.
     
    Venryx likes this.
  2. Skyblade

    Skyblade

    Joined:
    Nov 19, 2013
    Posts:
    74
    Looks very interesting! I want to make power shovel game, but faced some problems with proper arm physics.
    As I see, this engine can solve all my problems. Would like to buy it if price will be suitable for indie developer.
     
  3. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    241
    Hi Everyone,

    Thank you all for the support for APE in the past year. Sorry for the long wait without a targeted release date. Developing an advanced physics engine is not a small undertake and it took years of time. Still you were not sure if it's applicable to the games we love to make. We spent a lot of time testing APE with real game development (check out our other game projects developed with APE which will be coming soon). We prototyped various scenarios from rope, bridge, cars, robots to ragdoll, humanoid and galloping animals. The results were encouraging. Looks like it will be a new technology useful to a wide range of physics based games.

    I will work on a plan to release APE in the next few months. A feature list for APE 1.0 will be drafted soon.

    A.P.
     
    Last edited: Aug 25, 2015
    John-G, mcmorry, IronDuke and 2 others like this.
  4. IronDuke

    IronDuke

    Joined:
    May 13, 2014
    Posts:
    132
    One word...
    PAAARRRTYYYYYY!!!!

    --IronDuke
     
  5. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    241
    A tentative feature list for APE 1.0. Subject to change. Comments are welcomed.

    Cheers,
    A.P.

    ----

    APE 1.0 Feature List
    • Unity Versions Supported
      • Unity 4.6.x PRO
      • Unity 5.0.x
    • Target Platforms Supported
      • Windows x86, x64
      • Mac OSX x86
      • iOS Arm7, Arm64
    • Collision Shapes
      • Unity Box Collider
      • Unity Sphere Collider
      • Unity Capsule Collider
      • Unity or APE Cylinder Collider (analytical)
      • APE Cone Collider(analytical)
      • Unity Convex Mesh Collider (static and dynamic)
      • Unity Concave Mesh Collider (static and dynamic)
      • APE Compound Collider
    • Rigid Body
      • All collision shapes listed above
      • physics material
        • static and dynamic friction coefficients
        • restitution coefficient
      • Customizable Mass
      • Customizable MOI
      • Automatic MOI (based on analytical volume, shape and the mass)
      • Dynamic anchoring and unanchoring
    • Articulation
      • A tree structure consisted of one articulation base and a number of articulated links (loops can be formed using additional P2P joints)
      • Base can be anchored / unanchored dynamically
      • Physics material for base and links
        • static and dynamic friction coefficients
        • restitution coefficient
      • All collision shapes list above for base and links
      • Articulated link joint types
        • fixed (weld) (0 DOF)
        • hinge (1DOF rotation)
        • slider (prismatic) (1DOF translation)
        • ball in socket (3DOF rotation)
        • universal (2DOF rotation)
        • hinge on plane (1DOF rotation, 2DOF translation)
      • Per-DOF Joint Properties (accessible to inspector and scripts)
        • Position Motor
          • target position (dynamically changable)
          • max velocity (dynamically changable)
          • max force(dynamically changable)
        • Velocity Motor
          • target velocity (dynamically changable)
          • max force(dynamically changable)
        • Spring
          • stiffness constant (dynamically changable)
          • damping constant (dynamically changable)
          • neutral position (dynamically changable)
        • Joint limits
          • low and high positions (dynamically chanable)
          • max force (dynamically changable)
        • velocity sensor (Read-Only)
        • position sensor (Read-Only)
      • P2P Joint for loop forming
        • between Articulation and Rigid Body
        • between Articulations
    • Scripting APIs
      • Instantiate / destroy collision shapes
      • Instantiate / destroy articulation (base and links)
      • Instantiate / destroy rigid body
      • Update per-DOF articulation properties such as motor parameters
      • Ray casting
     
    Last edited: May 12, 2015
  6. Zeblote

    Zeblote

    Joined:
    Feb 8, 2013
    Posts:
    1,102
    Native plugins are supported by the personal edition, so no need for unity 5 pro
     
    100rub likes this.
  7. IronDuke

    IronDuke

    Joined:
    May 13, 2014
    Posts:
    132
    @Zeblote Ah, I had been wondering about that.
    @ArticulatedPhysics That list is looking wonderful. Really looking forward to this, if it doesn't blow the bottoms out of my pockets... :p
    Incidentally, will it have smooth sphere collisions and concave rigidbody mesh colliders? The first is important for pinball, like ramps and stuff, and the second for a space game. How else could one have accurate collisions inside a moving spacecraft? It's fine though if those don't come in the first release, because there's probably too much awesomeness in there already. ;)

    --IronDuke
     
  8. Zeblote

    Zeblote

    Joined:
    Feb 8, 2013
    Posts:
    1,102
    Build the walls out of box colliders parented together?
     
  9. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    241
    @IronDuke I'm not sure about Unity-5. Unity-4 Free works with native plugin on Windows, but not on Mac. Also you probably need iOS pro if you want deploy to iOS platforms. To make it simple I will just support Unity Pro officially. When more testing results come back maybe we can relax that requirements.
     
  10. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    241
    Yes, APE supports "compound" colliders that is a collection of primitive collision shapes such as boxes, spheres, convex hull, ..., etc. You can basically "decompose" a concave shape into multiple convex shapes and make a compound collider out of them.

    If all you need is static concave colliders (colliders such as environment and terrain that don't move) APE does support that. Although static concave colliders don't work as smooth as convex colliders or primitive colliders in general. That's a common tradeoff not only in APE, but also in all physics engines.
     
  11. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    241
    @IronDuke : APE does support smooth sphere collider, it's basically an analytical sphere model instead of a "convex mesh approximation" of a sphere. Also APE supports analytical Cylinder colliders which was not supported by PhysX at least in Unity 4.x. Also analytical Cone colliders that are not supported by standard Unity physics. We may add more collision shapes down the road.

     
  12. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,626
    No planned android support?!? Bummer been watching this a while - I hope down the road you get it stable on android!
     
  13. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    241
    APE collision shapes for rigid bodies:


    APE collision shapes for articulated links. Note that there is a slider joint between the two stacked umbrellas. All together there were 3 complex articulations collapsed into each other.

     
    John-G likes this.
  14. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    241
    Android deserves its place on the to be supported platform roadmap for sure. Need cross-compile the C++ engine for Android and do a LOT of testing. I just have my hands tied up for too many things at the moment.
     
    MD_Reptile likes this.
  15. Zeblote

    Zeblote

    Joined:
    Feb 8, 2013
    Posts:
    1,102
    On unity 4 you could use certain workarounds to make plugins work on windows, not sure about mac. On unity 5 all pro restrictions have been removed - it's literally about the dark editor skin and the splash screen now. Plugins should work fine on all platforms. :)
     
    100rub likes this.
  16. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    241
    Superb news that is!
     
  17. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    241
    Recently integrated standing animation with the rest walk/run/jumping gaits which are all physically simulated by APE.

     
  18. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,626
    Dang, video is still being processed. I'll check it out later!
     
  19. IronDuke

    IronDuke

    Joined:
    May 13, 2014
    Posts:
    132
    Sorry for not posting sooner, I'm usually unavailable over weekends.

    That might work if the interiors of my spacecraft weren't going to be mostly cylindrical. Also, there are some exterior areas that cannot have accurate collisions with a convex collider.
    Screenshot: Rear Right Top.png

    The area inside the curved wings and inside the big dome-shaped engine area (it's actually a heat-sink) can't really be done by either a convex mesh or compound primitives or even compound convex mesh colliders. Also, the interior is in fact going to have a large number of cylindrical crawl spaces, basically tubes. Those won't work either.
    I'm really at a loss, and I don't know of any way of modeling the collisions without concave rigidbody mesh colliders, unless I were to code my own, but i don't know how, and learning would take forever.

    --IronDuke

    P.S. Yes, the ship is a prototype. Just thought I'd save the trouble of asking. :p
     
  20. Zeblote

    Zeblote

    Joined:
    Feb 8, 2013
    Posts:
    1,102
    Do you really need completely accurate collision for the things on the side?

    It looks like they have no real purpose and you can easily approximate them with a few boxes/capsules.
     
  21. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,626
    A whole pile of basic colliders is more efficient than mesh colliders (at least that's what everybody always told me) - so like ten or twenty primitive colliders all over the ship that approximate the shape might be perfromance-wise the best choice.
     
  22. IronDuke

    IronDuke

    Joined:
    May 13, 2014
    Posts:
    132
    Yes I do. The weapons are slung in those curving wings, because that way the ship's hull can protect them but there is plenty of room for modular design of the weapons, stuff like pylons, external upgrades like a more powerful cryo cooling system, goodies like that. Also,shots and possibly even fighters are going to be flying through those wings, and shots will especially be flying into that engine area. I may also have forgotten to mention that I'm planning on using mesh deformation for the damage model, which will require as much accuracy as can possibly be had.
    Now, while poking around the asset store, I found this: https://www.assetstore.unity3d.com/en/#!/content/4596
    Has anyone tried it? It's forty-five dollars, which is something of a bundle for me, so I want to know if it works for other people. Also, @ArticulatedPhysics, do you think it would be compatible with APE?
    BTW, nice video; I've always liked chickens.

    --IronDuke
     
  23. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,626
    So I guess the question is, will APE support its own mesh collider system? One hopefully more performance happy than the unity one.
     
  24. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    241
    Sorry about the AOP (ahead of time posting) :) Tought Youtube would be faster than my typing. Now it's available :p
     
  25. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    241
    @IronDuke: I actually tested the "concave collider" asset with APE and they work together easily because APE can suck in the Unity collider components spit out by the "concave collider" tool and build a "compound shape" out of them. That is an offline convex decomposition tool that saves you sometime if you don't want to manually create the compound approximation of the concave shape yourself. However there is a performance cost you usually pay for the often redundant decomposition result from an algorithm instead of a person.

     
  26. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    241
    Nice ship prototype, Duke! I always dream to create a game sometime that robots running/hovering on top of flying/moving platform and fighting with each other while overcoming gravity and the wiggling of the platform itself.

    I agree with others though you probably don't want to create a huge "concave" mesh collider for the whole ship. For such a high poly concave mesh model it takes you a LOT of cpu to process the concave geometry intersection. You want to use the simplest primitive parts to model the hollow interior area such as boxes/plates. You can use sphere/capsule kind of "round" shape to model the crawler's feet so that when they crawl inside the "tube" it still feels smooth. It probably takes a lot of time tuning to get the optimal decomposition of the model, but it's just craftsmanship.

    I could add a concave mesh collision algorithm for dynamic objects to APE, but dynamic concave has a lot of problems and pitfalls that I'm skeptical how much advantage it brings to you over a manually crafted convex decomposition except the part it "saves" you sometime modeling.

     
  27. IronDuke

    IronDuke

    Joined:
    May 13, 2014
    Posts:
    132
    I looked at it more closely, and it indeed simply generates multiple convex colliders in the editor. I'm afraid that won't work for real-time mesh deformation to simulate the damage model. :( I probably should have mentioned that in the first place.
    One thing I thought of would be using the visible mesh as a collision mesh, but I have no idea how one would go about that. I don't even know if one could do raycasts against visible geometry instead of a collider.

    --IronDuke
     
  28. IronDuke

    IronDuke

    Joined:
    May 13, 2014
    Posts:
    132
    Ninja'd! :p
    Well, before I switched my project to Unity 5, I never had any performance problems related to the mesh collider. I am of course not going to have the same exact level of detail that goes into the visible mesh, but I do need a high amount of accuracy. For optimization, of course, I could simply use concave colliders for the wings and engine area, and convex for the rest of the hull; it's just, on many occasions, the player will be interacting very closely with ship hulls in the game. He may even take some spacewalks to board enemy ships, and it probably wouldn't do to have him floating on a collider a good meter above the visible mesh. :eek:
    Also, the weapons in the game are very much precision weapons, and it would defeat the purpose to have imprecise colliders. The concave colliders do bring some advantage; I've been working on/ modifying/playing many space sims for almost a decade, and the concave colliders really do make a difference. I'm basically a hard-core space sim fan, who very strangely has not played Kerbal Space Program. Weird, right?

    --IronDuke
     
  29. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    241
    Hey IronDuke,

    I hear you and I'm convinced that dynamic concave triangle mesh collider support can be useful. So I just added this feature to APE. Here is an early demo:



    Hope this helps your spaceship build.

    A.P.

     
    Last edited: May 12, 2015
    IronDuke and John-G like this.
  30. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    241
    Concave triangle mesh collider for dynamic/moving objects support is officially added to the planned APE 1.0 feature list.

    Here is a more complex test case of interaction among articulated machine, long rods and a half tube concave mesh collision shape:

     
    IronDuke likes this.
  31. Zeblote

    Zeblote

    Joined:
    Feb 8, 2013
    Posts:
    1,102
    How well would ape work in a multiplayer game? Assuming two clients each control a physics based character and bump into each other.
     
  32. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    241
    APE focuses mainly on the dynamics simulation of articulated structure itself. Synchronizing multiple simulation across network need to be handled by an upper layer algorithm than APE. Typical ways to do it are:

    1. Server authoritative and clients as input and rendering devices. In this case you just need to run APE on the server. Most MMORPG does this.

    2. Distributed Physics. Each client runs its own simulation / APE. The networking layer need to sync the two parallel simulated world and resolve the discrepancy. It's pretty complex. Reference to the following article to get a taste.

    http://gamasutra.com/view/feature/173977/scaling_a_physics_engine_to_.php?print=1.

    One day when I'm completely done with APE maybe I will write a networked physics engine on top of APE.
     
    Hayaweh likes this.
  33. IronDuke

    IronDuke

    Joined:
    May 13, 2014
    Posts:
    132
    Holy simpering catfish, you work fast! I know you said early demo, but still... that's fast!
    Love those videos, they're exactly what I meant. Thank you so much for taking my request into consideration. I bet that if I ever have any future complaints, you could remind me of this and I'll probably shut up super fast. ;)
    Incidentally, that first video made me think of a hamster ball. Now how much fun would a physics based hamster ball game be? :p Probably more fun than the roll-the-ball games out there already...

    --IronDuke
     
  34. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    241
  35. IronDuke

    IronDuke

    Joined:
    May 13, 2014
    Posts:
    132
    Awesome, and your chicken's walk animation is somehow rather amusing...
    That raptor's walking was pretty good though.

    --IronDuke
     
  36. Skyblade

    Skyblade

    Joined:
    Nov 19, 2013
    Posts:
    74
    I think we can simulate not just desired position of the jaw, but also a motor operation duration?
     
  37. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    241
    I think what you need is to control the duration it takes for the motor to rotate to the target position, right ? If so, that's simply the motor velocity you want to control. Basically there are two types motor supported currently: 1. position motor: it allow you to specify the target position/angle and the max velocity to rotate to the target 2. velocity motor: it allows you to specify a constant velocity the motor attempts to maintain and a max torque the motor exerts in that effort.

    Hope this helps.
     
    Skyblade likes this.
  38. Skyblade

    Skyblade

    Joined:
    Nov 19, 2013
    Posts:
    74
    Yes, this is exactly what I need. Looking forward to release!
     
  39. XR-DEV-ITK

    XR-DEV-ITK

    Joined:
    Apr 9, 2015
    Posts:
    3
    I want it, i need it. I have to build a simulation of a highly complex robot.
    But I am seriously doubtful about the release date. It sounds a bit like "it's finished when it's done" and it sounds like it will never be completly done.
     
  40. istavang

    istavang

    Joined:
    Jan 17, 2015
    Posts:
    19
    Advice: Start sell a beta version :)
     
  41. macdude2

    macdude2

    Joined:
    Sep 22, 2010
    Posts:
    685
    Any chance this will work on iOS?
     
  42. looki666

    looki666

    Joined:
    Sep 5, 2013
    Posts:
    79
    Will buy this no mater what it will cost :)!!!!!!!!!!!!!!!!!!!!!!
     
  43. Venryx

    Venryx

    Joined:
    Sep 25, 2012
    Posts:
    444
    $15,000
     
  44. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    Is this still in development?
     
    Skyblade likes this.
  45. Skyblade

    Skyblade

    Joined:
    Nov 19, 2013
    Posts:
    74
    Yes, how it is going?
     
  46. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    241
    it works on iOS
     
  47. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    241
    A medieval style cross bow built with APE utilizing 7 hinge joints, joint limits and position motors.

    https://drive.google.com/open?id=0BwboCvm6PSvBMzctT2JxWDlBT28

    Sorry for the delay in the release. We are under resource and it still need a few important features. But it is getting stronger little by little ...
     
  48. egleiser

    egleiser

    Joined:
    Aug 9, 2015
    Posts:
    1
    I need this in my life so badly! I would love to test it out too since we are putting joints in a bit of an odd situation. Would certainly make my physX nightmare go away. Only so much can be done with the current configurable joints in unity. Our game is all about ropes dragging rigidbodies underwater. On top of that, these ropes are attached to rigidbodies themselves. And making a stable combat system with these joints has been next to impossible. We can get things somewhat stable, but there is still a little bit of jitter with sharp turns and sudden stops (no mass ratio was able to correct this). I'm also on a tight deadline as we need to pitch our game ASAP. Totally want to grab a copy as soon as possible even if it's not perfect. The ability to rotate an entire physics space or just do so with parenting would be awesome for a 2.5D game. Especially if you can warp an axis of simulation along a spline. Hopefully PS4 and XBOX One support will come eventually. Maybe we can even provide valuable testing data from these platforms. Looking forwards to this release! Keep us updated!
     
  49. startleworks

    startleworks

    Joined:
    Jun 8, 2013
    Posts:
    34
    Can't wait to see this released, my game needs it like I need air. :(
     
    Skyblade and egleiser like this.
  50. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    241
    Just want to give an update that APE development is under good progress. We just implemented the Collider/Trigger C# APIs that parallel the functions of default Unity Collider/Trigger APIs. You can basically define the following methods in your MonoBehavior to capture various collision/trigger events:

    public void OnTntCollisionEnter(Collision collision);
    public void OnTntCollisionStay(Collision collision);
    public void OnTntCollisionExit(Collision collision);
    public void OnTntTriggerEnter(GameObject go);
    public void OnTntTriggerStay(GameObject go);
    public void OnTntTriggerExit(GameObject go);
     
    startleworks likes this.
unityunity