Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ObiColliders and Procedural Load
#16
(05-02-2018, 12:26 AM)jonworks Wrote: Thanks for your patience with my problems. My game is a building game and players can use the rope in a variety of ways (including ways I haven't thought of). It's not critical that the rope behaves identically under all circumstances. However it is critical that the rope behaves remotely like a rope under all circumstances and doesn't spaz out or crash the game.

The rope must be able to support a 1kg weight at 1m long, then be extended to 60m long and pick up/support a 1000kg weight, then lift the 1000kg weight up to the starting point.

This sounds like a tall order, but it really shouldn't be, because the rope parameters can be adjusted since the rope does not need to behave uniformly. IE, if the rope can be made to work at both of those extremes, then it can be made to work anywhere in between by adjusting the parameters in real time. For example a large part of my previous solution with rope that uses the built-in physics engine was adjusting the resolution (length of capsule colliders in that case) and the rope mass, depending on the length and attached mass respectively. My previous rope worked fine within those parameters, but as I've mentioned before, just crashed the game a certain percentage of the time.

Currently the case I'm unable to resolve is a 40m rope with a 400kg mass attached. Without tethers (regardless of iteration count or resolution) it's too much like a rubber band. With tethers the rope is always a squiggly line and behaves like it's yanking the rope every few frames instead of exerting uniform pulling force on the mass.

I tried starting with your crane example to give you some steps to reproduce, but like everything in this project it has been an odyssey of frustration. The rope won't extend past a certain distance. Looked in the crane controller and I can't find a limiter there. Tried increasing pooled particles using cursor.rope.pooledParticles both in Start() and Update() but no change. Tried increasing pooled particles for the rope in inspector while playing but no change. Tried increasing the pooled particles before pressing play but no change. Tried initializing the rope after increasing the pooled particles both while playing and before playing but it broke the whole thing and now the rope just falls into the void.

Thanks,

Jon

Hi Jon,

Now that I understand the use case I can tell you with confidence that Obi is not the right tool for this. There are very few (if any) realtime solvers capable of doing what you ask for, as it is a textbook worst-case scenario for physics simulations: very large chain of constraints coupled with a huge (1:10000, assuming 0.1kg per rope node) mass ratio. If you also want to support arbitrary collisions with the rope, things get even more difficult. Adjusting simulation parameters according to the situation is not even your biggest problem, but getting an accurate simulation of a 60 meter rope with 1 ton weight at its end is borderline impossible.

Try reducing the physics timestep A LOT (0.001 or 0.0005) while using only vanilla distance constraints and 10 iterations, see if that somewhat improves the results. Be warned however that this will reduce performance, so I'm not that optimistic.

To my knowledge, the only existing algorithm capable of withstanding this would be ABA (articulated bodies). It is way more expensive than more traditional approaches, but it will be able to handle your scenario. It comes with its own set of limitations tough: rope cannot form closed loops (you're limited to straight segments, which could or could not be of importance to you) and contact handling is very slow (linear in the amount of segments for a single contact, so quadratic worst case complexity compared to Obi's constant/ worst case linear complexity). Also, I don't know of a good implementation of this in Unity. Newer PhysX versions include ABA (see https://www.youtube.com/watch?v=80cMpjdwPAM), but it is not integrated into Unity yet. Will let you know if I come across any good tool for this.
Reply


Messages In This Thread
ObiColliders and Procedural Load - by jonworks - 18-01-2018, 07:03 AM
RE: ObiColliders and Procedural Load - by josemendez - 05-02-2018, 09:33 AM