Defining Seeds

In Flight Simulator, the seed system is used to populate the world with scenery. The scenery created by seeds isn't as specific or as detail-oriented as scenery created using objects. In the seed system, a coordinate grid with a well-defined seed coordinate system covers the world. Memory-efficient BGL commands define the types of scenery that populate specific coordinate locations, and the scenery synthesizer uses this information to populate the world with synthetic scenery.

When the BGL database defines scenery synthesizer seed data, the following items are included:

The following is an example of an actual seed definition in the BGL database.

;DATABASE HEADER ********************************************************
dw0001;00 world set number (not saved to file list)
;0=off 1=fs5 default world
dd000490000h;02 N bound meter units
dd0003f0000h;06 S bound
dd0cf000000h;10 E bound 32-bit pseudodegrees
dd0bf000000h;14 W bound
ddVOR_DATA;18 VOR_DATA
dw50;22 lowest vor freq (channel 0–199)
dw50;24 highest vor freq (108.00–117.95)
ddSYNTH_SEEDS_08;26 seeds level 8
ddSYNTH_SEEDS_09;30 seeds level 9
ddSYNTH_SEEDS_10;34 seeds level 10
ddSYNTH_SEEDS_11;38 seeds level 11
ddSYNTH_SEEDS_12;42 seeds level 12
ddSYNTH_SEEDS_13;46 seeds level 13
dd0;50 spare
dd0;54 spare
ddOBJECT_DATA;58 OBJECT_DATA
;SEED ENTITY OPCODE DEFINITIONS -
;OpFormatDefinition
;-----------------------------------------------------------------
;4db 4SEED ENTITY;00 opcode
;dw 0;01 longitude coord
;dw 0;03 seed type
;db 0;05 seed class
;db 0;06 seed status
;db 0,0,0;07 altitude ii.f M
;;10
;5db 5SEED BAND;00 opcode
;dw0;01 longitude left inclusive (seed 1)
;dw0;03 longitude right inclusive (seed N)
;;Caution: wrapping across prime meridian
;;not allowed!
;dw0;05 seed1 type
;db0;07 seed1 class
;db0;08 seed1 status
;db0,0,0;09 seed1 ii.f altitude
;.;12
;.
;seed type, class, status and altitude repeat for seed 2...seed n
;Seed Type Definition
seed_cropsequ0004h
seed_greenequ0080h
;Seed Class and Status Definitions
ignoreequ0000h
flatequ1111h
SEED_ENTITYmacrolongitude,seedtype1,seedtype2,altM256,altM,altfract
db4;;00 opcode
dwlongitude;;01 longitude coord
dwseedtype1;;03 seed type
dwseedtype2;;05 seed status, class
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 status, class, 0, type
db altfract,altM,altM256;;04 altitude ii.f M
endm

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_00031:
SEED_ENTITY00193,seed_green,flat,0,180,0;180 meters is ground level
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

Important: In an actual seed definition, sections similar to SYNTH_SEEDS_08 would be defined for SYNTH_SEEDS_09 through _13; these sections aren't shown in the preceding example.

Caution: Wrapping a band across the prime meridian (coord longitude=0) is not allowed.

The front-end processor creates a seed map from these seeds using the level and status information to resolve overlapping seed priority. (The class and status bytes indicate a seed’s general projection type and the projection priority.) Then front-end processor optimizes the final map and creates BGL seed objects that are passed to the BGL system when the FE_GET_OBJECT command is invoked during the seed scan. Objects consist of a few BGL commands that the BGL system manipulates. In the following order, the BGL system:

  1. Builds a database buffer of seed objects (these are the first objects added to the 256K database buffer).

  2. Executes the database buffer. The ADDOBJ command in the seed object adds the object to the radsort buffer for depth sorting so that the farthest seeds are projected first. The remainder of the object is jumped around by the JUMP command.

  3. In the radsort process, the BGL command determines that the object is a BGL object, the SCALE command defines the seed's scale, and the SEED command is executed to draw the seed.

The following example shows how the BGL system creates objects, in code.

;SEED RETURNED AS OBJECT
;--------------------------------------------------------
;dwbglop_seed_addobj;00 ADDOBJ opcode
;dw8;02 relative branch to object
;dwbglop_jump;04 JUMP opcode
;dw52;06 relative branch to end
;dwbglop_bgl;08 BGL radsorted object header
;dwbglop_new_scale;10 SCALE opcode
;dw44;12 relative branch-around vector
;dw0;14 fallout radius ii M
;dw0;16 spherical bounding radius
;dw0;18 radsort pointer
;dd65536;20 scale factor ii.ff
;dw0,0,0;24 LAT seed center iiii.ff M
;dw0,0,0;30 LON seed center 48-pseudo
;dw0,0,0;36 ALT AGL of seed center (0)
;dwbglop_seed;42 SEED command
;db0;44 seed type
;db0;45 seed type high (used by some commands)
;db0;46 seed class
;db0;47 spare
;dw0,0;48 x size iiii M
;dw0,0;52 z size iiii M
;dw0,0;56 real altitude ii.ff
;dw0;60 latitude grid coord
;dw0;62 longitude grid coord
;dw0;64 random number
;dwbglop_return;66

Seed priority determines what seed will be projected when two or more seeds are defined "on top of" one another or when seeds of different levels overlap. For more detailed information on seed priority, see the topic Seed Priority Rules and Guidelines. The class byte determines general projection class as shown in the following table.

Class byte Class Description
00h Hole Makes hole in seed map where nothing is drawn.
11h Flat
22h Mountain
33h Coast outside
44h Coast inside
55h Flat altitude lock Same as 11h

The status byte definitions shown in the following table show the use of this byte as a projection priority indicator. Backward compatibility with Flight Simulator, version 5.0 databases is maintained by reserving the values 00,11,22,33,44, and 55h. These were the only class values used in Flight Simulator, version 5.0 and they now indicate an "old" seed with no specified priority.

Note: If the top nybble of the status byte is “F”, the low nybble indicates a projection priority value ranging from 0 (low priority) to f(high priority). The Seed Priority Rules and Guidelines topic discusses how the values 0–f are used in conjunction with the seed projection level.

Status byte Status Description
00h Old; low priority seed Reserved for compatibility with Flight Simulator, version 5.0
11h Old; low priority seed Reserved for compatibility with Flight Simulator, version 5.0
22h Old; low priority seed Reserved for compatibility with Flight Simulator, version 5.0
33h Old; low priority seed Reserved for compatibility with Flight Simulator, version 5.0
44h Old; low priority seed Reserved for compatibility with Flight Simulator, version 5.0
55h Old; low priority seed Reserved for compatibility with Flight Simulator, version 5.0
FPxxh High priority seed F=hex value f; P=priority: 0=low, f=high