• 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.

FSX Weather Simconnect - Alternatives?

  • Thread starter Thread starter fs1
  • Start date Start date

fs1

Messages
302
Country
argentina
Dear All,

This is my first post here. I know this has been discussed several times but want to give this another approach or twist to this subject.

It's known that Simconnect cannot retrieve clouds position from the sim - SimConnect_WeatherRequestCloudState retrieves only 00s and FFs without any correlation to real cloud positioning. All FSX weather radars today use METAR interpolations to approximate/simulate clouds.

Is there a way to read FSX process memory's directly and retrieve this information? Is there a way to map where FSX stores this information in its memory? Has anyone tried this?

Thanks for the help.

Regards,

Federico Sucari
 
Last edited:
Did you try by first loading a weather theme and then reading clouds state? I believe the way this command works is more related to the way a weather theme is handled by FS, with square cells filled with certain wx parameters (clouds, winds, etc). Programs like OpusFSX use this method instead of typical METAR interpolations.

Tom
 
Tom

Thanks for your reply. I loaded several weather themes and received the SIMCONNECT_RECV_CLOUD_STATE structures. But it is really very fuzzy to correlate them to what you see on the screen. If you analize the data thrown with 00s and FFs, it doesn's seem to represent the clouds drawn.

Then, if you change the cell sizes in your SimConnect_WeatherRequestCloudState request, it seems (I haven't proved this 100%) that the data retrieved differs (for example clouds at certain lat / lon differ if you change the size of the area/cell)

Maybe you can help me out reading this 00s and FFs matrix?

I was thinking of trying to map where the FSX process memory/address holds this data.

Thanks

Federico Sucari
 
Last edited:
Thanks, I agree mgh, SimConnect_WeatherRequestCloudState does not work as expected.

I am looking for other alternatives to catch this information, maybe read directly memory space. Who sets the the clouds in FSX, is it the weather.dll?

Thanks

Federico
 
When using a weather theme it should be possible to obtain a good cloud depiction just by reading the .wtb file that is currently active and extracting cloud info.
As the file is compiled the most basic way I see to decode it is by building one from scratch using the wx theme generator that came with FS9 sdk and inspecting how the compiler makes different code for different cell conditions.
Far from being simple and fast, but feasible.

Tom
 
Tom

Thanks, that could be a good workaround.

Let me ask you: what other weather engines use wtb files other than the weather themes?

Thanks,

Federico
 
I don't know for sure; I guess only wx themes read from a wtb file.
Addons that I know to be using themes are OpusFSX and FS Global Real Weather; REX has it as an option and AFAIK ActiveSky uses the METAR version.

Tom
 
Thanks Tom. Have you already tried to decode the wtb files? I looked at them with an HEX Editor and seems not an easy task - at leat at first sight.
 
No, but I've inspected them with an Hex editor as well. I agree wouldn't be an easy task, but while it remains the only way to advance I guess should be worth the effort.

Tom
 
Thanks Tom.

I will look into this alternative.

Still looking how FSX loads the weather, seems that weather.dll does this job.
 
I have an idea of how to read the cloud matrix provided i can actually get one. The definition of the cloud state struct looks like this:

Code:
struct SIMCONNECT_RECV_CLOUD_STATE : public SIMCONNECT_RECV
{
    DWORD   dwRequestID;
    DWORD   dwArraySize;
    BYTE    rgbData[1];
}

The SDK says it is supposed to be a 64x64 array but i dont see one anywhere. Anyone seen any different?
 
Jonathan
Hope all is well. In fact, you get a matrix, of 00s and FFs but is rubbish, with no correlation to the clouds surrounding the plane.
What were you thinking of?
Thanks
Federico
 
I have an idea of how to read the cloud matrix provided i can actually get one. The definition of the cloud state struct looks like this:

Code:
struct SIMCONNECT_RECV_CLOUD_STATE : public SIMCONNECT_RECV
{
    DWORD   dwRequestID;
    DWORD   dwArraySize;
    BYTE    rgbData[1];
}

The SDK says it is supposed to be a 64x64 array but i dont see one anywhere. Anyone seen any different?

rgbdata[1] gives the address of the first byte of the array.

I tried this a while ago and could only find 0x00 and 0xff being returned. Perhaps someone will have more success than me!
 
Jonathan
Hope all is well. In fact, you get a matrix, of 00s and FFs but is rubbish, with no correlation to the clouds surrounding the plane.
What were you thinking of?
Thanks
Federico

Im pretty sure that it is dependent on how one translates the matrix into a 3D world. After all 2 lat/lon points are not necessarely going to make a square and it also is dependent on how large a bite you try to sample at a time. You might get more accuracy by checking a lot of small areas instead of tracking a lot of large areas. Altitude also has a part to play.

The other thing to remember is that a weather radar isnt necessarely going to detect clouds. It detects precipitation and thats what one should look for. There is a way to do this but it will be more efficient if you assume that precipitation only occurs in a cloud cell and as such you search them only. There would also be some necessary interpretation from nearby weather stations to determine precipitation rates....
 
Last edited:
Im pretty sure that it is dependent on how one translates the matrix into a 3D world. After all 2 lat/lon points are not necessarely going to make a square and it also is dependent on how large a bite you try to sample at a time.

I totally agree, but I tried to transpose the array, and the more you look and look at this array there is no way to make any correlation with clouds. May be you are right but I haven't got any luck with the FFs and 00s...


The other thing to remember is that a weather radar isnt necessarely going to detect clouds. It detects precipitation and thats what one should look for. There is a way to do this but it will be more efficient if you assume that precipitation only occurs in a cloud cell and as such you search them only. There would also be some necessary interpretation from nearby weather stations to determine precipitation rates....

Yes, that's true. I am trying not to use the METAR approach, I think there must be a way of grabbing this data from the Sim.
 
Last edited:
You can grab precipitation from the sim but you cant get its rates. Only thing you can get is whether it is rain or snow.
 
You can grab precipitation from the sim but you cant get its rates. Only thing you can get is whether it is rain or snow.

How do you do this, through reading each METAR or via SimConnect?
 
I found that dwArraySize always returns 4096 = 64 * 64 regardless of the min/max lat, lon and alt values.

It seems possible that the array represents a 2-D blocks (64 * 64) bounded my min/max lat and lon with their height bounded by min/max alt. The origin of the array could be min lat, lon, and alt. However that's purely academic until the cells contain something meaningful.
 
How do you do this, through reading each METAR or via SimConnect?

SimConnect. Not directly...you have to jump through a few hoops using SimConnect but it is possible...I would tell you but then KC would fire me so Im going to have to let you use your imagination on this one.

I found that dwArraySize always returns 4096 = 64 * 64 regardless of the min/max lat, lon and alt values.

It seems possible that the array represents a 2-D blocks (64 * 64) bounded my min/max lat and lon with their height bounded by min/max alt. The origin of the array could be min lat, lon, and alt. However that's purely academic until the cells contain something meaningful.

Well i believe that is the idea....The size of those blocks in feet/miles/meters etc however is going to vary depending on lat/lon since the earth is a sphere. Translating that block into the 3D space, or rather converting 3D space into the necessary 2D blocks determined by lat/lon is the tricky part. Also remember that the cells may or may not contain anything meaningful depending on the size of the area (size in feet/miles/meters etc not bytes). Also the SDK doesnt specify whether the lat/lon alt units are in degrees/radians/feet/meters.

All in all i suspect that GIGO is at play here...the only way to find whether this thing will work properly or not is to find out what is NOT garbage.
 
Last edited:
Back
Top