Search Unity

Want Your Joints To Be More Solid?

Discussion in 'Physics' started by BillyBobBeavis, Dec 15, 2018.

  1. BillyBobBeavis

    BillyBobBeavis

    Joined:
    Oct 13, 2018
    Posts:
    97
    I have been pouring over forum posts these last few weeks trying to figure out how to make joints seem more solid. I have looked at dozens of posts on the topic. In not one post did anyone ever mention that lowering the mass of objects and forces in the game world, if feasible, would make joints more solid in proportion to the reduction of mass. Maybe this is obvious to some Unity veterans but many of the replies in the posts I read were from veterans. I spent dozens of hours experimenting with joints to try to make them seem more solid before I realized I could just lower masses. I appreciate all the info people have shared with me so I'm just letting people know this in case it will help.
     
    SparrowGS likes this.
  2. Probably because it's a hack and a very bad one since usually it affects all the other aspects of any physics calculations involving these objects. :) But glad it works out for you.
     
    SparrowGS likes this.
  3. BillyBobBeavis

    BillyBobBeavis

    Joined:
    Oct 13, 2018
    Posts:
    97
    Why would changing masses be a hack? More likely, the solution just didn't cross all of those poster's minds. If the core of your game mechanics is the connection of objects through solid joints, lowering masses might work quite well. It's probably better than messing around with the solvers, which is the advice I saw given in a couple posts.
     
    Last edited: Dec 15, 2018
  4. Well, because it's a value used relatively to other objects' value. So if you change two objects to make their joint more stable and these parts interact (collide for example) with other objects, your collisions will be off, since the mass is part of that calculation (heavier objects have bigger impact on lighter objects and vice versa). So you will need to change those objects as well and you either find all of the objects which interacts and change their mass proportionally or your simulation will be off somewhere.
    Now, it may not affect your case, because you don't really use this value for anything, or you're working on a smaller simulation where you don't have that many objects. But ultimately changing these values is a hack, which can and eventually will affect more actors than you initially set.

    I really doubt that this solution didn't come up once in the past many years of Unity physics. :)
     
    DaveBars and SparrowGS like this.
  5. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,664
    One mans hack, is another mans solution :p
     
    Lurking-Ninja likes this.
  6. BillyBobBeavis

    BillyBobBeavis

    Joined:
    Oct 13, 2018
    Posts:
    97
    I doubt this solution didn't come up as well. I'm just surprised that not a single person mentioned it in all those posts I read. I don't see why deciding your base mass unit in your game will be .1 rather than 1 would cause any problems down the road. However, I can see why implementing this solution into an already fleshed out game might cause headaches.
     
  7. Please don't forget to report back when you're done with your project and tell us if your solution was good enough for your entire project or it caused harm. Either way the proper retrospective is always valuable! Thanks and good luck with your project!
     
  8. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    The stability for ragdolls advice in the manual states to use less mass the further along the chain you go, and for an iterative solver, this is the accepted advice for stability, so the op is absolutely correct doing this. It is also logical given the temporal nature of the solving.

    In latest 2018.3 this should be improved a bit.

    Having said that, doing an approach like this wont lead to good-looking physics. Because you have to compromise by making each rigidbody lighter than the previous, so it only works well if you desire a flimsy not weighted behaviour.

    The correct way to do this kind of thing is probably with a solver that doesn't really use rigidbodies but a custom constraint, and I think @yant mentioned something like this long ago back when the earth had two moons.
     
  9. BillyBobBeavis

    BillyBobBeavis

    Joined:
    Oct 13, 2018
    Posts:
    97
    The game I am attempting to develop now will only use solid joint connections. So I am assuming the lower mass solution will continue to look good.
     
  10. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Yeah that's what people have been doing with physx for the last decade or so, using less mass for joints. It's a common solution and also in the unity manual.
     
  11. BillyBobBeavis

    BillyBobBeavis

    Joined:
    Oct 13, 2018
    Posts:
    97
    OK, I'll report back in five years. Haha!
     
    Lurking-Ninja likes this.
  12. BillyBobBeavis

    BillyBobBeavis

    Joined:
    Oct 13, 2018
    Posts:
    97
    I wish I had found a post with that info eight weeks ago. Maybe I'm not looking in the right places.
     
  13. Well, apparently I was wrong, and I wasn't paying enough attention. Well, it happens. Sorry about that.
     
    MD_Reptile likes this.
  14. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,510
    I have no experience with ragdolls so I may be wrong in this case, but in my other experience the "solidness" of the joints depends on the mass difference among the connected bodies. A joint between a light body and a heavy body may feel like a soft-joint. A solution is lowering the heavier body's mass. Another solution is increasing the lighter body's mass.

    As example, the excavator in this video weights 105 tons. Every part (4 bodies) is the same mass as its real-world counterpart. The joints behave as solid articulations.
     
    MD_Reptile likes this.
  15. BillyBobBeavis

    BillyBobBeavis

    Joined:
    Oct 13, 2018
    Posts:
    97
    Wow. I didn't realize Unity could do stuff like that.
     
  16. BillyBobBeavis

    BillyBobBeavis

    Joined:
    Oct 13, 2018
    Posts:
    97
    The sad thing is, I'm very stupid. I didn't realize until yesterday that simply setting the Motions to "limited" would achieve what I spent days experimenting to achieve. No need to turn down masses. Oh well. I suppose I learned along the way.
     
    Last edited: Dec 16, 2018
    Edy and Lurking-Ninja like this.