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

P3D v4 MAXRATIO values

Messages
11
Country
spain
Hello, did anyone try non-integer values for the MAXRATIO parameter applied to CreateAGNGenBuild step?. I tried the same script in two different computers with the same base data and I get odd results: one of the scripts runs without problem and the other returns an error ("The MAXRATIO value should have a value bigger than 1.0"). In the successful case, the only difference between a "bigger than 1.0" value and fractional one is that some of the buildings are splitted relative to their width instead of their length. I've revised the documentation but didn't found anything about the valid values of this parameter.

The second is more a doubt: is it possible to create autogen in Scenproc directly from a classified raster (ie. a raster coded with integer values that represent for example types of vegetation) instead of a vectorial source? That way I could avoid the hard processing step of convert a big raster to a massive vector layer, which sometimes even scenproc cannot load.

Thanks a lot

Luis
 
Hi Luis,

What kind of MAXRATIO value did you use? It should work with non integer values I think. I'll have to check the code.

Autogen is stored as vector data in the agn file. So scenproc can only make it from vector data.

But if you have an already coded raster it should be easy to turn it into vectors.
 
Hi, Arno. I use a value of 0.5 or 0.53. Even this minimal modification makes some difference in the final amount of buildings. I attached the log of scenproc with the errors.

Regarding the raster, it's a pity, specially if you use rasters to make several calculations prior to use scenproc. Yes, I know that I can turn the raster into vectors using a GIS. In most parts of Spain the trees tend to grow separated one from another, except in the north, where they are grouped in forests. With a lot of isolated trees, the number of polygons created in the vector layers, and the time to generate them from the raster, grow exponentially.

Thanks a lot

Luis
 

Attachments

Hi,

You can't use a MAXRATIO value that is less than 1.0, that is what the error message says. So both 0.5 and 0.53 are not valid. But you can use non-integer values that are bigger than 1.0.

Let's assume you have a polygon that is 200 meters long and 10 meters wide. With a MAXRATIO value of 2.0 this would be turned into 10 buildings of 20 x 10 meters in size. But if you use a MAXRATIO of 2.5 you would get 8 buildings of 25 x 10 meters in size. And if you use a MAXRATIO of 4.0 you would get 5 buildings of 40 x 10 meters in size. So non-integer values do work and different values are supposed to give a different number of buildings.

As for the raster, you could also let scenProc do the vectorization. With the DetectFeatures step you can read the raster and create polygons from it. If your raster has some simple color coding, the texture filter to be used in the DetectFeatures step is not that hard to make.
 
Hi, Arno. Thanks for your answer. I know that it's possible to use non-integer values bigger than one, as I've seen several examples in this forum, but suppose you have a square building and you need to divide it because it is very big and its appearance in the simulator is ugly. In that case, a MAXRATIO value bigger than one doesn't have any effect as the ratio between length and width is already one. I found that the only workaround to bypass this issue is to use a value below one for MAXRATIO, which divides the more or less squared footprints into at least two buildings. The question that is driving me mad is if MAXRATIO values below one are not valid in scenproc, why the script works in two different computers and fails in another one?.

The three systems are using the developer version of scenproc that was released in july. I attach the entire script if you want to load it in your systems.

Regarding the use of scenproc to vectorize the raster source, I'll make some tests to see if there's any advantage in time against a GIS application. Thanks for the suggestion.

Luis
 

Attachments

The error is supposed to trigger on all machines. Could it be the regional settings (decimal character) is different on the machines?

Splitting a rectangular building was not something I had in mind when I coded the MAXRATIO functionality, but I understand what you are trying to do. Let me check if allowing values below 1 makes sense for that case or if it gives negative side effects.
 
Right now, I'm away from the computer where the error appear. I'll check the decimal character of this computer as soon as possible, but I'm sure that the two computers without the error have regional settings set to spanish (dot for thousand separator and comma for decimal). In fact, I already execute the script I left in my last reply in the computer I'm using to write in the forum (with spanish regional settings) and scenproc only give me the known error about regional settings and XtoMDL. The resulting log is attached to this reply so you can see that it's the only error that scenproc return and it creates the autogen buildings without problem (3d buildings are other story, but the problems one by one...).

I'll try to change the regional settings in the computer I'm using and see if I can replicate the error.

EDIT: I've just modified the regional settings to english (comma as thousand separator and dot as decimal separator) and your guess was correct: in this case the error appears in each line with MAXRATIO values equal or smaller than one. So the spanish regional settings allow me to use MAXRATIO values smaller than one, strange, isn't it?. This also have a second derivative: I cannot create 3d buildings in the same scenproc script if I want to use also MAXRATIOs below one. Perhaps I'll have to do the autogen buildings with spanish settings in one script and 3d buildings with english ones in another script.

Thanks
 

Attachments

Last edited:
Sounds like a bug that the decimal character influences the validation. I'll check that.

And like I said, I'll see if the limitation that MAXRATIO should be bigger than 1 can be lifted.
 
Back
Top