Obi Official Forum
Help Differences From Obi6 and Obi5 - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html)
+--- Thread: Help Differences From Obi6 and Obi5 (/thread-3411.html)



Differences From Obi6 and Obi5 - VirtualCucumber - 20-04-2022

I have some functionality that shows up differently in Obi6 than in 5 and I am just curious about what is happening.

I have 2 projects both different versions of unity and Obi versions but have the same functionality - applying force to the end of rope particle to follow a line.

Obi5 Unity 2019 - works great:
[Image: vbwWpM8.gif]

Obi6 Unity 2021 - jitter but works similarly like Obi5 when changing the point's mass to 0.25:
[Image: xBMSnwK.gif]

Both scripts are the same and both are using the default settings for a blueprint (minus a couple of extra control points) however, in Obi6 the output force's magnitude is sustainably higher to achieve the same destination and it causes the jitter you see in the gif. This stops when I increase the mass per control point for the Obi6 blueprint to 0.25. 

I was wondering why does this happen and what was the major factor that changed?

I messaged you the simple demo projects if you have the time to check them out.


RE: Differences From Obi6 and Obi5 - josemendez - 20-04-2022

Hi!

There's no change in how mass/forces behaves from Obi 5 to 6 (at least no intentional changes). Both versions successfully pass all AddForce() and externalForces[] unit tests, so I'd say it's safe to say they should behave the same.

The jittering issue is specially suspicious, makes me think forces are not being applied every frame or something similar.

I'll be glad to take a look at your demo projects, but I can't find a PM or an email from you?

kind regards,


RE: Differences From Obi6 and Obi5 - VirtualCucumber - 20-04-2022

(20-04-2022, 09:56 AM)josemendez Wrote: Hi!

There's no change in how mass/forces behaves from Obi 5 to 6 (at least no intentional changes). Both versions successfully pass all AddForce() and externalForces[] unit tests, so I'd say it's safe to say they should behave the same.

The jittering issue is specially suspicious, makes me think forces are not being applied every frame or something similar.

I'll be glad to take a look at your demo projects, but I can't find a PM or an email from you?

kind regards,

Ah yes, I forgot to send the PM last night :/ I went ahead and sent it now.


RE: Differences From Obi6 and Obi5 - josemendez - 21-04-2022

(20-04-2022, 01:56 PM)VirtualCucumber Wrote: Ah yes, I forgot to send the PM last night :/ I went ahead and sent it now.

Confirming I received your PM, just haven't had a chance to look at it yet. Will do in a couple hours, then get back to you. Hang on!


RE: Differences From Obi6 and Obi5 - josemendez - 22-04-2022

Hi,

Took a look at both projects. First thing that caught my attention me out is that the InverseMass for the dragged particle shown in the console was completely different in each project (Debug.Log at line 52 of your PhysicsAnimator): in 2019, the value was "1" and in 2021, "10" (which is the correct value, since the mass set in the rope path is 0.1 for all control points).

Inspecting mass values stored in the blueprint for each version, the very first particle in the rope in the 2019 version had incorrect inverse mass of 1:

[Image: GVf1sZH.png]

Turns out, the blueprint generation code in your 2019 project uses thickness instead of mass for the first particle:
[Image: Pcera1g.png]

That's line 78 in ObiRopeBluepint.cs. It should use masses instead:

Code:
particleInvMasses.Add(ObiUtils.MassToInvMass(path.masses.GetAtMu(path.Closed,mu)));

The weird part is that this line in the archived version of Obi 5.3 is correct. According to Git, this line hasn't been changed since 5.0. It's extremely unlikely it was changed by accident in your project, either. No idea how that ended up there tbh.

At least the behavior is now consistent in both versions: jitters in both  Interesante. This is because the proportional/derivative controller you're using to calculate the force overshoots, you need to considerably reduce the frequency. Or, increase particle mass.

let me know if I can be of further help.


RE: Differences From Obi6 and Obi5 - VirtualCucumber - 22-04-2022

(22-04-2022, 09:36 AM)josemendez Wrote: Hi,

Took a look at both projects. First thing that caught my attention me out is that the InverseMass for the dragged particle shown in the console was completely different in each project (Debug.Log at line 52 of your PhysicsAnimator): in 2019, the value was "1" and in 2021, "10" (which is the correct value, since the mass set in the rope path is 0.1 for all control points).

Inspecting mass values stored in the blueprint for each version, the very first particle in the rope in the 2019 version had incorrect inverse mass of 1:

[Image: GVf1sZH.png]

Turns out, the blueprint generation code in your 2019 project uses thickness instead of mass for the first particle:
[Image: Pcera1g.png]

That's line 78 in ObiRopeBluepint.cs. It should use masses instead:

Code:
particleInvMasses.Add(ObiUtils.MassToInvMass(path.masses.GetAtMu(path.Closed,mu)));

The weird part is that this line in the archived version of Obi 5.3 is correct. According to Git, this line hasn't been changed since 5.0. It's extremely unlikely it was changed by accident in your project, either. No idea how that ended up there tbh.

At least the behavior is now consistent in both versions: jitters in both  Interesante. This is because the proportional/derivative controller you're using to calculate the force overshoots, you need to considerably reduce the frequency. Or, increase particle mass.

let me know if I can be of further help.

Thank you! This makes total sense now and I appreciate the advice for the jitter problem as well. Way less confused now Sonrisa