• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Overwriting FSX variable

Messages
24
Country
germany
Does anybody know how overwriting FSX variables is managed?

I try to do something with simconnect to make thermal lift. I could manage already something reasonable, by directly increasing the planes altitude by a certain amount per frame. However the flight model and all instrumentation is totally unaffected by this. Apparently, the vario variable gets its information directly from the flight model, using speed and polar data to calculate the sink, possibly including external wind, which is currently unwriteable.

In order to make the vario reading approriate, I tried to poke the vertical airplance speed + my simulated lift into that variable. The outcome is however not satisfying. Even if trigger this by a SIMCONNECT_PERIOD_SIM_FRAME, the vario gauge still jutters between the poked value and the "polar result".

It seems somewhat pointless to offer variables for writing, if the rewriting is not suspended then.

Does anybody know a recommend way to handle this?

Cheers,
Peter
 
I try to do something with simconnect to make thermal lift. I could manage already something reasonable, by directly increasing the planes altitude by a certain amount per frame.

Altitude is a result of movement, which is a result of thrust, velocity, acceleration ... you want to try controlling the causes, not the results which will always be re-computed from the unchanged causes.

In FS9 and before we could provide thermal lift by altering the Y-axis wind value, which was the most realistic way -- FSUIPC was writing this directly into the Sim Engine. Similar facilities are on the list of omissions in SimConnect I've supplied to MS and I am hoping that we will see such things some time in the future. Don't know when though.

Meanwhile, these assorted Sim Var velocities are actually writeable already:

"ACCELERATION BODY X"
"ACCELERATION BODY Y"
"ACCELERATION BODY Z"
"VELOCITY BODY Z"
"VELOCITY BODY X"
"VELOCITY BODY Y"
"ROTATION VELOCITY BODY X"
"ROTATION VELOCITY BODY Z"
"ROTATION VELOCITY BODY Y"
"VELOCITY WORLD Z"
"VELOCITY WORLD X"
"VELOCITY WORLD Y"
"ACCELERATION WORLD X"
"ACCELERATION WORLD Y"
"ACCELERATION WORLD Z"

For a vertical effect you need to be thinking in terms of WORLD Y changes -- X is lateral, Z is longitudinal, Y is vertical. The "WORLD" values are relative to the world, the body ones relative to the aircraft's orientation.

I really don't know whether these will have any effect. It won't be lasting, but re-application regularly should give you an approximation of lift. Worth trying?

Regards

Pete
 
Hi Pete,

thank you for the comments. Actually, it seems that the handling of user input over simconnect is a bit screwed up. What I experienced so far is the following:

Writing into "World" velocities has usually not the desired effect.
Writing into "Body" velocities results into a sudden jump to the desired velocities, which relaxes slowly to the previous flight attitude, what could be expected.
Writing into "World" location results in the desired effect.
No experience with accelerations yet.

It seems to me that the primary flight model runs in body space coordinates, resulting into body acceleration. This is integrated into body speed. The body speed is transformed into world speed, and, then, integrated into world coordinates.

In general, probably you can affect all integrators with a permanent effect, because the integration continues where your action has left it. Therefor I was successful in modifying the world Y coordinate, and the body y velocity,too.

In contrast, altering immediate results, which are world velocities, and probably also body accelerations, depend on the exact moment of writing into it.

If it comes before the integration step, but after the update through the flight model and sim engine, it should work as expected, i.e. the overwrite becomes effective until it is replaced during the next simulation frame. If the writing comes first, then the update of the sim engine, then the integration step it won't be effective at all. Unfortunately, nothing is exposed about the timing of writing variables, and controlling it by MS.

Changing acceleration is therefore critical, because has to be done with a critical relation to the sim engine. There is also another shortfall, with respect to mimic of thermals. I found this, while writing into the Body y speed variable. Assume want to produce a lift of 1 m/s. If you simply adjust the vertical body speed to +1m/s rather then the initial, say -0.75 m/s, the effective body wind vector comes now from above forward, instead from lower forward, as if you are in inverted flight. The correct response of the polar is, that you have to push like something to keep it running.

In fact, I'm halfway happy, if I can modify the altitude directly. Together with the initial adjustment of the vertical body speed, it is not so bad. My current problem is more that I cannot get a correct reading of the vario, because the vertical speed variable, though it is writeable, is 50 by 50 effectively overwritten by the sim-engine before the gauge has evaluated it.

regards,
Peter
 
... it seems that the handling of user input over simconnect is a bit screwed up.

Yes, I didn't expect Microsoft to have given us really easy hooks, only programmable versions of the direct hacked access I provided in previous versions of FS via FSUIPC -- assuming those folks who used them found how to use them to some advantage.

Continued experimentation with what we have is important, I think. If and when you come to specific conclusions maybe we can get more changes into SimConnect over time -- you need to be quite specific, with reasons.

I feel that for lift, turbulence and other such effects, manipulating the local wind vectors is really the way to go, and such facilities are at the top of my list of outstanding requests with MS. It was those abilities which also allowed me to implement proper wind smoothing in FSUIPC3, something sorely missed at present in FSX.

Regards

Pete
 
As far as I know, MS tends to pay some attention to your suggestions, so I'm hopeful to find it considered in the upcoming SP2/DX10 package.

best regards,
Peter
 
As far as I know, MS tends to pay some attention to your suggestions, so I'm hopeful to find it considered in the upcoming SP2/DX10 package.

I'm not that optimistic! There will be major improvements, but we're basically still in the bug-fixing and better-performance stages. I'd not expect new SimConnect facilities so early.

Regards

Pete
 
Back
Top