• 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 FSX AGN format

GHD

Messages
12,244
Country
england
Has anyone decoded the VGRD record in an FSX format agn file?

It contains 32 bytes and seems to be two GUIDs, but what do they mean?
 
Last edited:
They are not GUIDs, the first four words are integers representing:

Vegetation type 1
Vegetation type 2
Relative density of type 1
Relatibe density of type 2

I would have expected the next four words to be floats:

Minimum height for type 1
Maximum height for type 1
Minimum height for type 2
Maximum height for type 2

But this doesn't seem true, they contain hex values:

#00004041
#0000c041
#00004041
#0000c041

The equivalent FS9 format fields are integers

12
24
12
24

So it seems that #00004041 is 12 and #0000c041 is 24 :confused:
 
Hi George,

Yes, 00004041 is the hex representation of 12.0 and 0000c041 is 24.0 as a float. So that is right.

Once you have figured it out, will you update the information in the Wiki about the AGN format?
 
Hi Arno,

Thanks for your input. I must have a problem in my C++ code. This is what I use to print four bytes in hex, integer and float format:

Code:
void GenPrint(int v)
{
  unsigned char c1;
  unsigned char c2;
  unsigned char c3;
  unsigned char c4;
  typedef union
  {
    int i;
    float f;
    unsigned char c[4];
  } ALL;

  ALL w;

  w.i = v;
  c1 = w.c[0];
  c2 = w.c[1];
  c3 = w.c[2];
  c4 = w.c[3];

  TRACE("#%02x%02x%02x%02x    %d    %f\n", c1, c2, c3, c4, w.i, w.i, w.f);

}

The hex and integer output is correct. but the output of all floats is 0.0:

Code:
#01000000    1    0.000000
#02000000    2    0.000000
#58000000    88    0.000000
#64000000    100    0.000000
#00004041    1094713344    0.000000
#0000c041    1103101952    0.000000
#00004041    1094713344    0.000000
#0000c041    1103101952    0.000000

I would be grateful if you could tell me where am I going wrong.
 
Hi,

Could it be that you have w.i twice in the TRACE command? So I think your float is never printed to text.
 
Hi,

Could it be that you have w.i twice in the TRACE command? So I think your float is never printed to text.

:o I just realised :o

I have now decoded FSX format files containing vegetation rectagles. What is interesting is that there is no definition of the vegetation type other than the integers 1 and 2 indicating deciduous and coniferous.

The next and more difficult phase is to decode polygon areas, buildings and library objects. Still continuing the investigation.
 
Last edited:
I assume you saw this article already, which has part the vegetation polygons explained already.
 
I assume you saw this article already, which has part the vegetation polygons explained already.

No, I hadn't seen that article. The section VGRG may contain information on pre-FSX style rectangulat vegetation regions, but all of the files I have examined have VGRD and VGRO section containing this information:

 
Back
Top