Posts: 15
Threads: 2
Joined: Nov 2018
Reputation:
0
15-11-2018, 01:24 PM
(This post was last modified: 15-11-2018, 01:24 PM by imtehQ.)
When you increase the rope length particle points are added however the tether constraints script does not update them.
So only the first part of the entire rope will have those constraints not the rest of the rope.
I also saw that if your using the Hierarchical type on them that the last 3-4 point or so are still directly connected to its start point, resulting in the rope behaving odd where most of the rope acts like expected its end point ignored what the rest of the rope does and only act on itself.
Any way to fix this or im a missing something in the setup?
Posts: 6,346
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
(15-11-2018, 01:24 PM)imtehQ Wrote: When you increase the rope length particle points are added however the tether constraints script does not update them.
So only the first part of the entire rope will have those constraints not the rest of the rope.
I also saw that if your using the Hierarchical type on them that the last 3-4 point or so are still directly connected to its start point, resulting in the rope behaving odd where most of the rope acts like expected its end point ignored what the rest of the rope does and only act on itself.
Any way to fix this or im a missing something in the setup?
Tether constraints aren't compatible with resizable ropes. Generating tethers requires a rather intensive precomputation phase, where the linear distance for each constraint along the rope is calculated.
Posts: 15
Threads: 2
Joined: Nov 2018
Reputation:
0
15-11-2018, 01:54 PM
(This post was last modified: 15-11-2018, 02:01 PM by imtehQ.)
Alright thanks for the reply.
Is there another way to make the ropes more stiff, as it needs to act as if it was a steel rope.
Im already changing its mass on the go to stay correct with its changing length, and that is solving some odd behavior when its longer, however its still a bit to spring like.
Any tips on that?
https://i.imgur.com/yMY5cfA.gifv
Posts: 6,346
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
15-11-2018, 03:27 PM
(This post was last modified: 15-11-2018, 03:32 PM by josemendez.)
(15-11-2018, 01:54 PM)imtehQ Wrote: Alright thanks for the reply.
Is there another way to make the ropes more stiff, as it needs to act as if it was a steel rope.
Im already changing its mass on the go to stay correct with its changing length, and that is solving some odd behavior when its longer, however its still a bit to spring like.
Any tips on that?
https://i.imgur.com/yMY5cfA.gifv
As far as realtime iterative solvers go, it is impossible to get 100% stiff constraints. There will always be a bit of springiness no matter what engine you use or what settings you have.
Increasing the amount of distance constraint iterations, and/or reducing the fixed timestep (see https://docs.unity3d.com/Manual/class-TimeManager.html) are the only things you can do to reduce stretchiness. Also, reducing rope resolution will help, as there will be less constraints to solve, allowing the simulation to converge faster.
Posts: 15
Threads: 2
Joined: Nov 2018
Reputation:
0
(15-11-2018, 03:27 PM)josemendez Wrote: As far as realtime iterative solvers go, it is impossible to get 100% stiff constraints. There will always be a bit of springiness no matter what engine you use or what settings you have.
Increasing the amount of distance constraint iterations, and/or reducing the fixed timestep (see https://docs.unity3d.com/Manual/class-TimeManager.html) are the only things you can do to reduce stretchiness. Also, reducing rope resolution will help, as there will be less constraints to solve, allowing the simulation to converge faster.
I tried to reducing rope resolution but that only increased the pumpyness of the rope, it started to ask it smaller movements.
It there maybe something like a drag option, like unity has on there rigedbody scripts?
Posts: 6,346
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
15-11-2018, 04:29 PM
(This post was last modified: 15-11-2018, 04:30 PM by josemendez.)
(15-11-2018, 04:12 PM)imtehQ Wrote: I tried to reducing rope resolution but that only increased the pumpyness of the rope, it started to ask it smaller movements.
It there maybe something like a drag option, like unity has on there rigedbody scripts?
Yes, it is located in the ObiSolver component. It is called "damping" and is defined as the % of kinetic energy lost per second.
Posts: 15
Threads: 2
Joined: Nov 2018
Reputation:
0
16-11-2018, 10:29 AM
(This post was last modified: 16-11-2018, 10:58 AM by imtehQ.)
Is there a way to limit the amount of movement between the particles to 0?
Make a rope that can only rotate around its particle?
I know this will be tricky to do because it all with physics, you cant just set its location in anyway.
But for example by predicting its (fixed) location as in where it needs to be,
Example, point A is at 1,0,0 while point B is at 2,0,0 its distance may never be bigger then 0.1 then its B's predicted location will be 1.1,0,0.
So to add force on point B to match that predicted point within the next frame, if reached add force in the opposite direction equal to the force you applied before +/- some possible drag.
Then once that's done trough out all particles going from top to bottom at the same time, will that not stop the rope for experiencing a spring like effect?
It might break physics for that 1 frame, but it will force the particles to bound together.
You would still be able to break it if the distance is bigger then what you define before.
Let me enplane what im trying to do, that might help a bit,
I got a rope hanging from a beam, this beam moves forwards, the rope itself can be made bigger or smaller.
The bottom of the rope is a connection point where sometimes nothing is on, but sometimes a weight of around 6000 kg.
The rope needs to act the same in both cases, it needs to move with the beam without wobbling around randomly
https://i.imgur.com/Z8MH693.gifv
And it needs to spring as little as possible
https://i.imgur.com/MBPxZJy.gifv
Posts: 6,346
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
16-11-2018, 12:18 PM
(This post was last modified: 16-11-2018, 12:26 PM by josemendez.)
(16-11-2018, 10:29 AM)imtehQ Wrote: Is there a way to limit the amount of movement between the particles to 0?
Make a rope that can only rotate around its particle?
I know this will be tricky to do because it all with physics, you cant just set its location in anyway.
But for example by predicting its (fixed) location as in where it needs to be,
Example, point A is at 1,0,0 while point B is at 2,0,0 its distance may never be bigger then 0.1 then its B's predicted location will be 1.1,0,0.
So to add force on point B to match that predicted point within the next frame, if reached add force in the opposite direction equal to the force you applied before +/- some possible drag.
Then once that's done trough out all particles going from top to bottom at the same time, will that not stop the rope for experiencing a spring like effect?
It might break physics for that 1 frame, but it will force the particles to bound together.
You would still be able to break it if the distance is bigger then what you define before.
Let me enplane what im trying to do, that might help a bit,
I got a rope hanging from a beam, this beam moves forwards, the rope itself can be made bigger or smaller.
The bottom of the rope is a connection point where sometimes nothing is on, but sometimes a weight of around 6000 kg.
The rope needs to act the same in both cases, it needs to move with the beam without wobbling around randomly
https://i.imgur.com/Z8MH693.gifv
And it needs to spring as little as possible
https://i.imgur.com/MBPxZJy.gifv
In this case you're out of luck. Iterative solvers (PhysX, Havok, ODE, Obi..pretty much all realtime solvers) are absolutely incapable of achieving this. There's two big no-nos when it comes to them:
- Large mass ratios: in your case 1/60000 (0.1kg per particle, vs 6000kg load), which is way larger than the maximum recommended by Unity: 1/10).
- Long chains of constraints: the longer the rope, the slower the convergence.
The only options left are using a direct solver (AgX Dynamics comes to mind) which are usually much more expensive (both in terms of price and performance), or use articulated bodies (which are also costlier in terms of performance, and unfortunately haven't been integrated in Unity yet).
----
By the way, the algorithm you described is called FTL (follow the leader) and unfortunately it does not produce accurate physics, just a very rough approximation. The problem with it is that by only adjusting B (the second particle in each pair), you're implicitly assigning the above chain infinite mass. This has the effect of curling the rope on itself in a very visually unpleasant way. But, by adding a largish damping factor, it can be tolerated. This is generally used for hair simulation (Nvidia Hairworks) since you cannot tell the difference with 10.000 individual hairs. However it does not work for rope (I tried).
Posts: 15
Threads: 2
Joined: Nov 2018
Reputation:
0
(16-11-2018, 12:18 PM)josemendez Wrote: In this case you're out of luck. Iterative solvers (PhysX, Havok, ODE, Obi..pretty much all realtime solvers) are absolutely incapable of achieving this. There's two big no-nos when it comes to them:
- Large mass ratios: in your case 1/60000 (0.1kg per particle, vs 6000kg load), which is way larger than the maximum recommended by Unity: 1/10).
- Long chains of constraints: the longer the rope, the slower the convergence.
The only options left are using a direct solver (AgX Dynamics comes to mind) which are usually much more expensive (both in terms of price and performance), or use articulated bodies (which are also costlier in terms of performance, and unfortunately haven't been integrated in Unity yet).
----
By the way, the algorithm you described is called FTL (follow the leader) and unfortunately it does not produce accurate physics, just a very rough approximation. The problem with it is that by only adjusting B (the second particle in each pair), you're implicitly assigning the above chain infinite mass. This has the effect of curling the rope on itself in a very visually unpleasant way. But, by adding a largish damping factor, it can be tolerated. This is generally used for hair simulation (Nvidia Hairworks) since you cannot tell the difference with 10.000 individual hairs. However it does not work for rope (I tried).
The rope itself is a steel rope that's in real-life about 3kg per 1 meter, so with 12 particles on about 2.2meters each will be 0.55kg.
To make them 600 kg per particle will mean that 2.2 meter rope will be 7200 kg, more then the thing on the bottom.
That will cause the rope itself to behave even worse then before:
Posts: 6,346
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
(16-11-2018, 01:51 PM)imtehQ Wrote: The rope itself is a steel rope that's in real-life about 3kg per 1 meter, so with 12 particles on about 2.2meters each will be 0.55kg.
To make them 600 kg per particle will mean that 2.2 meter rope will be 7200 kg, more then the thing on the bottom.
That will cause the rope itself to behave even worse then before:
Did a quick test with a 1 meter rope, 12 particles (2000 kg each), and several rigid bodies, ranging in weight from 6000 kg to 80000 kg. All tests were perfectly stable (if ever so springy), so clearly something else is wrong with your setup. Can you describe it in more detail?
Here's a video of my tests:
|