Preset Wind Direction Does Not Interpolate Correctly

I’m sure this is just a simple math bug that got overlooked…

Are you using Developer Mode or made changes in it?

No

Have you disabled/removed all your mods and addons?

No

Brief description of the issue:

Preset wind direction does not interpolate correctly between 0 and 359 degrees. It interpolates the long way around instead of to the nearest direction. For example, a NNE ground level wind and a NNW wind aloft causes a nearly 360 degree change in wind direction with altitude from NNE to E to S to W to NNW. Expected behavior is the direction to change from NNE to N to NNW. Not sure if this is also present in Live Weather.

Provide Screenshot(s)/video(s) of the issue encountered:

Provide coordinates (DevMode > Options > Display position)

N/A

Provide time & date of the observed Weather issue

N/A

Detailed steps to reproduce the issue encountered:

Create a weather preset with two wind layers, a NNE or NNW ground level wind, and a wind aloft of NNW or NNE so it’s on the other side of North. Note the wind direction changing through South while ascending between the two levels.

PC specs and/or peripheral set up if relevant:

N/A

Build Version # when you first started experiencing this issue:

1.27.21.0


:loudspeaker: For anyone who wants to contribute on this issue, Click on the button below to use this template:

Do you have the same issue if you follow the OP’s steps to reproduce it?

Provide extra information to complete the original description of the issue:

If relevant, provide additional screenshots/video:

Are you using Developer Mode or made changes in it?

Dev mode is on, but no changes are made there. Weather is set manually in ingame UI.

Have you disabled/removed all your mods and addons?

Only addon in use is ambitiouspilots-shiftzstats, that shows current wind.

Brief description of the issue:

When wind direction manually set to 350 deg at one layer and 10 deg at another (with no gusts involved), the resulting wind between wind layers is interpolated to 180ish. It should be about 0 deg. Not tested with live weather, since it’s a bit hard to test, but this may apply to live weather when conditions are similar.

Provide Screenshot(s)/video(s) of the issue encountered:

Provide coordinates (DevMode > Options > Display position)

Manual weather, any location

Provide time & date of the observed Weather issue

Manual weather, any time or date

Detailed steps to reproduce the issue encountered:

Start flight on custom location, so that flight altitude is about 2000ft. Set ground wind layer to 350/10. Set another wind layer 010/15 at 4000ft. Observe wind direction using an addon that is capable showing weather at user location, or GS1000NXi or similar.

PC specs and/or peripheral set up if relevant:

Not relevant really

Build Version # when you first started experiencing this issue:

1.27.21.0


:loudspeaker: For anyone who wants to contribute on this issue, Click on the button below to use this template:

Do you have the same issue if you follow the OP’s steps to reproduce it?

Provide extra information to complete the original description of the issue:

If relevant, provide additional screenshots/video:

1 Like

If I remember correctly, the wind UI has the arrow pointing to the direction the wind blows from, which is not intuitive as you’ve discovered. Based on your screenshots the wind at surface is set variable 170-180, and at 4000ft variable 190-180, so the wind being 182-187 at 2500ft makes sense.

That’s not true. Just forget the arrows… If you type wind direction eg. 270, wind is then 270 in game, blowing from west. When I tested this, I climbed from 2000ft to 3000ft and wind started to turn towards east 090. If your theory was true, the wind direction should have changed only roughly 10 degrees to west.

This is just a silly coding error, when someone has thought it’s good enough to calculate average of degree values, (350+10) / 2 = 180.

2 Likes

Do you have the same issue if you follow the OP’s steps to reproduce it?

Yes

Provide extra information to complete the original description of the issue:

Setting-up same wind layers than OP, using Little Navmap to check wind direction when climbing, instead of incrementing gradually from 345 degree at sea level to 16 degree at 4000 feet, the wind direction is gradually decrementing from 345 to 16, see below screenshots.
I did another test, this time having wind on ground coming from 16 degree and at 4000 feet coming from 345 degree, this time wind direction is incrementing gradually from 16 to 345 when climbing. Actual logic sounds incorrect, wind direction variation between 2 layers should be the shortest increment or decrement angular variation and not the longest one.
This logic could also happen with Live weather if same algorithm is used, further testing is needed to confirm.

If relevant, provide additional screenshots/video:

1 Like

Seems “obvious” when it is pointed out… and the correct way to average wind using Vectors is then equally Obvious.

Amazingly, I can remember way back to when I 1st made that mistake - so I find this bug discovery :point_right: “diverting” :point_left: and worth voting to have corrected.

2 Likes

Thanks for verifying and identifying the likely culprit.

Interestingly, the bug does not appear to be present in Live Weather from the limited test I just. KILN is currently reporting a NNE surface wind with NNW winds aloft, which would induce the bug if present to create a southerly wind as we ascend.

That’s the track of an ascending balloon, and the wind direction was correctly averaged from NNE to NNW.

1 Like

:wave: Thank you for using the Bug section, using templates provided will greatly help the team reproducing the issue and ease the process of fixing it.

Are you using Developer Mode or made changes in it?

Not in developer mode

Have you disabled/removed all your mods and addons?

All addons are present

Brief description of the issue:

When there are two different wind directions at different altitudes the wind direction between the two altitudes will not cross the boundary from 1 to 359 between the two wind layers, but instead will go the long way around. This is a significant error that will affect thermals as well as normal wind, and may have other subsequent effects. It is preventing me from using wind layers.

Provide Screenshot(s)/video(s) of the issue encountered:

https://youtu.be/khA5wnkGIi4

Provide coordinates (DevMode > Options > Display position)

not applicable

Provide time & date of the observed Weather issue

not applicable

Detailed steps to reproduce the issue encountered:
>- Create wind layer 1 at altitude 30m direction 1 degree
>- Create wind layer 2 at altitude 100m direction 359 degree
>- Set the preset to AGL
>- Take off to the East rising slowly to 110m
>- Observe the wind direction on a tool such as FSKneeboard that the wind direction moves clockwise through 358 degrees instead of anti-clockwise through 2 degrees
>- Descend and land and the reverse happens

PC specs and/or peripheral set up if relevant:

not applicable

Are you using DX11 or DX12?

not applicable

Are you using DLSS?

not applicable


:loudspeaker: For anyone who wants to contribute on this issue, Click on the button below to use this template:

Do you have the same issue if you follow the OP’s steps to reproduce it?

Provide extra information to complete the original description of the issue:

If relevant, provide additional screenshots/video: