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

General Purpose ScenProc Script

Messages
42
Hey guys, I have added support for Ortho4XP for fsx/p3d, and have recently added integration with ScenProc to add autogen to the generated scenery (https://github.com/stackTom/Ortho4XP_FSX_P3D). The scenproc integration is still in beta (available under the ScenProc branch of my repository), and bugs are probably there, so use at your own risk :).

Does anyone have a good, general purpose scenproc script file they'd be willing to share? One that gives a decent amount of buildings/vegetation for a decently large amount of areas around the globe, or am I being too optimistic? The default scenproc file I currently provide isn't doing it for me as it produces too little buildings (I got it from a friend) and I am a newbie at using ScenProc and all of it's parameters. Link to current file I provide: https://github.com/stackTom/Ortho4XP_FSX_P3D/blob/ScenProc/ScenProc_configs/default.spc
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,885
Country
netherlands
Hi,

Your script doesn't look too bad if you want something that works on any area of the world based on OSM data. It has some steps in there that are not really used, so you can simplify it a bit more:

Code:
IMPORTOGR|@0@|*|building;landuse;natural;leisure|NOREPROJ
#
SplitGrid|AGN|*|building="*"
#
SETAGNBUILDINGHEIGHT|*|1.0;0.5;0.0;0.0
#creation de la vegetation
CreateAGNPolyVeg|FTYPE="POLYGON" And landuse="forest"|{0053b63d-b2c0-4bd9-9853-d9d21c9ad1fa}
CreateAGNPolyVeg|FTYPE="POLYGON" And natural="scrub"|{2fde0277-1697-4dab-b481-c3985c80596f}
CREATEAGNPOLYVEG|FTYPE="POLYGON" And landuse="orchard"|{56a4998d-c1e5-416c-a37b-c35ce16504b6}
CREATEAGNPOLYVEG|FTYPE="POLYGON" And landuse="conservation"|{bc6396b0-6e51-4a4f-ab4f-5386c84609a6}
CREATEAGNPOLYVEG|FTYPE="POLYGON" And natural="wood"|{dcf543b7-c0d5-4fd4-b970-83965c2911c9}
CREATEAGNPOLYVEG|FTYPE="POLYGON" And leisure="nature_reserve"|{82f0282d-f82d-484c-a640-aac21a69be03}
CREATEAGNPOLYVEG|FTYPE="POLYGON" And leisure="garden"|{2368c260-177d-4af7-94d4-da882778108f}
CREATEAGNPOLYVEG|FTYPE="POLYGON" And natural="tree"|{7dc6ef4e-92a5-4d0d-b94b-212dd1fa936d}
CREATEAGNPOLYVEG|FTYPE="POLYGON" And natural="tree_row"|{a4a30975-075c-49ec-87fb-7e0931cb5004}
CREATEAGNPOLYVEG|FTYPE="POLYGON" And natural="wetland"|{89ed8548-e54f-40ef-9837-7653885d409c}
CREATEAGNPOLYVEG|FTYPE="POLYGON" And leisure="park"|{e04669c0-9f7b-42e8-a2c7-eee870c59d8e}
CREATEAGNPOLYVEG|FTYPE="POLYGON" And leisure="golf"|{2fbf9f8d-6ba2-4cc1-8d8e-af218f65d0e8}
#
# Add attribute to indicate the type of building
# 1 = ALMOST RECTANGLE (BASED ON AREA RATIO)
# 3 = REGULAR SHAPED (MANY PARALLEL EDGES)
# 4 = CONVEX POLYGONS
# 5 = CONCAVE POLYGONS
AddAttribute|FTYPE="POLYGON" And building="*"|Integer;BUILDTYPE|5
AddAttribute|FTYPE="POLYGON" And building="*" And BUILDTYPE=5 And FAREARAT>0.80|Integer;BUILDTYPE|1
AddAttribute|FTYPE="POLYGON" And building="*" And BUILDTYPE=5 And FNUMVERT<10 And FNUMPERPANG>3 And FNUMNOTPAR<2|Integer;BUILDTYPE|3
AddAttribute|FTYPE="POLYGON" And building="*" And BUILDTYPE=5 And FCONVEX=1|Integer;BUILDTYPE|4
#
# Remove complex buildings
ReplacePolygonByBuildingRectangles|BUILDTYPE=3|0.8;4;4|0.25;2.0;0.5|Integer;BUILDTYPE|2
#
# Create buildings autogen
CreateAGNGenBuild|building="*" And FWIDTH<20|{5ae04eb6-934c-4f63-bb48-5e7dee601212}|MAXRATIO=2
CreateAGNGenBuild|building="*" And FWIDTH>20|{6089A0BD-CED1-4c47-9A9E-64CDD0E16983}
#
EXPORTAGN|FSX|@1@

If this script does not give you enough buildings, are you sure that area has enough builidngs in OSM?
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,885
Country
netherlands
Autogen buildings are rectangular, so the scripts filters out weird shapes that are not rectangular or can be split in a few rectangles. You could tune those rules a bit.

If you look at the log file you get an idea how many are filtered out.
 
Messages
3
Country
germany
I ´ve tried the Code above. Everything looks fine, exept higher Buildings (Churches or Power Stations with Cooler). They look a little bit decompressed. I found Chapter 5.7 in the manual and made some changes in the Script to get higher Buildings.
As I´m a Newbie to this I´ve got the Error: urban_area is not a valid filter string. Can somebody point me in the right direction ?
 

Attachments

  • sp-forumV2.txt
    2.4 KB · Views: 351

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,885
Country
netherlands
Hi,

In a filter you need to specify a condition. Area_urban is only a attribute name, so you need to add a condition as well.
 
Messages
3
Country
germany
Hi,
Thanks for your fast Reply. I´ve added a condition now (Attached File). But the Buildings are still small. To save time (One Tile needs about 8 Hours at Full Speed on my 7700k to compute) I took the old bgl files with the new agn files. Does ScenProc affect both files or only one of them ? I Couldn´t find it in the manual. Thanks for your help.
 

Attachments

  • sp-forumV2.txt
    2.4 KB · Views: 281

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,885
Country
netherlands
Hi,

Are you sure your data actually contains polygons for urban areas that have an attribute named building and a value of urban_area?

Check OSM I think residential="urban" is more likely what you are looking for.


Your script only saves AGN files, so it does nothing with BGL files.
 
Messages
3
Country
germany
Hi,
I took urban_area from the manual. Never checked osm - Wiki.
What is the meaning of this warning: More batch variables provided than expected, only 1 will be used
Thanks
 

Attachments

  • sp-forumV4.txt
    2.4 KB · Views: 337

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,885
Country
netherlands
I would have to check where that warning comes from. You run the script in batch mode I guess?
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,885
Country
netherlands
That warning means that you provide more variable when you start up scenProc on the command prompt than the script is actually using. So it's warning you that some are not being used.
 
Messages
21
Country
belgium
Hello, I would like to come back to this discussion. I have been using this updated script and I have had some good results, unlike the default script for Ortho4P3D, which just gave me an empty texture folder without .agn files.
Now the problem with this script is the following, it used to work well, but now it is taking hours and hours just for one tile. It finishes and then repeats. This can happen 4-5 times in a row. It didn't do this the first time, and took like 20 minutes. There are new .agn files appearing though after the 4th time, and sometimes the 2nd and 3rd times give no new. agn files, what is the logic behind this and is there a way to just limit to a single time which gives all the .agn files? Sometimes this script will take like 5 runs (each run taking up to one hour) in a desert area, giving nothing at all. Shouldn't it know that in advance? Looking forward to hear more about this.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,885
Country
netherlands
Hi,

scenproc can only run a script once. So when you say it runs multiple times something else must do that.
 
Messages
15
Country
unitedstates
Hi. I ended up here based on OP's Ortho4XP adaption for P3D. I have version 4 and seem to be stuck on something.

Kind of went through some steps here; when I launch scenProc I see this in the log window

Code:
10:51 AM    CreateTVecAirportBound    Warning        Failed to read terrain.cfg
10:51 AM    CreateTVecExclusion    Warning        Failed to read terrain.cfg
10:51 AM    CreateTVecPark    Warning        Failed to read terrain.cfg
10:51 AM    CreateTVecRailroad    Warning        Failed to read terrain.cfg
10:51 AM    CreateTVecRoad    Warning        Failed to read terrain.cfg
10:51 AM    CreateTVecRoad    Warning        Failed to read terrain.cfg
10:51 AM    CreateTVecShoreline    Warning        Failed to read terrain.cfg
10:51 AM    CreateTVecStream    Warning        Failed to read terrain.cfg
10:51 AM    CreateTVecUtility    Warning        Failed to read terrain.cfg
10:51 AM    CreateTVecWaterPoly    Warning        Failed to read terrain.cfg

I used both kjii's original script (above) and the one posted arno.

When I run through I get about 662 .agn files in my 'texture' folder.

I add scenery to my world; load up; and I get the ortho texture but zero autogen. All I see is airport buildings and that is all -- my autogen settings are maxed out.

Are the errors 'terrain.cfg' causing the problem?

Thanks for help!
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,885
Country
netherlands
Hi,

No, those warnings are only related with the code completion inside scenproc.

How does your event log look when you make the autogen?
 
Messages
15
Country
unitedstates
Where do I find log and which one? scenProc log or Ortho log?

Sorry I'm newbie to P3D side of this.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,885
Country
netherlands
The scenproc log, it is shown at the bottom of the screen when you run your script.
 
Top