Some friendly suggestions for improvements

General discussion about Scenery Design. Questions about SBuilder for Flight Simulator FS2004.
Post Reply
Jan Nielsen
Posts: 22
Joined: Sun May 16, 2004 7:18 pm
Location: Norway

Some friendly suggestions for improvements

Post by Jan Nielsen » Mon May 31, 2004 3:10 am

Hi Luis,
I have had the pleasure to work with your excellent program for a while and I would like to make some friendly suggestions for improvements.

My interest has been to improve parts of the representation of the Norwegian west Coast. I have worked with two different cells in particular. The Cell 394x80 in HP949100.bgl surrounding the Floro airport and the the Cell 397x77 in HP949090.bgl situated straight northeast of the Vigra airport (Town is Alesund). In the latter Vigra case two major islands near the airport and significant obstacles in the approach with heights over 2000ft are missing. Also for both the cells, Sherries and coastlines are very complex making the simple default FS9 landscape unrecognizable.
I therefore turned to the NGDC Coastline Extractor hosted at the
http://rimmer.ngdc.noaa.gov/mgg/coast/getcoast.html I extracted coast data in Mapgen format as Zip files and wrote a small utility in VB that turned this data into the required BLN format. However, I had to add some points to some of the lines making it all polygons so that ScBuilder could read all of it as polygons directly. Polygons were what I wanted.
However doing it in this way, made it possible and easy to make land polygons. With the latest versions of the ScBuilder I can set the properties for all the polygons while they are read in from the BLN file. However to make a coastline I had to right click on all the polygons and click the make line button. Thereafter I exported the file as BLN and imported it back in a new project then being able to set the coastline properties directly. However the coastline did not reach all the way around the polygons.
In order to make the elevation pop up in the right places I had to wipe out the data in the topical Cells and replacing the data with four water areafills16x16 and LMWDataAreaHeights set to -9999, 0 . I also had to make new landclass files to fill in land where there was only water by default.
There are at least two disadvantages of this method. First, the land polygons will not show in the GPS map. Secondly, the water floats freely up hill.
When I started with the remodeling of the Floro area I used the G2k4 program and made land polygons. I did not use the Coast extractor data but drew the polygons on a scanned background map. I then decompiled the file with Jim Keirs LWMViever program and used the data to invert the file in Excel and with Notepad to a new Poly3 water polygon file, with the style of the original HP949100.bgl . I then replaced the topical areas with the new ones and recompiled the file making a new HP949100.bgl. This worked fine but it was a lot of work. In fact it is too much work to accomplish the task at hand. I am talking about replacing all the LOD13 areas in a LOD8 cell. I believe this option existed in a previous program called Coastlinedraw or something. Islands seem to cause a problem for some of the program developers. I don’t think this problem is quite impossible to overcome. After all I have managed to invert some rather complex areas by hand and the procedure seems to be straight forward and repeatable. Btw, I used both the types of Poly3, Poly3Ex as well as LWMDataAreaDrawPolygonsEx in this effort.

So here are my suggestions:
1. To make it easier to make coastlines around the polygons can you make it a possible option to define a line around all the polygons ( and all the way around the polygon) while reading them from a BLN file directly?
2. Could you consider making an inversion option that could make it possible to invert LOD13 areas with land polygons into areas with the fs9 type poly3 water polygons?
3. When there are more than one polygon, could you consider grouping all the polygons under one LWMDataAreaDrawPolygons or one LWMDataAreaDrawPolygonsEx using the polycount option. This will make it easier to edit on a decompiled file.
4. Would it not be nice if one could load bgl data from bgl files directly as input trough some import feature like that for the BLN files? Would you consider making such an option?
5. Please update the SBuilder Updates thread in this forum. I believe the last version now is ver 1.07 but in the forum, the latest version is ver 1.06a.

Most friendly regards, Jan



Image

Floro with the new land polygons. The Islands further out were made from Coastal extractor data using Scbuilder. Lago Mesh for Scandinavia and a self-made LOD11 mesh for the Floro and the closer Brandsoy are used.





Image

Default scenery in the same perspective as above. Lago mesh for Scandinavia is used though.




Image

The file with inverted polygons in the Floro area



Image

The original polygons for Floro area

User avatar
Luis Sa
Posts: 1736
Joined: Sun May 18, 2003 11:17 am
Location: Portugal
Contact:

Post by Luis Sa » Mon May 31, 2004 7:02 am

Jans,

Thank you for the feedback! I need to read it carefully. Then I will come back.

By the way - I have written Jim (author of LWMViewer) asking him to make an export of the BGLs in XY ASCII (BLN for example). That was the simpler way to get BGL inside SBuilder. He neither said yes nor no! I hope he writes that export facility to LWMViewer.

I will make the correction on version 107!

Regards, Luis

Jan Nielsen
Posts: 22
Joined: Sun May 16, 2004 7:18 pm
Location: Norway

Post by Jan Nielsen » Mon May 31, 2004 8:31 am

Hi again Luis,
thank you for reading my message. I am looking forward to be hearing from you.
Best regards Jan

User avatar
Luis Sa
Posts: 1736
Joined: Sun May 18, 2003 11:17 am
Location: Portugal
Contact:

Post by Luis Sa » Mon May 31, 2004 8:47 pm

Jan,

I will add a line to the INI file

MakeLineAsPoly=True/False

meaning, when True, the line made from a N-Point Poly will have N+1 points.

Also I will add a check box on the BLN import sheet named "import polys as lines". Then when you want to make the shorelines for polygons you will export all polygons in BLN. Then you import them again. This will work in conjunction with MakeLineAsPoly=True.

I will also make BLN more robust in order to read the coastline extractor files without requiring extra scripts.

I could not follow your ideas on the inversion of LOD13 squares as I am not familiar with the ASM commands. I use SCASM. I also think that I can not change the grouping of polygons. Please refer to the SCASM terrain docs and explain again the idea.

Another thing that i did not understood: are you saying that covering a LOD13 area with a AreaFill (mask=water alt=-9999) and then placing landclasses over that LOD13 will remove any pre-existing flattens? Can I then add lakes without seeing the flattens of the previous existing lakes ?

Thank you very much for the suggestions!

Luis

Jan Nielsen
Posts: 22
Joined: Sun May 16, 2004 7:18 pm
Location: Norway

Post by Jan Nielsen » Tue Jun 01, 2004 5:19 am

Hi Luis, thanks for your kind answer.

1. That MakeLineAsPoly=True. etc will probably solve the problem. Please remember that BLN line segments that are automatically defined as polygons by ScBuilder are those with the first and last point being equal e.g. the first point is repeated. However those endpoints should be deleted as they are not necessary in order to close a LWM polygon in the bgl file.
2.
>>I could not follow your ideas on the inversion of LOD13 squares as I am >>not familiar with the ASM commands.

The reason why I want to do this is to manipulate the original HP9?????.bgl file. I want to do this because it is the only way to remove the flattening effect of these files. Using Jim Keir’s LWMViewer program one can decompile the original files. Thereafter one can replace or totally remove the content of any number of LOD8 cells or parts of such cells. The recompiled replacement file will then have to substitute the original file in the fs9 scenery folder. It is of course advisable to make a backup of the original prior to this substitution.

When I import BLN files with polygons, the ScBuild program makes definitions for the interior of those polygons. Such a polygon could be the circumference of an island in the sea, in witch case the polygon would be defined as land. However, it could also be a lake surrounded by land, in which case it will be defined as water. This is all very well, but suppose you want to define the surrounding water or land of the BLN polygon? Then what you need to draw is not the closed BLN polygon but the complementary polygon or polygons in the lod13 area. I’ll show you with some pictures:


Image

This is a snapshot from LWMviewer showing a LOD13 AREA with two land polygons drawn directly from imported BLN Coast extractor files using ScBuilder.



Image
This is the same LOD13 area as above showing the complementary water polygon similar to the style of the original HP9?????.bgl Using Poly3 polygons.
This inversion was done manually though, and it is simply to much work when a whole LOD8 cell is to be substituted, see the picture below.


Image

Cell 397x77 replacement for the HP949090.bgl
Now compare this with the original cell397x77 below.


Image

Compare this with picture above and you’ll see why I want to replace original data.


One way of solving this could be if you had different drawing layers in your program, allowing us to draw new polygons in between existing polygons preferably with a snap to point option. Adjacent polygons should be allowed to share points such that the edges of adjacent polygons would meet and thereby fill the space between them completely without overlapping.

3.
>>I use SCASM. I also think that I can not change the grouping of polygons. >>Please refer to the SCASM terrain docs and explain again the idea.

From the Scasm manual:
LWMAreaDrawPoly( n t col row )
n Number of the following polygons.

When you have more than one polygon in an area, my suggestion is to use the “n” parameter above instead of repeating the above command several places in the file, once for every polygon in the LOD13 area. This way you will keep the data tight together making tweaking of decompiled files easier.
4.
>>Another thing that i did not understood: are you saying that covering a >>LOD13 area with a AreaFill (mask=water alt=-9999) and then placing >>landclasses over that LOD13 will remove any pre-existing flattens? Can I >>then add lakes without seeing the flattens of the previous existing lakes ?

I’m afraid you misunderstood here. The only way you can remove the flattening effect of the HP9?????.bgl files is to replace the content of these original files. This can only be achieved by first decompiling the topical original HP9?????.bgl file and then removing or replacing content in the decompiled file. In the case of LOD8 cell 397x77 in the HP99090.bgl I replaced the complete content of that cell with the following commands:

; Start of cell 397 x 77 data
CELLSTART_000005 label word
CellID_000005 EQU LWMCellID 0, 0, _Transparent_, 397, 77
LWMDataAreaFill16x16 0, _Water_, 0, 1, 0, 0, 0
LWMDataAreaHeight -9999, 0
LWMDataAreaFill16x16 0, _Water_, 0, 1, 1, 0, 0
LWMDataAreaHeight -9999, 0
LWMDataAreaFill16x16 0, _Water_, 0, 1, 0, 0, 1
LWMDataAreaHeight -9999, 0
LWMDataAreaFill16x16 0, _Water_, 0, 1, 1, 0, 1
LWMDataAreaHeight -9999, 0
CELLEND_000005 label word
; End of cell 397 x 77 data

Now in Scasm the commands:

LWMDataAreaFill16x16 0, _Water_, 0, 1, 1, 0, 1
LWMDataAreaHeight -9999, 0

Translates to:

LWMAreaFill( 16 0 1 1 -9999 )

I haven’t tried this with Scasm though.

Setting the height to -9999 is documented in the FS2004 Terrain SDK
page 26.

Quote:

The LWMDataAreaHeight structure contains only 2 values: a height and a fraction. The iHeight represents the integer based meter to which to flatten. The iFraction value of this structure contains a decimal portion of the height multiplied by 128. The reconstructed height will be iHeight + (iFraction / 128).

If you do not know the elevation of a body of water, you can set iHeight to -9999 and iFraction to 0. Doing so will tell Flight Simulator to just cut a hole into the land without setting the elevation.

End of quote.


It is reported that the areafills will stall the simulator when used on top of default data. However in this case the default data is totally replaced and then it seems to work without problems. Only Areafills can be used in this way in a file containing the Poly3 structures, eg LWMFileHeader( version ) is set to 0x300. As mentioned before the disadvantages of this method is that land polygons will not show in the simulated GPS map, and water may float freely up hill. Now to make the landpolygons to show on top of the areafills one must ensure that the new land is supported with land tiles in the respective places, hence the need for a landclass file in addition to the above.

The method of arefills and landpolygons described above is a fast and easy way with the options provided in the ScBuilder program so far. My wish is that a future version could somehow deal with the task of drawing the complementary water polygons and that the cells in the original HP9?????.bgl files can be replaced with this new improved data.

I know this is more than a mouthful but I think your program is so good and promising that you deserve thorough feedbacks.

Best regards Jan.

User avatar
Luis Sa
Posts: 1736
Joined: Sun May 18, 2003 11:17 am
Location: Portugal
Contact:

Post by Luis Sa » Tue Jun 01, 2004 8:44 pm

Hello Jan,

Thank you for the detailed explanation. It will be very useful for other people that reads the forum.

I understand all you say. Only 4coments:

1) you could just remove the areas in the LOD5 (I wonder if there is a reason for replacing them with the "-9999 water"). There is a discussion on this here:

http://forums.avsim.net/dcboard.php?az= ... &mode=full

2) There is a programme that changes all LWM water masks to be -9999:

http://forums.avsim.net/dcboard.php?az= ... ype=search

3) about the sourrounding water polygons, may be this could be avoided by using AreaFills of water. If the BGL file for the AreaFills has a high alphabetical order than the BGL file with the LWM land polygons, these will be shown on top of water.

If I am correct there would be no need for the inversion.

4) the grouping of polygons - I need to check the code to see if it is easy or not to do that! I will check this!

Regards, Luis

Jan Nielsen
Posts: 22
Joined: Sun May 16, 2004 7:18 pm
Location: Norway

Post by Jan Nielsen » Wed Jun 02, 2004 6:19 am

Hi again Luis!

Your comment number 1:

Yes, you can just remove the content in a LOD8 Cell, and thereby remove the flatten effect of the default scenery. Then whatever LandClassFile that is active in the top LandClass layer for the region of that Cell will emerge and you will see land or water depending on the underlying LandClass tile type. In a coastal region the default LandClass does not cover all potential water or land in an improved and enhanced scenery file. Hence, I prefer to cover the entire Cell with the waterfills and add a LandClass file with land tiles wherever there is new land in the new scenery. Still replacing the default water Poly3 type polygons with land Poly2 type polygons results in the fact that the GPS gauge will not show the land in the GPS map. Also, since the underlying mesh sometimes is inaccurate the water will climb up the shores some places.

My conclusion is that the best way to make quality scenery is to adopt the methods of the default scenery. That is why I prefer to inverse the land polygons and rather draw the water poly3 type polygons, and then substitute the Cell content in the original HP9?????.bgl with this new data. Then the land shows in the GPS map and coastline is horizontal as it should be. The tool necessary to provide this latter described method of scenery making is still on my wish list. ļ

I am familiar with those threads in the Avsim forums that you refer to. I personally think that as long as you deal with lakes in the inland, those methods might work, but they are insufficient and obsolete when it comes to rendering the ocean coastlines with the complexity that we have on the Norwegian coast and many other places in the world.

Now if that thing with the ¡§MakeLineAsPoly=True/False¡¨ in the INI file and an easier way to define a coast line all the way around the polygons, that we talked about earlier, is provided, I will soon upload the scenery made with land type of polygons. It is after all fast and easy to make scenery this way with your excellent program.

Best regards Jan

User avatar
Luis Sa
Posts: 1736
Joined: Sun May 18, 2003 11:17 am
Location: Portugal
Contact:

Post by Luis Sa » Thu Jun 03, 2004 6:43 am

Dear Jan,

I just have been playing with SBuilder (and looking to the Map View of FS!). In fact in the map view of FS9 we can only draw water polygons.

For normal cockpit and topdown view we can draw islands on lakes by drawing the lake first and the island later. But the island will not be seen in the FS Map.

I think the only solution is, as you say, to invert the islands. But the inverted island will have a hole. But Sbuilder does not know anything about polygons with holes. My knowledge of computer geometry is limited and I think that it would take a while for me to implement this.

I admit that Norway is specific problem! :-) In Madeira Islands José Fortuna made the water polygons that define the coastline of Madeira by hand. SBuilder helps but it should be assisted!. For Portugal I have a long line defining the coast (you can "join lines" in SB to make a single line from a number of them). I will then have to add 3 or 4 points and make an L shape polygon of water. One part of the L will define the west coast of Portugal and the small edge of the line will define the south (Algarve) coast.

I am lucky because we only have a small number of coastal islands. In that case I will have to "open" the L and invert the "areas" where I need the island!

Kind Regards, Luis

Jan Nielsen
Posts: 22
Joined: Sun May 16, 2004 7:18 pm
Location: Norway

Post by Jan Nielsen » Thu Jun 03, 2004 8:58 am

Dear Luis, [:)]

I understand, and I'm grateful for your answers.
Still my first suggestion would if implemented be a nice improvement [:)]
<i>1. To make it easier to make coastlines around the polygons can you make it a possible option to define a line around all the polygons ( and all the way around the polygon) while reading them from a BLN file directly?</i>

The waterpolygones can be drawn by hand with the program as it is, but as I said earlier: <i>One way of solving this could be if you had different drawing layers in your program, allowing us to draw new polygons in between existing polygons preferably with a snap to point option. Adjacent polygons should be allowed to share points such that the edges of adjacent polygons would meet and thereby fill the space between them completely without overlapping.</i>
I'll be looking for upgrades. [:)]

Best regards Jan.

Post Reply