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

[FS2004] Scenproc autogen causes FS9 crash

Messages
10
Hi Arno,

First: Many, many thanks for adding FS9 support to scenproc et al!

Unfortunately, I've run into a problem. The autogen I've generated with scenproc causes FS9 to crash. It encounters an error at 29% loaded, then it's goodnight Vienna.

I looked at some scenproc-generated tiles with AGenT, and believe the crash is caused by some tiles where scenproc has placed autogen outside the tile boundary. I tested a single tile, which I knew to have no autogen outside of limits, and it worked beautifully.

Would you be able to have a look at this? I can provide example .agn files if necessary.

Thanks for any advice you can give!

R
 
Hi,

If you have some test files for me and the scenproc configuration you used I'll have a look. When I tested fs2004 here I had no crash.
 
Sure :)

I've attached a .zip file to the post. It contains the .agn file I mentioned which works, and one which causes a crash.

I wonder if the crash is related to the amount of autogen on the tile. The crashing tile has no autogen beyond its edges, but clearly has far more than 600 instances of vegetation, which is the FS9 limit. Oddly, I thought FS9 was meant to display 600 and ignore the rest, so there shouldn't be a problem with this tile...

The zip also contains the script that I used. Obviously, I'm running it in FS9 mode.

Many thanks, Arno!

Cheers

R

P.S. I think the tooltips are really neat! My favourite is the one which tells you which vegetation type you're using in SETAGNVEGETATIONSETTINGS.
 

Attachments

Hi,

Without the BGL file I can't test it here of course. But looking at the SPC file, you might want to try to change the SPLITGRID step. You added a filter that to not split the features from your file. This means that the polygons can stay bigger than the autogen tile. For buidlings you often want to do this (to prevent them being sliced into two small buildings), but for vegetation I would not use it.

Code:
# MachVeg
IMPORTSHP|MachVeg2b.shp|-4.2;-3.2;52.37;52.95|NOREPROJ
#
SPLITGRID|AGN
# Assume woodland mix of 75.3% evergreen (2) and 24.6% broadleaved (1) based on shp areas
SETAGNVEGETATIONSETTINGS|1|2|0.246|1|18;24|18;24
#
REPLACEPOLYGONBYVEGETATIONRECTANGLES|FROMFILE=MachVeg2b.shp|0.00025|0.25|0.1
# 
CREATEAGNRECTVEG|FROMFILE=MachVeg2b.shp
#
WRITEAGNFILES|FS2004|E:\Program Files\VisualFlight\VFREWPart2Vol3North\texture
 
The one which crashes has 6280 vegetation squares. This is way more than can be handled by FS9.
 
Chaps,

Thanks for the tips and your help. Implemented but not yet tested - as the script needs an eye-watering 8 hours to finish! I'll set it running overnight.

Arno, is there any way I can limit scenProc to writing 600 vegetation squares within the program itself? (I presume this is where the problem lies, but may be wrong.) Short of that, I'll try to write a MATLAB script to decimate the vegetation on a file-by-file basis, but I'd rather be able to achieve this in scenProc.

Cheers guys!

R
 
Hi,

if It can help...

I've just add an option in "AGN Merge tool" to limit the number of Rectangular Vegetation Poly (random function).

I will post this new version soon...
 
Oh, excellent, Vogel!

Saves me from having to write the function myself. Brilliant! Thank you so much :)

R
 
Hi,

Be aware that with the bug in your configuration file that I pointed out earlier the vegetation rectangles would not be split correctly. So that would means much more vegetation is created than you can actually see.

Also, if you want less vegetation, you can use a bigger rectangle size in the step that creates the rectangles. With your current settings each vegetation rectangle is 0.00025 x 0.00025 degrees. If your tile is completely covered with vegetation that is too much indeed (would give you around 3000 rectangles). You are probably better of with a size of 0.0005 in that case.

8 hours of processing time is a lot. Is it is a very big area you are processing?
 
Arno is right... I don't know exaclty how scenproc create AGN tile from other osm or shp file but may be some Poly are out of the Tile range (-1,1) cause of bad SplitGrid setup !? it could be the cause of crash :confused:

I try your agn file in AGN merge tool....

here there is the "crashing" AGN file:
capt_crash.jpg


and the same with a limited RectVegetation at 600.
capt_crash_limit600.jpg


you can compare it with the "working" AGN file:
capt_work.jpg


in the first case the number of poly seems to be up the FS9 limit ?! and some poly seems to be out of the Tile.

in the second case the number of poly is ok and no poly seems to be out of the Tile.

the cause of the crash can be the twice:
1/ FS9 polygon Veget limit exceded (should be solved with the new AGN merge tool option)
2/ polygon out of the Tile (I can add an option to delete this type of poly if needed but I think a good SplitGrid setup in scenproc would be much efficient as Arno said).

here a link to AGN Merge Tool v2.17b
 
Last edited:
Chaps,

Arno,

Thank you very much for your help! I changed my SPLITGRID settings as you suggested, and the processing time shrivelled to just 50 minutes. I will increase the vegetation rectangle size for my next run as I am concerned about the sparse coverage shown when decimating small tiles (hadn't thought of that.)

The area in question is large - about two-thirds a degree of latitude by a degree of longitude - perhaps the size of the isle of Anglesey in Wales. It's circular, centred on the famous 'Mach Loop' low flying route, which is the focus of the project :)

Vogel,

Thank you so much! I will use v2.17b to prune my tiles after increasing the size of the vegetation rectangles - I think this will be a very useful feature.

I have tried the newly SPLITGRID-ed autogen in sim; there are still some tiles with corners defined outside the tile; and it crashed, so the jury is still out on the cause.

Well, let's keep moving! I'll make those changes, do some gardening, and report back :)

Cheers

R

EDIT: I did a quick test with a single tile where some vegetation rectangles are almost, but not quite, outside limits, and the vegetation count is below 600. No problems - looks lovely. Make of that what you will :)
 
Last edited:
Chaps,

Vogel,

I ran my tileset through AGN Merge Tool and found the option to limit the number of vegetation rectangles. So far, so good. But the program keeps crashing during conversion with an error along the lines of 'txt2agn has encountered a problem and needs to close.' Any ideas what could be wrong?

Cheers!

R
 
Hi Argy,
Crash it at start ? Or do you obtain some AGN file into Merge folder? Can you post some AGN wich crash the Tool ? I will see if I can reproduce the bug....
Thx Vogel
 
Hi chaps!

Stop the press, I can finally report success! (Of a sort
evil.gif
)

It seems that for FS9 you must (a) use SPLITGRID|AGN

and (b) choose a vegetation square size that gives less than 800 (as a liberal estimate) squares per tile. FS9 will only display 600, but it appears to crash if you make it try to process more than 1000 squares.

I am really rather pleased with the results.

Pics to come

Vogel,

Merge Tool seems to read the agn files just right. It only crashes when trying to write them with txt2agn. It seems to crash for every tile. I will upload a few soon for you in any case.

Arno,

I think there's a small bug in scenProc. My autogen forests are close, but not quite in alignment with the tiles. At first I thought the cause was simple - a dodgy projection - but on inspection of some tiles, it's clear that scenProc thinks the centre of the tile is somewhat further south than it should be, and writing the vegetation squares accordingly. Have a look at these screens from AGenT. The tile boundary is shown in red, the neighbouring tiles are shown outside the boundary, and the vegetation squares in green:

Clearly moving the vegetation squares north (up) one square length or so would align the autogen perfectly with the tile:

mlldp4.jpg


I thought this was a simple reprojection error; my shapefile thinks the forests are too far south. But have a look at this:

16hoq9t.jpg


and this:

k1caz8.jpg


If there was a reprojection error, you'd expect the very top of each of those last tiles to have vegetation squares too, since the forest extends way outside the tile boundary to the north. They'd just be in the wrong place. But they haven't, and the fact the squares at the top of each tile are so neatly cut off along the horizontal suggests that scenProc is shifting the vegetation south: which also explains why there is off-tile vegetation along the southern border of the tile.

Every single forest that I've looked at is misaligned like this.

What do you think? :)

Cheers!

R
 
Last edited:
Hi,

I'll have to check. I think you are right that the algorithm that replaces the polygons by rectangles might indeed create rectangles that go outside of the original polygon and the tile. If this gives trouble in fs2004 I need to fix that.
 
Hi,

Another idea. It is probably better to put the REPLACEPOLYGONBYVEGETATIONRECTANGLE step before the SPLITGRID step. I think you will get better results in that case.
 
Hi Arno,

Almost :) You can see that the top of the tile now has some coverage (which appears to be data cut off from the tile above) yet the autogen forest is still out of alignment as before:

15dq2pj.jpg


In addition, the processing time rocketed again - this time to about five hours. With SPLITGRID before REPLACEPOLYGONBYVEGETATIONRECTANGLE, the job is done in about 30-40 minutes.

To both of you, I'm very grateful for your support so far. Thank you.

R
 
Hi,

I'll grab some shapefile here and see if I can reproduce your issues with the offset. Might be a bug.
 
Hi,

I have updated the algorithm that creates the rectangles. They should now stay better inside the tiles. The only exception is that based on the random factor you give they can get a little bit outside. So if you don't want that at all, you better set the random factor to 0.

The new algorithm will be in the development release of tomorrow.
 
Hi Arno,

Thank you! I will set the new algorithm running tonight and see how it gets on.

Cheers :D

R
 
Back
Top