Seed Design Example

This topic includes an example of how to build a seed database by placing a number of sample seeds into a .bgl file. The seeds used in this example are placed near Champaign, Illinois at latitude=40 degrees, 68 minutes and longitude=88 degrees, 11.30 minutes. The seeds used are level 13 seeds. Level 13 seeds are 4.9 KM at the equator, so their size is 3.75km (4.9 km * cos 40 degrees). For more information on seed levels and coordinates, see the seed_grid_table in the topic The Seed Coordinate System. The following is an example of the seed database.

;Tutorial Example, Database 2
;Test seeds near Champaign Illinois
include asm.inc ;include this in ALL .asm files!
include dumper.inc;we're dumping data from this file
.data
dumper_dataDUMPERDATA{the_data, the_data_size, 'test.bin'}
the_dataequ$
;DATABASE HEADER *************************************************************
dw0001;00 world set number (not saved to file list)
; 0=off 1=fs5 default world
dd0004b0000h;02 N bound Meter units
dd0003e0000h;06 S bound
dd0c4000000h;10 E bound 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)
dd0;26 seeds level 8
dd0;30 seeds level 9
dd0;34 seeds level 10
dd0;38 seeds level 11
dd0;42 seeds level 12
ddsynth_seeds_13-the_data;46 seeds level 13
dd0;50 seeds level 14
dd0;54 seeds level 15
dd0;58 OBJECT_DATA
dd0;62 LIBRARY_DATA
dd0;66 FACILITIES_DATA
dd0;70 ANCHOR POINT DATA
dd0;74 COM RADIO DATA
dd0;78 ADF DATA
dd0;82 DYNAMIC OBJECT PATHS
dd0,0;86 Library id min
dd0,0;94 Library id max
dd0;102 MISC_DATA (ground alt db)
dd0;106 TITLE AND DESCRIPTION DATA
dd0;110
dd0;114 EXCEPTION LIST PTR
dd0;118
dd0;122 (not saved to file list)
dw0;126 (not saved to file list)
;128
;ENTITY OPCODES **************************************************************
EOLmacro
db0
endm

LATBAND_RELmacrolatmin,latmax,band_addr
db21
dwlatmin;;lat min (inclusive) 512M units
dwlatmax;;lat max (exclusive)
dd(offset band_addr) - (offset rel_base);;32-bit rel_base relative ptr
endm

COORD_LATBAND_RELmacrocoord_value,band_addr
db22
dwcoord_value
dd(offset band_addr) - (offset rel_base);;32-bit rel_base relative ptr
endm

LARGE_OBJECT_HEADERmacrolatitude,longitude,object_end
LOCALopcode
opcodedb5
ddlatitude,longitude
db100;;image power
dw(offset object_end) - (offset opcode)
endm

SEED_ENTITYmacrolongitude,seedtype1,seedtype2,altM256,altM,altfract
db4;;00 opcode
dwlongitude;;01 longitude coord
dwseedtype1;;03 seed type
dwseedtype2;;05 MSB(status):LSB(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_ELEMENTmacroseedtype1,seedtype2,altM256,altM,altfract
dw seedtype1;;00 seed type
dw seedtype2;;00 seed type
db altfract,altM,altM256;;04 altitude ii.f M
endm

holeequ0
seed_landequ0001h
seed_waterequ0000h
seed_mountainequ0000h
seed_coastequ0000h
seed_broadleafequ0001h
seed_needleequ0002h
seed_cropsequ0004h
seed_prarieequ0005h
seed_aridequ0006h
seed_desertequ0007h
seed_greenequ0080h
seed_smallcityequ0081h
seed_medcityequ0082h
seed_burb1equ0083h
seed_lakeequ0084h
seed_burb2equ0085h
seed_burb3equ0086h
seed_hillsequ0088h
seed_dunesequ0089h
seed_hiriseequ008ah
seed_midriseequ008bh
seed_urban1equ008ch
seed_urbanequ008ch
seed_urbsubequ008dh
ignoreequ0000h
flat_seedequ1111h
mountainequ2222h
outsideequ3333h
insideequ4444h
;seed classes
SEED_CLASS_HOLEequ0000h
SEED_CLASS_FLATequ0011h
SEED_CLASS_MNTequ0022h
SEED_CLASS_OUTSIDE_COASTequ0033h
SEED_CLASS_INSIDE_COASTequ0044h
SEED_CLASS_FLAT_ALTITUDE_LOCKequ0055h;;is this used?
;seed status
SEED_STATUS_LOW_PRIORITYequ0000h;;all status bits are ignored except Fx
SEED_STATUS_HI_PRIORITY_0equ0F000h
SEED_STATUS_HI_PRIORITY_1equ0F100h
SEED_STATUS_HI_PRIORITY_2equ0F200h
SEED_STATUS_HI_PRIORITY_3equ0F300h
SEED_STATUS_HI_PRIORITY_4equ0F400h
SEED_STATUS_HI_PRIORITY_5equ0F500h
SEED_STATUS_HI_PRIORITY_6equ0F600h
SEED_STATUS_HI_PRIORITY_7equ0F700h
SEED_STATUS_HI_PRIORITY_8equ0F800h
SEED_STATUS_HI_PRIORITY_9equ0F900h
SEED_STATUS_HI_PRIORITY_Aequ0FA00h
SEED_STATUS_HI_PRIORITY_Bequ0FB00h
SEED_STATUS_HI_PRIORITY_Cequ0FC00h
SEED_STATUS_HI_PRIORITY_Dequ0FD00h
SEED_STATUS_HI_PRIORITY_Eequ0FE00h
SEED_STATUS_HI_PRIORITY_Fequ0FF00h
;SEED type information for mountains (class 22h)
;Note: the MSB (bytes 3 & 4 of the seed type word) of the type
;information for mountain class seeds is used internally to
;determine heights along edges and corners.
;mountain height is set by byte 2 of seed type word
MNT_SEED_HEIGHT_6k_FTequ0000h
MNT_SEED_HEIGHT_750_FTequ0010h
MNT_SEED_HEIGHT_1500_FTequ0020h
MNT_SEED_HEIGHT_3k_FTequ0030h
MNT_SEED_HEIGHT_9k_FTequ0040h
MNT_SEED_HEIGHT_12k_FTequ0050h
MNT_SEED_HEIGHT_18k_FTequ0060h
MNT_SEED_HEIGHT_24k_FTequ0070h
;mountain coverage is set by byte 1 of seed type word
MNT_SEED_COVERAGE_WATERequ0000h
MNT_SEED_COVERAGE_BROADLEAFequ0001h
MNT_SEED_COVERAGE_NEEDLELEAFequ0002h
MNT_SEED_COVERAGE_TROPICALequ0003h
MNT_SEED_COVERAGE_CROPSequ0004h
MNT_SEED_COVERAGE_PRARIEequ0005h
MNT_SEED_COVERAGE_ARIDequ0006h
MNT_SEED_COVERAGE_DESERTequ0007h
MNT_SEED_COVERAGE_TUNDRAequ0008h
MNT_SEED_COVERAGE_ICEequ0009h
MNT_SEED_COVERAGE_SWAMPequ000Ah
coast_wequ0100h
coast_sequ0200h
coast_swequ0300h
coast_eequ0400h
coast_ewequ0500h
coast_seequ0600h
coast_eswequ0700h
coast_nequ0800h
coast_nwequ0900h
coast_nsequ0a00h
coast_nswequ0b00h
coast_neequ0c00h
coast_nweequ0d00h
coast_nesequ0e00h
coast_nsewequ0f00h

;SEED DATABASE ***************************************************************
synth_seeds_13labelword
rel_base=synth_seeds_13
COORD_LATBAND_REL00988,levl_13_lat_00988
COORD_LATBAND_REL00989,levl_13_lat_00989
COORD_LATBAND_REL00990,levl_13_lat_00990
EOL

levl_13_lat_00988labelword
SEED_ENTITY6183, seed_needle+coast_w,outside,0,230,0
SEED_ENTITY6184, seed_needle+coast_s,outside,0,230,0
SEED_ENTITY6185, seed_needle+coast_sw,outside,0,230,0
SEED_ENTITY6186, seed_needle+coast_e,outside,0,230,0
SEED_ENTITY6187, seed_urban+coast_ew,outside,0,230,0
SEED_ENTITY6188, seed_urban+coast_se,outside,0,230,0
SEED_ENTITY6189, seed_urban+coast_esw,outside,0,230,0
SEED_ENTITY6190, seed_urban+coast_n,outside,0,230,0
SEED_ENTITY6191, seed_arid+coast_nw,outside,0,230,0
SEED_ENTITY6192, seed_arid+coast_ns,outside,0,230,0
SEED_ENTITY6193, seed_arid+coast_nsw,outside,0,230,0
SEED_ENTITY6194, seed_broadleaf+coast_ne,outside,0,230,0
SEED_ENTITY6195, seed_broadleaf+coast_nwe,outside,0,230,0
SEED_ENTITY6196, seed_broadleaf+coast_nes,outside,0,230,0
SEED_ENTITY6197, seed_broadleaf+coast_nsew,outside,0,230,0
EOL

levl_13_lat_00989labelword
SEED_ENTITY6183, seed_green,flat_seed,0,230,0
SEED_ENTITY6184, seed_smallcity,flat_seed,0,230,0
SEED_ENTITY6185, seed_medcity,flat_seed,0,230,0
SEED_ENTITY6186, seed_burb1,flat_seed,0,230,0
SEED_ENTITY6187, seed_burb2,flat_seed,0,230,0
SEED_ENTITY6188, seed_burb3,flat_seed,0,230,0
SEED_ENTITY6189, seed_arid,flat_seed,0,230,0
SEED_ENTITY6190, seed_desert,flat_seed,0,230,0
SEED_ENTITY6191, seed_hirise,flat_seed,0,230,0
SEED_ENTITY6192, seed_midrise,flat_seed,0,230,0
SEED_ENTITY6193, seed_urban1,flat_seed,0,230,0
SEED_ENTITY6194, seed_urbsub,flat_seed,0,230,0
SEED_ENTITY6195, seed_broadleaf,flat_seed,0,230,0
SEED_ENTITY6196, seed_needle,flat_seed,0,230,0
SEED_ENTITY6197, seed_crops,flat_seed,0,230,0
SEED_ENTITY6198, seed_prarie,flat_seed,0,230,0
EOL

levl_13_lat_00990labelword
SEED_ENTITY6183, seed_urban,flat_seed,0,230,0
SEED_ENTITY6184, MNT_SEED_HEIGHT_1500_FT + MNT_SEED_COVERAGE_WATER,SEED_STATUS_LOW_PRIORITY + SEED_CLASS_MNT, 0,230,0
SEED_ENTITY6185, MNT_SEED_HEIGHT_1500_FT + MNT_SEED_COVERAGE_BROADLEAF,SEED_STATUS_LOW_PRIORITY + SEED_CLASS_MNT, 0,230,0
SEED_ENTITY6186, MNT_SEED_HEIGHT_1500_FT + MNT_SEED_COVERAGE_NEEDLELEAF,SEED_STATUS_LOW_PRIORITY + SEED_CLASS_MNT, 0,230,0

SEED_ENTITY6187, MNT_SEED_HEIGHT_1500_FT + MNT_SEED_COVERAGE_TROPICAL,SEED_STATUS_LOW_PRIORITY + SEED_CLASS_MNT, 0,230,0
SEED_ENTITY6188, MNT_SEED_HEIGHT_1500_FT + MNT_SEED_COVERAGE_CROPS,SEED_STATUS_LOW_PRIORITY + SEED_CLASS_MNT, 0,230,0
SEED_ENTITY6189, MNT_SEED_HEIGHT_1500_FT + MNT_SEED_COVERAGE_PRARIE,SEED_STATUS_LOW_PRIORITY + SEED_CLASS_MNT, 0,230,0
SEED_ENTITY6190, MNT_SEED_HEIGHT_1500_FT + MNT_SEED_COVERAGE_ARID,SEED_STATUS_LOW_PRIORITY + SEED_CLASS_MNT, 0,230,0
SEED_ENTITY6191, MNT_SEED_HEIGHT_1500_FT + MNT_SEED_COVERAGE_DESERT,SEED_STATUS_LOW_PRIORITY + SEED_CLASS_MNT, 0,230,0
SEED_ENTITY6192, MNT_SEED_HEIGHT_1500_FT + MNT_SEED_COVERAGE_TUNDRA,SEED_STATUS_LOW_PRIORITY + SEED_CLASS_MNT, 0,230,0
SEED_ENTITY6193, MNT_SEED_HEIGHT_1500_FT + MNT_SEED_COVERAGE_ICE,SEED_STATUS_LOW_PRIORITY + SEED_CLASS_MNT, 0,230,0
SEED_ENTITY6194, MNT_SEED_HEIGHT_1500_FT + MNT_SEED_COVERAGE_SWAMP,SEED_STATUS_LOW_PRIORITY + SEED_CLASS_MNT, 0,230,0
EOL

the_data_sizeequ$ - the_data
end

The following sections explain the parts of the example database.

Header

For the database header, a standard BGL file header is used. The level 13 seed data pointer at offset 46 is set to point at seed level 13 data.

Opcode Definitions

A BGL definitions include file isn't used in this example; as a result, all the required BGL instructions are defined in macro form. The SEED_ENTITY instruction is used to define all the seeds.

Many equates are set up for the different seed types. The equates used in this database are not all-inclusive lists, but are used for the purpose of example.

Seed Placement

In the example database, the synth_seeds_13 label begins the data section. Coordinate latitude values are used to place the seeds near Champaign, Illinois. Based on the values in the database, the level 13 latitude seed bands are going to be 988,989, and 990 and three rows of test seeds will be set up.

Coastal Seed Examples

The row of seeds that are farthest south (at coordinate latitude 988) depicts all the inside coastal seeds. Notice how the inner parts of the corner seeds (southeast, northeast, southwest, and northwest) are filled with the seed type indicated in the instruction. For a depiction of inside coastal seeds, replace the outside labels in these seed_entities with “outside”.

Flat Seed Examples

The middle seed row depicts flat terrain seeds and their textures.

Mountain Seed Examples

The northernmost row lays out mountains of varying types and elevations.

Viewing the Seeds

To view the seeds created in the database, go into slew mode and open the dialog box that sets coordinates and view direction. Set the following location:

Lat40 degrees00.68 minutes

Lon88 degrees11.30 minutes

Heading4 degrees

Altitude3175 ft.

At this point, you should be looking north at the three rows of seeds. Slew around, changing your view direction, to get a good look at the seeds and their textures.