Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Fishing Pole/Line
#28
(22-06-2022, 08:32 AM)josemendez Wrote: Hi Natty,


Springyness can be reduced by using more substeps, it cannot be completely eliminated though as it would require to use infinite substeps. This is not a quirk specific to Obi, it's just how physics engines work: time is chopped up into small "steps", during each step all quantities are linearized which means objects cannot change direction or moving speed within the step. If a rope is moving fast enough, and/or has enough mass (both affect inertia) it will spring back slightly once it reaches its max length.

This is also why if you create a tall enough stack of boxes in any engine, they will slightly penetrate each other. The longer the timestep, and the taller the stack, the more "springy" collision response will be.

Still, even moderate settings in Obi should yield useable results in this regard. I'm only using 10 substeps for a thin 10 meter long rope, it's quite snappy and really stable:




Dynamic attachments are constraints, which mean they work by applying forces on both the bobber and the rope (as opposed to static attachments, which just set the rope's position kinda like a parent-child relationship). Since time is discrete (see my first paragraph) this can mean the bobber can only move in a straight line within each physics timestep. This may or may not be enough to match its position with the rope during violent motion. You can see this in the video above too, when I flick the rope around randomly.

A simple solution to get rid of the visual gap would be to just move the end particle to the attachment position every frame. You'd be trading the gap for a slightly crooked look at the end of the rope. This is akin to what the "projection mode" in rigidbody joints do: snap the position of the rigidbodies even if it's physically incorrect, to try and hide gaps. Should be a simple thing to write, in fact I believe I have some sample code around that does this. Let me look for it and get back to you.


Not sure what you mean by "spinning out of control", that sounds weird. Position-based dynamics (the framework used by Obi) is generally very stable and well-behaved even under extreme conditions. Could you share a video of this behavior?


Did some tests with center of mass (above video) but results look ok to me. Never had any issues reported regarding center of mass tbh. The rope mass I used is 0.01 kg per particle and the bobber is 0.1 kg, so a mass ratio of 1:10 which is about the recommended maximum for an iterative engine.


How have you changed the center of mass? Have you set a new position programmatically? (ie rigidbody.centerOfMass = whatever) or just placed a larger collider at the bottom?

In the video above I just placed a sphere at the bottom of the rigidbody to lower the CoM and relied on Unity to automatically calculate it.

Imho I guess the best course of action at this point is for me to take a look at the project itself, otherwise it's a lot of back and forth guesswork. Would this be possible?

kind regards,
Hi Jose,

As always, I sincerely appreciate the in-depth responses.  Here's a video of how my bobber is, along with some casting, but a lot of the casting issues is just my code at the moment, and probably needing some tweaks to the rope settings. Just wanted to give you an idea of the set up: https://streamable.com/fl6za5

My bobber just floats upside down like that when running around and doesn't react in a realistic way. The rope's mass is 0.1 at the two points that I have (one static at fishing rod tip and one dynamic at the tip of red stick).  The bobber in that video started with 0.1 mass and then I changed it to 1 mass to try to show a difference.

The sample code for patching the gap would be awesome.

For the center of mass I was setting it through code, but in the video I removed that and just used the red stick with the white sphere childed to it.

As for sharing the project for you to have a look, I'd certainly be interested, but I'm unsure of the best way to do it. I have a few other paid for assets in the project, so I'm a bit reluctant to give access to the private GitHub repo, since technically that would be a violation of the asset rights (as I'm sure you understand).  However, I would be down to jump on a Discord video share call or so? I'm also open to other ideas and/or what's easiest for you.

Thank you.
Reply


Messages In This Thread
Fishing Pole/Line - by Natty - 15-04-2022, 12:57 AM
RE: Fishing Pole/Line - by josemendez - 15-04-2022, 09:17 AM
RE: Fishing Pole/Line - by Natty - 17-04-2022, 06:22 PM
RE: Fishing Pole/Line - by josemendez - 18-04-2022, 09:38 AM
RE: Fishing Pole/Line - by Natty - 19-04-2022, 02:56 PM
RE: Fishing Pole/Line - by josemendez - 20-04-2022, 08:47 AM
RE: Fishing Pole/Line - by Natty - 21-04-2022, 01:26 AM
RE: Fishing Pole/Line - by Natty - 26-04-2022, 05:44 PM
RE: Fishing Pole/Line - by josemendez - 27-04-2022, 07:56 AM
RE: Fishing Pole/Line - by Natty - 29-04-2022, 07:13 PM
RE: Fishing Pole/Line - by josemendez - 30-04-2022, 09:40 AM
RE: Fishing Pole/Line - by Natty - 30-04-2022, 04:47 PM
RE: Fishing Pole/Line - by josemendez - 30-04-2022, 05:38 PM
RE: Fishing Pole/Line - by Natty - 30-04-2022, 11:07 PM
RE: Fishing Pole/Line - by josemendez - 01-05-2022, 12:24 AM
RE: Fishing Pole/Line - by Natty - 01-05-2022, 03:40 AM
RE: Fishing Pole/Line - by josemendez - 02-05-2022, 08:54 AM
RE: Fishing Pole/Line - by Natty - 03-05-2022, 06:15 PM
RE: Fishing Pole/Line - by Natty - 25-05-2022, 12:39 AM
RE: Fishing Pole/Line - by josemendez - 25-05-2022, 01:23 PM
RE: Fishing Pole/Line - by Natty - 25-05-2022, 05:25 PM
RE: Fishing Pole/Line - by Natty - 04-06-2022, 09:08 PM
RE: Fishing Pole/Line - by josemendez - 06-06-2022, 07:45 AM
RE: Fishing Pole/Line - by Natty - 10-06-2022, 12:03 AM
RE: Fishing Pole/Line - by josemendez - 13-06-2022, 11:49 AM
RE: Fishing Pole/Line - by Natty - 22-06-2022, 03:11 AM
RE: Fishing Pole/Line - by josemendez - 22-06-2022, 08:32 AM
RE: Fishing Pole/Line - by Natty - 23-06-2022, 02:42 AM
RE: Fishing Pole/Line - by Natty - 28-06-2022, 01:15 AM