UBOAT
(2022.1) TDC MOD (TVh-Re/S3)
DECAFBAD 20 May, 2021 @ 2:02pm
BUG: AOB "bounces off" 180°
Sometimes when moving the periscope/UZO/manual angle, when moving over 180° AOB the "Gegnerlage" will move to the wrong direction.

Steps to reproduce:

- turn on course follow, turn on AOB follow
- with the periscope or UZO, cross 180° AOB by turning towards starboard.

Once this happens, the pointer will point either towards starboard or port, depending on the last input.

https://peertube.linuxrocks.online/videos/watch/ee1eebb2-0604-4f87-8428-c1df656d9160
Last edited by DECAFBAD; 21 May, 2021 @ 11:05am
< >
Showing 1-11 of 11 comments
Ruby  [developer] 20 May, 2021 @ 2:12pm 
Hi,

Thanks for the info. We will check this.

Cheers Ruby
Urfisch  [developer] 20 May, 2021 @ 11:36pm 
Thx!
DECAFBAD 21 May, 2021 @ 11:45am 
I figured I'd take a look at it.
Incrementing the AOB dial (Dial180) doesn't stop it from going above 180 or below -180, I think the Increment method was supposed to be protected against that. This patch fixes the issue:
diff --git a/Source/TDC_UI.cs b/Source/TDC_UI.cs index 315c15d..2235cd8 100755 --- a/Source/TDC_UI.cs +++ b/Source/TDC_UI.cs @@ -1329,31 +1329,15 @@ public class Dial180 : RotatingDial, IScrollHandler public void Increment(float value) { - if (Mathf.Abs(value) > 180) - { - return; - } - _value += value; - - if (_value > 180) - _value = -_value; - + _value = ((_value + 180) % 360) - 180; DialTransform.localEulerAngles = new Vector3(0f, 0f, -_value); } public void Decrement(float value) { - if (Mathf.Abs(value) > 180) - { - return; - } - _value -= value; - - if (_value < -180) - _value = -_value; - + _value = ((_value + 180) % 360) - 180; DialTransform.localEulerAngles = new Vector3(0f, 0f, -_value); } }
Last edited by DECAFBAD; 21 May, 2021 @ 8:45pm
DECAFBAD 21 May, 2021 @ 8:42pm 
I found another related bug.

Reproduce:

-Set AOB to 170° port, UZO 10° starboard.
-Disable optics follow (Blue light)
-Set UZO to 10° port
-Enable optics follow (Blue light off)

Expected outcome: AOB changes to 170° starboard
Actual outcome: AOB stays unchanged

I edited my patch to cover this issue as well
Last edited by DECAFBAD; 21 May, 2021 @ 9:25pm
Urfisch  [developer] 22 May, 2021 @ 12:58am 
Nice one, thx!
Urfisch  [developer] 22 May, 2021 @ 2:27am 
Btw, have you tested this by yourself?
DECAFBAD 22 May, 2021 @ 9:08am 
I have completed a couple engagements with this fix, I saw no issues.

Maybe the AOI dial needs to be double checked to be extra safe, but I haven't noticed any weirdness.
Urfisch  [developer] 22 May, 2021 @ 10:46am 
Originally posted by DECAFBAD:
I have completed a couple engagements with this fix, I saw no issues.

Maybe the AOI dial needs to be double checked to be extra safe, but I haven't noticed any weirdness.

Thx! We will test this too before putting it on the official branch :)
Urfisch  [developer] 8 Jun, 2021 @ 5:53am 
Hey Decafbad. No time to test so far :D is your patch a standalone cs script?
DECAFBAD 8 Jun, 2021 @ 5:59am 
It's a patch file that can be used with git

If you don't use git, do the following:

delete lines that begin with -
paste lines that begin with + (except for the + character)
DECAFBAD 8 Jun, 2021 @ 6:00am 
I re-applied the fix a few times. It is definitely needed. There are no issues. AOI dial works as expected too.
< >
Showing 1-11 of 11 comments
Per page: 1530 50