Jump to content
The simFlight Network Forums

Wind control via 0x2DE0 / 0x2DE8 gets stuck


RoB2

Recommended Posts

Hello,

I am currently building a weather engine for FSX (http://www.plane-pics.de/fsxwx/).

For this, I want to implement a custom wind control via FSUIPC and encountered a problem.

I use the Offsets 2DE0 and 2DE8 to control the wind in FSX. Every 5 seconds the new wind values are written to those offsets.

In general, it already works quite well, but from time to time (randomly?) FSX doesn't 'recieve' these value any more and get stuck with the previous wind, although the FSUIPC log shows that these values are still transmitted and written.

Strangely, in the slew mode textinfo, the correct values are still shown!

I am using C# and the Client DLL by Paul Henty. All wind smoothing features of FSUIPC are off. I also tried to reset the connection but this doesn't help either.

Many thanks for any support or ideas to solve this!

Robert

Link to comment
Share on other sites

For this, I want to implement a custom wind control via FSUIPC and encountered a problem.

I use the Offsets 2DE0 and 2DE8 to control the wind in FSX. Every 5 seconds the new wind values are written to those offsets.

In general, it already works quite well, but from time to time (randomly?) FSX doesn't 'recieve' these value any more and get stuck with the previous wind, although the FSUIPC log shows that these values are still transmitted and written.

I'm amazed you get them working at all if you are only updating them at 5 second intervals. You could try doing it every 50 mSecs. But in the offsets list it does actually say that "it is hoped that this can be written to ...", and the right-most column, the one detailing write capabilities, it does say "No" too! And even in red. Did you not notice these comments?

Basically, Microsoft stopeed developing SimConnect for FSX before they got to this facility even though it was on the list right from the beginning.

For FSX, the weather control features which work well are those operated through the New Weather Interface, and even then they are only directly controllable at the aircraft if you put FSX into global Weather mode. This is what ASE/ASX/AS2012 does in "DWC" (Direct Weather Control) mode. Otherwise the weather is always affected by the three weather stations designated for the area the aircraft is in.

Regards

Pete

Link to comment
Share on other sites

Hello Pete, thank you for your fast reply.

Yes, surprisingly (!?) these offset do work in FSX (as long as they are not stuck).

And I have seen that they are tagged as 'hoped-to-be-writable' in the offset list.

Btw.: This thread http://forum.simflight.com/topic/20436-little-question-about-wind/ motivated me to try them (I am aware that it is refering to FS2004, but anyway...).

even then they are only directly controllable at the aircraft if you put FSX into global Weather mode. This is what ASE/ASX/AS2012 does in "DWC" (Direct Weather Control) mode. Otherwise the weather is always affected by the three weather stations designated for the area the aircraft is in.

I really want to avoid the global mode because I want to have accurate local weather depictions. (And I haven't figured out a way to do this and/or don't know if it possible?!)

I have tried an interval of 50 mses, but on a testflight from EDDL to EGLL the wind got stuck just before reaching GB...

Clearing and reinjection the (local) weather seems to revive the wind control with these offsets.

May I ask how do you have realized the built-in wind smoothing of FSUIPC?

Isn't it controlling (smoothing) the wind without using the global mode?

Thanks again!

Regards

Robert

Link to comment
Share on other sites

May I ask how do you have realized the built-in wind smoothing of FSUIPC?

Isn't it controlling (smoothing) the wind without using the global mode?

It hooks into the calls between the WEATHER.DLL module and the SIM1.DLL module where the former sends the wind data to the simulation engine. It modifies the data going across (the X/Y/Z wind vectors). But even that isn't foolproof -- wind deviations still occur. I don't think I ever located the exact correct places to fiddle these things, unlike with FS9 and before.

To be honest, this whole area of FSUIPC4 is so complex that I find that, despite my helpful comments in the code, I have to study it quite a lot to see why things behave as they do. It is over six years now since I wrote it, and at least 4 years since I last messed with it.

The imposition of the values written to the offsets you are using DO actually take part in this hooking between the two FS modules, but not necessarily the exact same ones. And without delving into the code a lot more I don't actually remember why. If you add the following lines to the FSUIPC4.INI file before running FSX a quite full log of the actions being taken in FSUIPC4 will be produced. Perhaps you could then find the area in the log which leads up to and includes the failure of your writes, and show me the extract: Add the lines to the [General] section:

Debug=Please

TestOptions=x4000

Regards

Pete

Link to comment
Share on other sites

Just finished my standard testflight EDDL-EGLL and wanted to give a brief result: No more wind deadlocks!

I probably have to do more flights to confirm this, but I am so thrilled right know that I wanted to report this first impression.

Next, I will look through the log file and report back with entries that should be interesting.

So, was your re-location of the wind settings in the DLL an 'eductated guess' or did you indeed find a reason/bug? (Latter would be incredible at such short notice.)

Another word to the testflight: I am really excited because it was easily the most accurate and errorless weather experience I had in FSX so far. Including full local weather (no sudden cloud changes and you actually

fly into the weather you see in front of you), accurate winds (surface and aloft), no winds shifts and no wind circling (that I got sometimes with the FSUIPC wind smoothing).

Again: Thank you!

Regards

Robert

Link to comment
Share on other sites

So, was your re-location of the wind settings in the DLL an 'eductated guess' or did you indeed find a reason/bug? (Latter would be incredible at such short notice.)

Not really a bug, as it was never an advertised facility -- it's actually documented as "not working". It was only your report suggesting it "nearly worked" which prompted me to question why. The fact that it was nearly working was something of a surprise I suppose. But then, back in the day, I was still hoping Microsoft would fix the facility so I didn't really test that fiddle code fully. I was concentating only on the smoothing.

Seems not many folks before you had actually tried using it, or had and not pursued it at all.

The "fix" involved adding the processing of the directly written wind values to the path used for smoothing, so that it operates just as often and on the same weather to Sim calls.

I'm wondering now how it would work with wind smoothing enabled. The values are written after the smoothed values, but there could be conflicts. Maybe you could enable the smoothing and see what happens?

Another word to the testflight: I am really excited because it was easily the most accurate and errorless weather experience I had in FSX so far. Including full local weather (no sudden cloud changes and you actually

fly into the weather you see in front of you), accurate winds (surface and aloft), no winds shifts and no wind circling (that I got sometimes with the FSUIPC wind smoothing).

Well, I'm not sure how this helps with clouds, and since it is using the same paths as the wind smoothing I wouldn't expect it to be completely free of those 'circling' defects. Though if it does really turn out to be so, let me know because maybe I can back-process the smoothing action into the older paths for the direct wind control. Mind you, I've rarely seen any 'circling' with smoothing enabled. They seem very rare. Maybe you are confusing the wind variance simulation with a smoothing defect? The variance effect can be disabled using the checkbox.

Regards

Pete

Link to comment
Share on other sites

Well, I'm not sure how this helps with clouds, and since it is using the same paths as the wind smoothing I wouldn't expect it to be completely free of those 'circling' defects. Though if it does really turn out to be so, let me know because maybe I can back-process the smoothing action into the older paths for the direct wind control. Mind you, I've rarely seen any 'circling' with smoothing enabled. They seem very rare. Maybe you are confusing the wind variance simulation with a smoothing defect? The variance effect can be disabled using the checkbox.

Okay. I've done some tests of my own, with wind smoothing enabled too and the effects allowed (turbulence, variance, gusts). The direct wind offsets still work okay and even the effects still occur, just using the forced direction and speed as the new "centre". Furthermore I've added the wind smoothing calls to the path originally only used for direct wind changes, and, whilst i can't swear that this will remove your "circling" nuisance (which I can't reproduce in any case). at least it has the same chance as the direct wind setting. It certainly doesn't seem to do any harm at all.

So, please replace 4.859f with FSUIPC 4.859g test and do any further testing with that. I'll be using it in flights over the weekend and if I don't see anything untoward I'll make it more generally available, so let me know please.

Regards

Pete

Link to comment
Share on other sites

I have made some more flights this morning with v4.859g with various settings and didn't experience any troubles or abnormalities.

- Controlling the wind directly with these offsets and a writting interval of 50mSec worked from take-off to landing. Enabling/Disabling your wind smoothing made no difference. No surprise I guess, because it kicks in only ~14sec after changing the offset.

- Your wind smoothing (not using the offsets by myself) behaved like it was with the previous version 4.858. No differences observed.

Let me explain what I meant with 'wind circling': Actually, I didn't mean it as a bug, but rather as a 'limitation' because your wind smoothing certainly only can react to those winds that it gets from FSX. Thus, it depends from the FSX internal interpolation - and although I did not really figure out its behaviour (you said it interpolates the nearest three stations?!), I rather quickly realized that it is kind of limited. I suppose that's also the reason I got circling winds, maybe because FSX got 'confused' from major differences in wind directions from its surrouding stations...!?

So, during my recent tests I observed that even my still very basic techniques to interpolate wind dir and speed (lateral and vertical with the underlying weather engine) are more precise than what I get from FSX. That's why I think that controlling the wind via these offsets with non-global environment in FSX really offers new opportunities.

If you want to test my wind control with these offsets, feel free to download http://www.plane-pic...load/FSXWXb.zip

Note that you have to replace your wxmapping.bin: http://www.plane-pic...nstructions.htm

Robert

Edit: Anyone who downloaded the FSXWXb.zip 'too quickly' after I posted this message, please re-download because the initial one was wrong.

Link to comment
Share on other sites

- Controlling the wind directly with these offsets and a writting interval of 50mSec worked from take-off to landing.

You don't really need to write so often. As I said after I checked, it takes the value for around 10-12 seconds after, so your original 5 secs interval would be fine.

Enabling/Disabling your wind smoothing made no difference. No surprise I guess, because it kicks in only ~14sec after changing the offset.

Well, yes, for smoothing, but enabling smoothing also enables FSUIPC's wind effect simulation -- turbulence, gusts and varianvce -- unless these are disabled in that section of the options. If you never want such effects, even when the weather report demands them, then it is okay for you to have smoothing off. But I would think the effects would normally be needed -- unless you are going to simulate them yourself?

I suppose that's also the reason I got circling winds, maybe because FSX got 'confused' from major differences in wind directions from its surrouding stations...!?

Well, from the three stations it uses for interpolation -- which are not always the three closest. In some cases the triangles used are ridiculous. I don't know if this one was corrected in FSX, but in FS9 one of the triangles, surrounding Rotterdam, had two vertices in the Netherlands and the third in North Africa! That could give rise to some weird interpolations.

However, that's a diversion. The main problem is a bug in FS where during interpolations it can, in certain circumstances, get the sign of a value completely wrong. This is just like having a 180 degree reversal in on of the components. It's a known bug in FS (Micxrosoft knew about it) but it was never actually located in the code and corrected.

If you want to test my wind control with these offsets, feel free to download http://www.plane-pic...load/FSXWXb.zip

Note that you have to replace your wxmapping.bin: http://www.plane-pic...nstructions.htm

Thanks. I may have a play.

Regards

Pete

Link to comment
Share on other sites

Well, yes, for smoothing, but enabling smoothing also enables FSUIPC's wind effect simulation

Yes, it does, but with a short writing interval of the offsets, FSUIPC hasn't a chance to simulate these effects anyhow because any attempts to do so would be continuously interrupted!?

But I would think the effects would normally be needed -- unless you are going to simulate them yourself?

My plan for FSXWX is:

- to control the wind dir/speed directly with the offsets

- to use the FSX internal turbulence because it is OK in my opinion and has the advantage to be conveniently assigned to different heights and clouds. Besides, it seems to work fine and independently from setting the wind via the offsets

- to add variance and gusts on top of the direct wind control by my own

The wind calculations are done in the background with the underlying wx engine and thus do do not depend on any sim limitations (like the weird Rotterdam-Africa-triangle).

I am currently experimenting with wind gusts and variance. In theory, it is actually not that complicated, but I have yet to find the correct, natural and random behaviours of these effects.

One side-question: With all 'weather settings off' FSUIPC shouldn't do anything to the weather, correct? Also, FSX internal effects remain untouched?

I am asking because the (extended) log shows even then entries like

144239 Turbulence Ranges now Dir 244.83-248.83, Spd 5.39-6.62

144239 Pre- Wind Check: Dir=246.826, Vel=5.98413, X=5.55155, Z=2.3587

144239 Ambient Winds Set: Dir=246.826, Vel=5.984, X=5.501 (2.83m/s), Z=2.35494 (1.211m/s)

Regards

Robert

P.S.: I made more testflights and they were all fine. The wind never got stuck again.

P.P.S.: Unlike the revived wind offsets we are talking about, the visibility offset 0x2DF0 that is also only hoped-to-be-written in fact does not work, correct? At least, I gave it a try but nothing happened to the visibility.

Link to comment
Share on other sites

Yes, it does, but with a short writing interval of the offsets, FSUIPC hasn't a chance to simulate these effects anyhow because any attempts to do so would be continuously interrupted!?

No, that's not true. Your writing to the offset is exactly the same if you wrote at 1 msec intervals or 10 mSec intervals. The value simply gets sotred in the offset. Whatever values are in the offset at the time FSUIPC wuld normally apply smoothing checks are applied instead of the intended smoothing value. The simulation of the three effects occurs as normal, should the weather setting demand them. I've seen it. You can check it yourself by using a wind layer which has turbulance, variance or gusts.

My plan for FSXWX is:

- to control the wind dir/speed directly with the offsets

- to use the FSX internal turbulence because it is OK in my opinion and has the advantage to be conveniently assigned to different heights and clouds. Besides, it seems to work fine and independently from setting the wind via the offsets

No, that's the whole point. The whole reason I went to a lot of trouble simulating the effects was precisely because by overwriting the wind values between the WEATHER DLL and the SIM1 simulation engine, none of FS's effect were getting through. I had to add the effects myself else you wouldn't get them. The same will occur with this direct control via the offsets, because it is exactly the same as my smoothing -- even more so with the changes i did to make them work more effectively.

If you've seen turbulence whilst controling th winds it will be FSUIPC adding it. Yuo can check that easily by inhibiting it or turning off smoothing.

The wind calculations are done in the background with the underlying wx engine and thus do do not depend on any sim limitations (like the weird Rotterdam-Africa-triangle).

Yes. using global mode like ActiveSky achoeves the same because all the stations are then set identically.

I am currently experimenting with wind gusts and variance. In theory, it is actually not that complicated, but I have yet to find the correct, natural and random behaviours of these effects.

You don't like FSUIPC's? You can change them a bit with the parameters provided you know.

One side-question: With all 'weather settings off' FSUIPC shouldn't do anything to the weather, correct? Also, FSX internal effects remain untouched?

No options checked = no weather modified. Correct. That includes smoothing disabled mind.

I am asking because the (extended) log shows even then entries like

144239 Turbulence Ranges now Dir 244.83-248.83, Spd 5.39-6.62

144239 Pre- Wind Check: Dir=246.826, Vel=5.98413, X=5.55155, Z=2.3587

144239 Ambient Winds Set: Dir=246.826, Vel=5.984, X=5.501 (2.83m/s), Z=2.35494 (1.211m/s)

You still have that diagnostic logging enabled?

Yes, each time there's a pass through the code which sets the smoothing values, the ranges for turbulence, should it be needed, are recomputed. Since your setting of the wind offsets follows the same path, the same computations are made. but the turbulence won't be simulated with the smoothing switched off -- that's part of another routine.

P.P.S.: Unlike the revived wind offsets we are talking about, the visibility offset 0x2DF0 that is also only hoped-to-be-written in fact does not work, correct? At least, I gave it a try but nothing happened to the visibility.

I could never get that working satisfactorily at all. The code is there but disabled. You can re-enable most of it by setting

PatchVisibilityValues=Yes

in the [General] section of the INI file. If you try it let me know how you get on!

Regards

Pete

Link to comment
Share on other sites

by overwriting the wind values between the WEATHER DLL and the SIM1 simulation engine, none of FS's effect were getting through

If you've seen turbulence whilst controling th winds it will be FSUIPC adding it. Yuo can check that easily by inhibiting it or turning off smoothing.

I confirm this for variance and gusts: they don't seem to work when using the offsets.

But NOT for the turbulence!

And It doesn't matter if FSUIPC's wind smoothing is disabled or enabled and/or its turbulence effects are suppressed.

What makes me really sure about this, is the fact that they only disappear by disabling turbulence within FSX (DisableTurbulence=1). Besides, their strength depends on the fsx.cfg entry TurbulenceScale.

You don't like FSUIPC's? You can change them a bit with the parameters provided you know.

That's not the point. In fact, your effects are most probably really decently simulated.

The problem is, again, that they depend on values or wx station reports within FSX. Thus, I cannot 'control' them, e.g. to realize smooth transitions when flying into regions with gusts or variance.

Another issue: If I use them with FSXWX, I want to fully understand them which means to bother you with a lot more questions... ;)

I could never get that working satisfactorily at all. The code is there but disabled. You can re-enable most of it by setting PatchVisibilityValues=Yes

First experiments with that value made no difference on my side, but I will test it more thoroughly.

Regards

Robert

Link to comment
Share on other sites

I confirm this for variance and gusts: they don't seem to work when using the offsets.

But NOT for the turbulence!

I spent at least two weeks full-time developing and testing a realistic turbulence emulation specifically because the smoothing removed the effect in FSX, and the same was reported by everyone. I had experienced pilots check out my emulation. It was quite an effort. I can't understand how you see differently, unless there's some difference here between versions of FSX.

What makes me really sure about this, is the fact that they only disappear by disabling turbulence within FSX (DisableTurbulence=1). Besides, their strength depends on the fsx.cfg entry TurbulenceScale.

But if that option is disabled the turbulence setting in the weather reports are zeroed, so FSUIPC is not asked to make turbulence.

BTW FSUIPC deals both with wind layer and cloud layer turbulence.

The problem is, again, that they depend on values or wx station reports within FSX. Thus, I cannot 'control' them

Except by setting Global mode and providing a GLOB Metar string through SimConnect or FSUIPC.

Regards

Pete

Link to comment
Share on other sites

Hm, that's really odd.

Just to be sure to be on the same page: With following settings...

fsx.cfg

DisableTurbulence=0

and

http://www.plane-pic...fsuipcwinds.jpg

http://www.plane-pic.../fsxweather.jpg

... I should not get any turbulence effects?

But I get this (with TurbulenceScale=2.000000):

http://www.youtube.com/watch?v=RICNLTUebDg

One thing I noticed: The wind is absolutely steady in the vid, i.e. no variations due to turbulence.

If I re-enable the FSUIPC turbulence effect, I also 'see' the turbulence as fluctuations in the shift-z wind infotext.

unless there's some difference here between versions of FSX.

I also thought of that. Probably, it wouldn't be the first time that FSX behaves different on different PC with the same settings...

My version is:

FSX version: 10.0.61472.0

SimConnect: 10.0.61259.0

Regards

Robert

Link to comment
Share on other sites

Just to be sure to be on the same page: With following settings...

... I should not get any turbulence effects?

Well, I've never got any to notice, and that's also what others said. It's the reason I worked so hard on that aspect.

But I get this (with TurbulenceScale=0.500000):

What are you showing there? Sorry, I don't get it. I don't see any fast turbulence wobbling or jumping.

One thing I noticed: The wind is absolutely steady in the vid, i.e. no variations due to turbulence.

If I re-enable the FSUIPC turbulence effect, I also 'see' the turbulence as fluctuations in the shift-z wind infotext.

And the aircraft doing jiggles and ups/downs (FSUIPC's turbulence operates in all three dimensions).

Maybe whatever you think is happening to you in that flight doesn't happen with airliners? Turbulence should affect airliners too. Maybe fS is simulating some force which I'm not stopping with wind control. You'd probably need to log the X Y Z accelerations and velocities to see what is going on. Certainly the ambient wind isn't changing (the Shift+Z shows ambient).

I also thought of that. Probably, it wouldn't be the first time that FSX behaves different on different PC with the same settings...

My version is:

FSX version: 10.0.61472.0

SimConnect: 10.0.61259.0

You're on SP2, not Acceleration. Might be different I suppose.

Regards

Pete

Link to comment
Share on other sites

What are you showing there?

Well, it shows the turbulences I get even with FSUIPC wind smooting enabled and effects suppressed.

(I replaced it with a new one to show it more clearly.)

These effects happen to all airplanes in FSX, only of course that they are weaker on a 737 than on a Cessna.

Maybe fS is simulating some force which I'm not stopping with wind control. You'd probably need to log the X Y Z accelerations and velocities to see what is going on.

Yes, this guess might be true. So, that would mean that are internal FSX turbulence effects that are not controlled with the wind but by other means. Honestly, I didn't know that yet.

Although I haven't logged the actual accelerations, you can see in the vid that these effects do influence speed and vertical speed (and thus accelerate the a/c).

You're on SP2, not Acceleration. Might be different I suppose.

Just tested it with a clean install of FSX Acceleration. Same as with SP2.

I really wonder if I am the only one with this FSX behaviour, in contrast to "smoothing removed the effect in FSX, and the same was reported by everyone".

Maybe, can a third person who is coincidentally reading this thread can test this aspect?

Thanks in advance!

Regards

Robert

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.