The seed system is such an integral part of the BGL graphics systems that a very structured approach is used in specifying seeds in BGL files. Rather than there being a single “seeds” section, a BGL file includes individual seed sections for each seed level. Part of the seed hierarchy is contained in the BGL header, and you can tell what seed levels are contained in a BGL file simply by looking at the header, as is shown in the following example.
;DATABASE HEADER ********************************************************
dw0001;00 world set number (not saved to file list)
;0=off 1=fs5 default worlddd0004c4eabh;02 N bound 43 degrees meter units
dd000400000h;06 S bound
dd0c38e38e3h;10 E bound 85 degrees 32-bit pseudo
dd0bf000000h;14 W bound
dd0;18 VOR_DATA
dw0;22 lowest vor freq (channel 0–199)
dw0;24 highest vor freq (108.00–117.95)
ddSYNTH_SEEDS_08;26 seeds level 8
ddSYNTH_SEEDS_09;30 seeds level 9
dd0;34 seeds level 10
dd0;38 seeds level 11
dd0;42 seeds level 12
ddSYNTH_SEEDS_13;46 seeds level 13
dd0;50 seeds level 14
dd0;54 seeds level 15
ddOBJECT_DATA;58 OBJECT_DATA
dd0;62 LIBRARY_DATA
dd0;66 FACILITIES_DATA
dd0;70 ANCHOR POINT DATA
dd0;74 COM RADIO DATA
………..
The preceding example shows a database header for some seed data in the Chicago database. Three levels of seeds are available in this database: levels 8, 9 and 13. Level 8 seeds are very large and cover an area of about 100 miles (on edge) for each seed. Level 13 seeds are small and cover one mile or less.
The preceding example also includes the North, South, East, West bounds of the BGL file. The bounded area covers the whole area defined by the seeds. The bounds are used by the Flight Simulator front-end system to determine if the user is within the area defined by the file. If not, the file isn’t processed. The bounded area “should” as opposed to “must” cover the seed area. If the bounded area doesn't cover the seed area, the graphics system still works, but the seeds may not be projected when they should be; that is, when the user is in the bounded area.
Note: The bounded area in no way locates or places the seeds, the defined bounds simply cue the front-end processor (when) to process this file.
In the preceding example, the SYNTH_SEEDS_08
pointer points to the level 8 seeds defined in the database; the following example shows the data section that the pointer references.
SYNTH_SEEDS_08:
rel_base=SYNTH_SEEDS_08
COORD_LATBAND_REL00031,LEVL_08_LAT_00031
COORD_LATBAND_REL00032,LEVL_08_LAT_00032
EOL
LEVL_08_LAT_00032:
SEED_ENTITY00191,seed_green,flat,0,180,0;180 meters is ground level
SEED_ENTITY00192,seed_green,flat,0,180,0;180 meters is ground level
SEED_ENTITY00193,seed_crops,ignore,0,180,0;180 meters is ground level
SEED_ENTITY00194,seed_green,flat,0,180,0;180 meters is ground level
EOL
LEVL_08_LAT_00031:
SEED_ENTITY00193,seed_green,flat,0,180,0;180 meters is ground level
EOL
In the preceding example, a rel_base
is established at the beginning of the level 8 seed section to act as a local absolute address reference for this level 8 seed data section only.
The beginning of every seed data section is made up of a list of coordinate latitude band definitions. As the COORD_LATABAND_REL
opcode definition in the preceding example shows, each coordinate latband instruction defines the coordinate latitude of a latband in this seed level on which the seeds are going to be placed, as well as a pointer to a list of seeds. In the preceding example, flat green seeds that represent farm countryside are placed at coordinate latitudes 31 and 32 in the level 8 seed coordinate system. The coord_latband
instruction for level 32 points to the label LEVL_08_LAT_00032
. At this label, you can find a list of seed entities that define the individual seeds. An EOL (end of list) command specifies the end of the list of coordinate latbands.
Each seed entity also specifies a longitude (in seed coordinates at this seed level), 4 bytes of seed type information, and 3 bytes of seed altitude information that correspond to the seed’s definition. The preceding example shows seed entity usage, while the following example shows the contents of the seed entity macro. Again, an EOL (end of list) command specifies the end of the list of seed entities.
COORD_LATBAND_RELmacrocoord_value,band_addr
db22
dwcoord_value
ddband_addr-rel_base;;32-bit rel_base relative ptr
endm
SEED_ENTITYmacrolongitude,seedtype1,seedtype2,altM256,altM,altfract
db4;;00 opcode
dwlongitude;;01 longitude coord
dwseedtype1;;03 seed type
dwseedtype2
dbaltfract,altM,altM256;;07 altitude ii.f M
endm
SEED_BANDmacrowest,east
db 5;;00 opcode
dw west;;01 longitude coord westernmost seed
dw east;;03 longitude coord easternmost seed
endm
BAND_ELEMENTmacroseedtype,altM256,altM,altfract
db seedtype,0,0,0;;00 seed type
db altfract,altM,altM256;;04 altitude ii.f M
endm
In many cases, multiple seed entities in a row must be specified at a common latband. You can save file space by using the SEED_BAND opcode. The following example shows some seeds that are placed at coordinate longitude 3090–3093, inclusive. The SEED_BAND command specifies the longitude, and the BAND_ELEMENT commands that follow the SEED_BAND command specify the types and altitude of the seeds. An EOL (end of list) command specifies the end of the list of band elements.
Important: The number of band element commands must match the number of the west to east range specified in the SEED_BAND command; if these elements don't match, the BGL graphics system can interpret random data that may cause it to malfunction.
LEVL_12_LAT_00494:
SEED_BAND3090,3093
BAND_ELEMENTseed_green,flat,0,230,0;230 meters is ground level at Willard
BAND_ELEMENTseed_green,flat,0,230,0;230 meters is ground level at Willard
BAND_ELEMENTseed_green,flat,0,230,0;230 meters is ground level at Willard
BAND_ELEMENTseed_green,flat,0,230,0;230 meters is ground level at Willard
EOL
Note: In earlier versions of Flight Simulator, coordinate latbands had to be ordered from north to south and seed entities had to be ordered from west to east. This improved file scanning efficiency a bit because the file scan could stop once the current seed was determined to be beyond the visual bounds. In the current version of Flight Simulator, there are no limits on latband or entity ordering; the small increase in efficiency isn’t worth the extra programming complexity to scenery designers.