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

Corrupt AGN-Files?

Arno,

I played around a bit and I successfully isolated the one polygon which causes the problems. Additionally I found out that there seems something wrong with the values written by agn2txt, txt2agn and eventually ScenProc.

I did some testing with certain values. I feed the values to txt2agn and compare it with the results I got back with agn2txt and they are quite different:

txt2agn ---> agn2txt
0.1111111 --> 0.111111097037792
0.2222222 --> 0.222222194075584
0.3333333 --> 0.333333313465118
0.4444444 --> 0.444444388151169
0.5555555 --> 0.555555522441864
0.6666666 --> 0.666666626930237
0.7777777 --> 0.777777671813965
0.8888888 --> 0.888888776302338
0.9999999 --> 0.99999988079071

Maybe thats the reason why Annotator writes different values then ScenProc.

Regards,
Heinrich
 
Hi,

Internally scenproc indeed uses doubles. So that would explain the rounding issues. But I find it hard to understand why a small rounding issue would crash FS. In the end there is a still a valid number written in the agn file. If the last digit different slightly should not matter that much.

Got a bit of a cold at the moment, so I didn't have much time yesterday to check this bug.
 
Arno,
I'm really confused as well regarding this issue. Maybe FSX has some kind of bug when reading and computing certain vertex values, I don't know.

Maybe you can give it a try and switch the values to single before you write it to the agn-file.
I know this is a nasty thing but FSX crashes also on other locations during flight, so it seems that other agn-files are affected too. I have more than 40.000 of them, so hunting down each of them would be quite a hard task ;-)

Best regards and get well soon,
Heinrich
 
Hi Heinrich,

Given that George and I don't have such autogen crashes at the moment, could it be that it is not the AGN file but your custom vegetation? Did you test if the crash also happens when you use the default vegetation?

I think the hexadecimal values in the AGN files did not really change, the rounding is the in the string representation of the float or double values. But as long as the AGN file is the same, I don't think that should give FSX trouble.
 
Hi,

Maybe you can give it a try and switch the values to single before you write it to the agn-file.

They have to be converted to a single precision float to write in the AGN file anyway. So that conversion is already happening. The AGN file stores a float, so I can't write a double in it.
 
Arno,

Maybe this causes the problems:

[TERRAIN]
...
IMAGE_PIXELS_FOR_AUTOGEN_POLYGONS=256

Can you take a look at your FSX.CFG? Try to add this entry and see what happens. When I set the value to the default of 16 I have no crashes.

Explanation from the SDK:
Polyline vegetation is rasterized into a sampling bitmap. The granularity of the rasterization is determined by the following setting in the FSX.cfg file:

[TERRAIN]
IMAGE_PIXELS_FOR_AUTOGEN_POLYGONS=16

The value of this setting is set at the minimum, 16, and can be any value up to 2048. The higher the number the more accurately a curved polygon will be rasterized. The value 16 indicates a rasterization of approximately 80 meters down to approximately 0.5 meter accuracy for the 2048 setting. There is a performance penalty with the time it takes to rasterize a region, and the memory required for the resulting sampling bitmap.

I found a value of 256 (4 meters) to be a good compromise between precision and performance, but as soon as I make this value greater than 32 my FSX crashes.

Arno, can you check this?

Regards,
Heinrich
 
Hi,

I didn't modify that setting, so that will mean I have the default value indeed. Let me try my test area with the higher value.
 
Hi,

No crash in my test area if I put the value at 256. But it seems the crash doesn't happen with all tiles for you either.

Still weird that resaving in Annotator fixes the problem. I'll have another look at the AGN files you sent before and see if I can find other difference than the negative zero issue we found before.
 
Arno,

It's that one special polygon, I isolated it:
------------------------------------------------------------------------
Location 011232023222302
Variant 0
GenericBuildingTexture Default
RowHouseTexture Default
BuildingHeights 1 0 0 0
VegetationClasses 0 0
VegetationDensity 0 0
VegetationHeights 0 0 0 0
AGNPolyVegetation {618bfc6b-4642-4035-931e-a422ed357605} 1 0.752206146717072 0.796451091766357 0.752206146717072 0.798805356025696 0.741647660732269 0.80276483297348 0.741647660732269 0.80276483297348 0.725900828838348 0.810547232627869 0.713703811168671 0.808567464351654 0.699686348438263 0.783172249794006 0.692677617073059 0.769518971443176 0.703145265579224 0.761736571788788 0.715433239936829 0.755865633487701 0.752206146717072 0.70299220085144 0.752206146717072 0.699929535388947 0.74548864364624 0.712285935878754 0.706818819046021 0.721178233623505 0.691545367240906 0.724599480628967 0.685669004917145 0.728851675987244 0.684876561164856 0.781260788440704 0.675110340118408 0.785152018070221 0.661183953285217 0.830071449279785 0.638337373733521 0.863249063491821 0.610393583774567 0.869120001792908 0.587638080120087 0.888644278049469 0.598105609416962 0.886732816696167 0.620861113071442 0.898406386375427 0.627869844436646 0.898406386375427 0.655904650688171 0.908236801624298 0.669922113418579 0.906257092952728 0.680389642715454 0.966809630393982 0.687398374080658 0.980462908744812 0.703145265579224 0.990225076675415 0.703145265579224 0.988313555717468 0.671651482582092 0.960938692092896 0.608573138713837 0.962918400764465 0.585817635059357 0.97459203004837 0.570070683956146 0.978483200073242 0.549044549465179 0.994116246700287 0.559603154659271 1 0.573997020721436 1 0.752206146717072
--------------------------------------------------------------------

It doesn't matter what guid or what location I use, it must be the values. I already checked for double vertexes or open polygon, the polygon seems to be valid and I can see it in FSX when I use the default IMAGE_PIXELS_FOR_AUTOGEN_POLYGONS value.
 
Hi,

And for this polygon saving again with annotator still fixed the crash? If so, could you send me the before and after agn for analysis again?
 
This is the same Polygon, saved with Annotator and working:
------------------------------------------------------------------------
Location 011232023222302
Variant 0
GenericBuildingTexture Default
RowHouseTexture Default
BuildingHeights 1 0 0 0
VegetationClasses 0 0
VegetationDensity 0 0
VegetationHeights 0 0 0 0
AGNPolyVegetation {618bfc6b-4642-4035-931e-a422ed357605} 1 0.752206325531006 0.796451210975647 0.752206325531006 0.798805475234985 0.741647720336914 0.802765011787415 0.741647720336914 0.802765011787415 0.725901126861572 0.810547351837158 0.713704109191895 0.808567523956299 0.699686527252197 0.783172249794006 0.69267749786377 0.769518971443176 0.703145503997803 0.761736750602722 0.715433597564697 0.755865812301636 0.752206325531006 0.70299220085144 0.752206325531006 0.699929594993591 0.74548864364624 0.712286114692688 0.7068190574646 0.721178412437439 0.691545486450195 0.724599599838257 0.6856689453125 0.728851795196533 0.684876918792725 0.781260848045349 0.675110340118408 0.785151958465576 0.661184310913086 0.830071449279785 0.6383376121521 0.863249063491821 0.610393524169922 0.869120121002197 0.587638378143311 0.888644337654114 0.598105430603027 0.886732935905457 0.620861530303955 0.898406386375427 0.627870082855225 0.898406386375427 0.655904769897461 0.908236861228943 0.669922351837158 0.906257271766663 0.680389881134033 0.966809749603271 0.687398433685303 0.980462908744812 0.703145503997803 0.990225076675415 0.703145503997803 0.988313674926758 0.671651363372803 0.960938811302185 0.608572959899902 0.962918519973755 0.585817813873291 0.974592208862305 0.570070743560791 0.978483200073242 0.549044609069824 0.994116306304932 0.559603691101074 1 0.573997497558594 1 0.752206325531006
------------------------------------------------------------------------
Attached you will find both compiled versions.
 

Attachments

Thanks, let me see which differences I can find.
 
The only difference I see between the two files is a little bit of rounding of the values. I still don't understand why that would give a crash, but I'll try to replicate the rounding that Annotator does in some way.
 
Hi Heinrich,

I send you a test version by email. I saved the values slightly different to the AGN file, although it still doesn't replicate Annotator completely. Let me know if this helps.
 
Arno,

good news, it is working now, I will compile the rest of my autogen now and let you know.

Regards,
Heinrich
 
Pfew :) Hopefully it works on the other tiles as well.
 
Back
Top