Page 1 of 1

Coastline problem in FS9

Posted: Thu Nov 15, 2007 9:24 am
by JoHubb
I've been using Sbuilder/AFCAD to upgrade the default airfield at EGAD - realigning runways, adding buildings etc. The airport is bordered on the south east by a large sea lough, the default coastline of which is not at all accurate. It matters because one of the runway thresholds is right at the sea wall. I've struggled to create a coastline which shows up properly and have only been partly successful. One step forward and another back! The first pic shows the best I have managed but as can be seen from the FS9 aerial view there is a gap! The line is a VTP2 layer 8 using texture 1046 and it is continuous right around the coast. I cannot understand why it shows in one place and not another.

http://pic20.picturetrail.com/VOL84/140 ... 513113.jpg

I tried using an LMW land mask over the missing area to force land but the VTP2 structure did not appear. The large triangle at the top of the lough is an LMW land mask. Although there is a long gap without any coastline, there are other small area where the water shows through on the land side of the coast. I have tried to correct these and usually end up making things worse.

There is also a problem on the airfield with a circular road, again part of this does not show (layer 8.2). I have checked all the sections and they are all identical. I suppose I should use a flatten poly but I want to preserve the VTP2 textured polys (layer 7).

I've attached two Sbuilder screenshots with and without lines.

http://pic20.picturetrail.com/VOL84/140 ... 513103.jpg
http://pic20.picturetrail.com/VOL84/140 ... 513136.jpg

Any help will be very gratefully received - my head is all screwed up and I cannot think straight anymore.

Posted: Thu Nov 15, 2007 1:23 pm
by Luis Sa
Hello,

First here is an extract of the old SDK:

Layers and Their Values

Layers define the order in which Flight Simulator applies the textured polygons to the ground and in which phase of the texture building process they are applied.
• Layers 0 to 3 are applied in the water texture layer. These are applied before the water texture is masked into the land texture. These polygons appear only in the water and are clipped by the land portion of a texture.
• Layers 4 to 7 are in the land texture layer. These textures are applied to the land texture before the water texture is masked in. Polygons used at these levels appear on the land texture but are clipped by the water portions. For this reason, airport skirtings and park polygons were placed in layer 4.
• Layers 8 and above (the number of layers is capped at 100) are applied to the texture after the land and water are masked together. Polygons applied at this level appear over both the land and water portions of the texture. Shoreline polygons were placed at level 8 to provide a blending effect between the land and the water.

Well, here are some isolated tips:

1 - try to locate the default HL and HP BGLs for that are and rename them just to see if there is something that we are not taking into account

2 - If the scenery is for your own use you could open the default LWM and VTP BGL files and edit them

3 - In order to change the coastline the first thing to do is to add many landclass tiles that would extend the land to the sea. Bee genereous. Then apply LWM masks of typer water to cover the the parts that became land after placing the landclass tiles. At this stage the coast definition is done. Then adding a coastline is a kind of decoration and I would simply add a VTP line (with a proper texture) with a VTP layer number of 8

4 - Also read the following from the SBuilder Help file,

Kind Regards,

Luis


Brief Introduction of Masks

LWM (or Land Water Masks) are polygons that allow us to change the type of textures that FS uses. We may assume that there are 2 layers of textures that cover the whole Earth - a land layer and a water layer. In a particular region, Flight Simulator can use either the textures from the land layer or the textures from the water layer. What tells FS which texture to use is a kind of a flag or switch as explained next.

A very large default FS land class file, called worldlc.BGL and found at ..\Microsoft Games\Flight Simulator 9\Scenery\BASE\Scenery, defines the land classes for every LOD13 square that exists in the Earth. If you open this file with the Microsoft tool TMFViewer you will see that the land class index used in ocean areas is 100. In fact, this value of 100 is the flag referred to above. A value of 100 instructs FS to use a water texture whose index is found in another global file - worldwc.BGL. Therefore every LOD13 square is either a land or a water texture. If the index of the LOD13 in the file worldlc.BGL is different from 100, the LOD13 is land. Otherwise it is water.

We can now define a mask as being a polygon that modifies this predefined texture. If we draw a polygon in a continental region and we define it as a LWM mask of type land, the polygon will do nothing. If, on the contrary, the mask is of the type water, FS will switch the texture, from the land layer to the water layer. We will have a lake on a continent!

If we define a polygon as being a mask of type land in the middle of the ocean, we would expect it to become an island. But it will not. In fact, the mask of type land will instruct FS to take the texture from the land layer. But, as we have seen, on ocean areas the land layer has an index of 100, which means water. The solution will be to create a land class BGL with at least 4 indexes of type land at the vertexes of a LOD13 square. That will change the type of the LOD13 square to be land. If we do nothing else, a squared of island will appear in the ocean. In order to complete the island, we need to draw LWM polygons around the island that change the mask back to water.

In order to make an island on a lake in a continental region, we need to make the bigger lake (LWM = water) first and the smaller island (LWM = land) afterwards. In this case the land mask will make FS to use a land texture from the land layer since there is no index of 100 pointing to the water layer as in the previous case.

In conclusion: there are 2 layers of textures for the whole Earth and the mask (land or water) can switch from one to the other. While the water layer has water definitions for the whole Earth, the land layer has only land definitions for continental regions. This complicates the making of islands in the middle of the ocean.

Posted: Sat Nov 17, 2007 5:23 pm
by JoHubb
Luis

Many thanks for your detailed reply. Believe it or not I attempted to read the SDK but I have to admit that I did not understand a lot of it. This is how I see things now - please correct me if I've got any or all of it wrong:

1. LODs are assigned to water or land. If one of these happens to be water then it must be masked to land before a VTP2 line i.e. a shoreline or a land polygon can display in that particular LOD. I know than VTP2 lines must contain at least one 'point' in every LOD.

2. If an LWM polygon (water mask - blue colour) takes up part of an LOD8 then the rest of that LOD will be water, unless it is masked by an LWM land mask poly.

3. The shoreline is defined by land going into water, rather than water going into land.

4. I am not too sure what the 'white' areas in SBuilder contain.

Despite not understanding it all very well, I have made good progress with my scenery by trial and error. I will post some more pics in the next day or two and would be grateful for your comments.

Thanks again. Best regards

John

Posted: Sun Nov 18, 2007 12:37 am
by Luis Sa
Hello,

I will answer to your questions but it is essential that you understand what I wrote under the title "Brief Introduction of Masks". If you have a problem on a particular area think as follows:

1) FS starts by reading the worldlc.BGL to determine the texture index for the LOD13 quad your region is. If the index is not land (100) it gets the texture index from a collection of water textures definied for each LOD13 quad in the file worldwc.BGL.

2) if you are working on changing a coast you need to examine the file worldlc.BGL with TMFViewer and see if the quads are land. If they "point" to water (index =100) you need to create a landclass scenery that contains land tiles over the ones that "point" to water. Do not worry if you are making many uncessary tiles (placing land that will be water) because you will cover those with LWM water polygons.

3) So you should see land in the area that you are working. No water at this stage.

4) Now you can draw the detailed coastline by adding water mask LWM polygons that will return the water where it should be.


Now your questions:


1. LODs are assigned to water or land. If one of these happens to be water then it must be masked to land before a VTP2 line i.e. a shoreline or a land polygon can display in that particular LOD. I know than VTP2 lines must contain at least one 'point' in every LOD.


masked to land before ... masked is a WRONG word. The right word is changed to land by putting a land class tile on that LOD13 quad. More correctly putting 4 land tiles in the vertices of that LOD13 quad.

2. If an LWM polygon (water mask - blue colour) takes up part of an LOD8 then the rest of that LOD will be water, unless it is masked by an LWM land mask poly.

????

3. The shoreline is defined by land going into water, rather than water going into land.

yes - by using a mask that force FS not to accept the land class tile that exist there (or that you put there) and, instead, get the water texture that is defined in worldwc.BGL

4. I am not too sure what the 'white' areas in SBuilder contain.

????

Regards,

Luis

Posted: Sun Nov 18, 2007 6:42 pm
by JoHubb
Luis

Many thanks again. I've been trying to get my head around the FS2004 SDK on Ground Polygons and LWM polygons without a lot of success. I understand the essentials about the LODs belonging to land/water and layers. But I do not have a working knowledge of the C programming language - according to the SDK this one of the pre-requisites!

Regarding your suggestion to open the worldlc.BGL with TMFViewer: this programme looks for coordinates not file locations. ???
Image

I fear that I am getting drawn into complexities which I am unlikely ever to understand short of going to night classes! Trial and error is working but it is slow and sometimes I get stuck. I can drive my car without knowing too much about how the engine works. Is scenery design like that, or must I know all the details?

My modifications so far - redrawn coastline (incomplete), adjusted road layout (incomplete), re-aligned runways, accurate taxiways, apron and circular road on airfield. I used actual aerial photos for the airfield and Google Earth for the surrounding area. I was unable to use either of these as a background map - the map showing on the SBP file below is nonsense.

Image
with the corresponding .SBP view.

Image

The white areas in this are a mystery. Are these water or land? How can I find out?

Also, the water on the left of the Sbuilder photo does not go up to the shoreline VTP - there is a gap but this seems not to matter in the end result. The purplish poly at the apex is a land mask poly which extends down the left side under the shoreline VTP. Without it there is water in those areas and the shoreline doesn't show up.

Finally, is a landclass tile the same as an LOD (13 or 8?) which has been assigned as land? Is the idea to convert water tiles (LOD13 or LOD8?) to land and then mask with water polys up to the shoreline? Then add the shoreline itself?

I guess I must sound very confused! I am. But I have a PhD so I'm not entirely stupid....unless things are worse in my brain than I realise.

Thanks for taking an interest and sticking with me.

John

Posted: Mon Nov 19, 2007 1:03 am
by Luis Sa
Hello John,

It is not completely necesary that you master all the details of scenery creation but you will go faster on your project when you understand what is happening.

Some observations on your last email - I was talking about LOD13 quads. I do not understand why you refer to L0D8 quads. LOD8 quads will play a role when your area is splited between different LOD8 quads. Is that the case? Note that LOD8 quads are much bigger than the 1.2 km x 1.2 km. For example 4 LOD8 squares cover the whole of my country (yes I know it is a very small country!).

I also do not understand what you mean by the white areas. Please be more informative.

Regarding maps (since you are not using FSX for which SBuilder has useful map functions) why do not you get a map using this page:

http://www.ptsim.com/sbuilder/gmaps.htm

Then you can add it to SBuilder by taking note of the borders coordinates.

Kind Regards,

Luis

Posted: Mon Nov 19, 2007 10:02 pm
by JoHubb
Hm...Iain Murray refers to LOD8 squares in his Coastline Maker utility where you refer to LOD13s. So that is why I am confused.

I asked about the white areas: I understand that LODs are either water or land. If I start a new SB project I find blue squares and the rest of the area is white. Does this represent water and land LODs? In other words, do the colours have any meaning? I understand that all sorts of masking processes can be used to change the original water or land nature of all or part of an LOD.

Image

I am trying with the maps but have never had any success. I can get as far as calibration but then something always goes wrong. I am using Hypersnap 6 free to capture the GE Plus map. I use the Add Image Overlay to get the coordinates (decimal) which I then paste into the SB map dialogue. When I click OK to calibrate the GE map vanishes!

Posted: Tue Nov 20, 2007 4:10 am
by Luis Sa
Hi Jon,

Start a new project. Everything is white, because there is nothing in your project. Then you add a polygon. When you select the polygon its borders become green to signal that it is selected. Everthing that is white will generate nothing and the default terrain that exists there will be unmodified.

About maps - you create a mapo in disk with your screen capture programme. Yes? Then you add it as a map into SBuilder. A window appears telling you that the map possibly needs calibration. Do you get here? If so just ignore and do not calibrate the map. Do you see the map in SBuilder? Of course it would be in a wrong position. But do you see it. If yes then there is no problem with the image format. Press the right mouse on a border of the map to bring up the map properties window. Then carefully paste the lat/lon of the borders ... good luck...

Kind Regards,

Luis

Posted: Tue Nov 20, 2007 8:15 am
by JoHubb
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">citação:<hr height="1" noshade id="quote"><i>Mensagem original de Luis Sa
Hi Jon,

Start a new project. Everything is white, because there is nothing in your project. Then you add a polygon. When you select the polygon its borders become green to signal that it is selected. Everthing that is white will generate nothing and the default terrain that exists there will be unmodified.
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote"></i>
I understand this better now.
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">citação:<hr height="1" noshade id="quote"><i>
About maps - you create a mapo in disk with your screen capture programme. Yes?
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote"></i>
Done this, no problems.
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">citação:<hr height="1" noshade id="quote"><i>
Then you add it as a map into SBuilder. A window appears telling you that the map possibly needs calibration. Do you get here?
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote"></i>
Yes.
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">citação:<hr height="1" noshade id="quote"><i>
If so just ignore and do not calibrate the map. Do you see the map in SBuilder?
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote"></i>
Yes.
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">citação:<hr height="1" noshade id="quote"><i>
Of course it would be in a wrong position. But do you see it. If yes then there is no problem with the image format. Press the right mouse on a border of the map to bring up the map properties window. Then carefully paste the lat/lon of the borders...
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote"></i>
I tried. It asked for info for P1 and P2 without explaining how to define these points. It is also not clear to me how to enter the pixel data. I have read the 'Help' section. I have tried various ways of entering the data. The programme often asks me to check the lat/long values - I use the NSEW values from the GE image overlay. I do not know how to get P1 and P2. Perhaps this is all too much for me and I should go back to listening to Bach and Mahler...

Thank you Luis, for all your patient help and interest. I'm an old dog and these are new tricks! Not a good combination.

[:(]

Posted: Tue Nov 20, 2007 5:04 pm
by JoHubb
Ah ha! I wonder if I've cracked it?

In map mode I right clicked on the edge of the map in the SB window. I went to calibrate on the drop down menu. I identified two discrete points in the scenery (P1 and P2) and clicked on the <Change> button to the left of the upper lat/long values. The cursor became a cross and I went to P1 and left clicked. The lat/long values changed! I went to the <Change> button to the right of the pixel X/Y values and clicked on it. Again, the cursor became a cross. I went back to P1 on the map and left clicked.

I repeated all the above at P2 using the lower <Change> buttons. Then I calibrated and the map snapped into place. Whey Hey!

(The odd thing is that when I tried to load the lat/longs manually SB would not accept them. Maybe because I had nothing to put in the pixel X/Y boxes).

So, for me a big success! But....now I find that the three runways I so carefully re-aligned at the default FS9 location, not to mention my other scenery mods are about 200 metres to the east of where they should be according to GE Plus. Is there an easy way to correct this or must I start again?

Thanks again, Luis, for your help and a great program.

John [8D]

Posted: Tue Nov 20, 2007 6:49 pm
by Luis Sa
Hi,

I am not at home and so I will be short. Do not bother about the pixels! As soon you click with the right mouse on the midle of an edge of the map a window appears. You only need to enter the NW and SW lat/lon coordinates of the map

NW coordinates is equivalent to North border (lat) and West border (lon)

SE coordinates is equivalent to South border (lat) and East border (lon)

The pixels will be (0,0) corresponding to the NW corner and (size,size) corresponding to the SE corner. BUT these pixel coordinates can be read from the bitmap file. SBX knows them and you do not need to enter them.

The pixels are only needed when you do not know the border but instead you know the lat/lon od, say, a crossroad somewhere in the NW region of the image and another lat/lon pair corresponding, say, the house of your neibhour that appears in the south east part of the map. In this case you need to specify in pixels the croossroad and the house.

Hope this is useful,

Kind Regards,

Luis