Selecting Scenery, .Vis Files and World Sets

To display scenery, the scenery system must be able to find the world sets included in Flight Simulator. The .vis file contains the information that points Flight Simulator to the world sets. Flight Simulator includes a file called World.vis, located in the Scenery directory; when Flight Simulator is installed, World.vis is set to point to all of the world sets that are included with Flight Simulator. When scenery disks are installed or when a user changes the scenery properties in the Scenery Library dialog box, World.vis is updated.

The .vis file contains many components. Much like A BGL file's header, a header points to all these components. The following example shows a World.asm file that, when assembled, becomes a World.vis file.

;BGL/LOGOL World.vis .Vis File
includebglmac.asm
include foreignv.asm
BGLSEGsegmentwordpublic
low64ksegment para public 'l64'
low64kends
ASSUMEcs:BGLSEG,DS:low64k,es:nothing

;SCENERY OVERLAY HEADER ***************************************************
dwdriver_end;00 length of scenery overlay
db'MR';02 type id  'MR' == BGL, 0xDD == F1
dwtitle_data;04 ptr to title
dwdescription_data;06 ptr to description data
dwworld_id_list;08 world set id ptr
dwfile_and_type_list;10 file & type list
dwbooster_list;12 booster processor list
dwtag_list;14 tag list (must precede file & type list!)
dw8 dup(0);16 spares
;32 Scenery info starts at 20h

SCENERY_DATAlabelbyte
BGL;switch to BGL mode
EOF;dummy database

TITLE_DATA labelbyte;31 char asciiz
dbmsgvis005,0

DESCRIPTION_DATA labelbyte;256 char asciiz
dbmsgvis001
dbmsgvis002
dbmsgvis003
dbmsgvis004
DD_endlabel byte
db(256+DESCRIPTION_DATA-DD_end) dup (0)

WORLD_ID_LISTlabelword
dw0001h;FS5 default world 1 visuals
dw0003h;FS5 default world 1 VORs ADFs
dw0004h;FS5 default world 1 ATIS Landme
dw0000;eol
EOLmacro
db0
endm

;TAG LIST  (FS5.1) *****************************************************
;
;*** Important Note! ***
;This list must be maintained above FILE_AND_TYPE_LIST in the file,
;because JAPAN Scenery's Setup (which edits World.vis) isn't aware of
;the pointer to this list; this placement prevents the list from being updated.
;This list provides tags to associate with scenery areas, so it can be
;determined when a scenery area has been added again (or "overinstalled") by
;a setup program.
;TAG LIST ENTITY OPCODE DEFINITIONS -
;OpFormatDefinition
;-----------------------------------------------------------------
;0db0;00 opcode = EOL (end of list)
;1db1;00 opcode = TAG_L (tag list)
;db'JAPAN_SCENERY=';01 asciiz TAG_NAME=PATH\TO\SCENERY
;dbC:\FLTSIM5\JAPAN',0
TAG_LISTlabelbyte
EOL

;FILE AND TYPE LIST (FS5.1) ********************************************
;FILE & TYPE ENTITY OPCODE DEFINITIONS -
;OpFormatDefinition
;-----------------------------------------------------------------
;0db0;00 opcode = EOL (end of list)
;1db1;00 opcode = FILE_T (file & type)
;db0;01 scenery type
;;   type   = 10    = GLOBAL
;;          = 20    = REGIONAL
;;          = 30    = LOCAL_
;;          = 40    = ASD_LOW
;;          = 50    = ASD_HIGH
;db1;02 flags
;;   bit 0  = 0 -> inactive, 1 -> active
;;   bit 1  = 0 -> not protected, 1 -> protected
;db'file path and name',0;03 asciiz file drv:/path/name.ext
;;   drv:   = a: z: = drive letters
;;          = =:    = fs51's drive
;;   /path/ = /path = normal path
;;     = /=    = fs51's path

FILE_Tmacrodest,type,flags
db1
dbtype
dbflags
dbdest,0
endm

FILE_TITLEmacrotitl
dbtitl,0;Maximum title length 30 characters
endm;(31 including trailing 00h)

GLOBAL= 10
REGIONAL= 20
LOCAL_= 30
ASD_LOW= 40
ASD_HIGH= 50
;Flag masks
INACTIVE= 0h;inactive
ACTIVE= 1h;active
PROTECTED= 2h;protected
;(can't delete, change destination,
;change type, make inactive, or
;change title)

FILE_AND_TYPE_LISTlabel word
FILE_T'D:\NEW_YORK\*.BGL',LOCAL_,INACTIVE
FILE_TITLE 'New York Scenery'
FILE_T'D:\DENVER\*.BGL',LOCAL_,INACTIVE
FILE_TITLE 'The Denver Area'
FILE_T'D:\CHICAGO\*.BGL',LOCAL_,INACTIVE
FILE_TITLE 'Chicago Western Suburbs'
FILE_T'D:\LOS_ANGLES\*.BGL',LOCAL_,INACTIVE
FILE_TITLE 'East LA'
FILE_T'D:\DALLAS\*.BGL',LOCAL_,INACTIVE
FILE_TITLE 'Dallas Fort Worth'
FILE_T'D:\LAS_VEGAS\*.BGL',LOCAL_,INACTIVE
FILE_TITLE 'Las Vegas Area'
FILE_T'D:\SEATTLE\*.BGL',LOCAL_,INACTIVE
FILE_TITLE 'Seattle & Redmond'
FILE_T'D:\EPHRAIM\*.BGL',REGIONAL,INACTIVE
FILE_TITLE 'Door County Wisconsin'
FILE_T'D:\HAWAII\*.BGL',REGIONAL,ACTIVE
FILE_TITLE 'HAWAII test database'
FILE_T'D:\LONDON\*.BGL',REGIONAL,ACTIVE+PROTECTED
FILE_TITLE 'LONDON test database'
FILE_T'=:\=\*.BGL',REGIONAL,ACTIVE+PROTECTED
FILE_TITLE 'FS5 Default World - Metro'
FILE_T'=:\=\scenery\world\*.BGL',GLOBAL,ACTIVE+PROTECTED
FILE_TITLE 'FS5 Default World'
FILE_T'B:\SAVOY\*.BGL',REGIONAL,INACTIVE
FILE_TITLE 'Small Savoy Database'
EOL

;BOOSTER LIST (FS5.1) **************************************************
;FILE & TYPE ENTITY OPCODE DEFINITIONS -
;OpFormatDefinition
;-----------------------------------------------------------------
;0db0;00 opcode = EOL (end of list)
;1db1;00 opcode = BOOSTER
;db1;01 1= booster active 0= inactive
;dw5000;02 cache size
;db1;04 cache cleanup mode
;;0=cleanup out of area & on exit
;;1=cleanup out of area only
;; 2=never clean up
;db2;05 cache update strategy
;;0=manual 1=semi auto 2=automatic
;db 'source filename',0;06
;db'cache filename',0;nn

BOOSTERmacroactiv,cache_size,cleanup,updt,src,cache
db1;;opcode
dbactiv
dwcache_size;;cache size in K
dbcleanup;;cache cleanup mode
dbupdt;;cache update strategy
dbsrc,0
dbcache,0
endm

INACTV= 0;Booster active/inactive flag
ACTIVE= 1
CLEANALL=0;clean cache on exit and leaving area
CLEANAREA=1;clean cache when leaving area only
NOCLEAN=2;do not clean up cache at all
MANL=0;Cache update strategy
SEMI=1
AUTO=2
BOOSTER_LISTlabel word
BOOSTERINACTV,5000,CLEANALL,AUTO,'c:\cdrom\chicago','c:\chicago'
BOOSTERINACTV,5000,CLEANALL,AUTO,'c:\cdrom\boston','c:\boston'
BOOSTERINACTV,2000,NOCLEAN,MANL,'c:\cdrom\savoy','c:\savoy'
BOOSTERINACTV,5000,CLEANALL,AUTO,'c:\lasvcd','c:\lasvegas'
EOL

driver_endlabelword
BGLSEGends
end

The first byte in the preceding .vis file is the header, which begins by specifying the file length. Then, a 2-byte type ID is specified. These two bytes specify whether this file is a BGL or LOGOL file. In BGL, always include the code ‘MR’ in this field. Following the type ID are six pointers that point to the six data sections: title and description data, the world set ID list, the world sets, the file and type list, world set enhancements, and the booster list.

The title is a 30-ASCII character string that specifies the title of the world set. A zero terminates this string, and any unused characters should be padded by spaces. The total length of the string (with the terminating zero) is 31 bytes. In the example, strings such as “msgvis005” are taken from a message file that is language dependent.

The description is a 255-ASCII character string that is a description of the world set. A zero terminates this string, creating a total length of 256 bytes. In this example, the end of this string is automatically padded with zeros.

The Scenery Library dialog box uses the title and description data to identify the world set name and description to the user.

Every BGL file has a world set ID in its header. The WORLD_ID_LIST in this file is a list of all world set IDs that will be active. Any BGL file that matches one of these world set IDs is processed and displayed; any BGL file that has a world set ID that doesn't match is bypassed and not used. You can set the world set ID in your BGL files to 1 and ensure that they'll be processed and displayed. The following table includes the world set numbers and the "worlds" they define in Flight Simulator.

World set number Description
0 File disabled
1 Default visual scenery
2 Crop duster world scenery
3 Default VORs and ADFs
4 Default ATIS and Landme
1000-1999 A&SD reserved

Flight Simulator 98 uses file specifiers in the .vis file to select files. As a result, world sets take on a somewhat different meaning. However, the world set file filter system works in the same way as in earlier versions of Flight Simulator.

In Flight Simulator 98, A&SD world set numbers have been reserved. A front-end filter is included that filters any files between 1000–1999 if asd_available=0. A&SD sets and clears asd_available by calling the FE_GET_MISC function with ax=2 and 3, respectively.

The file and type list specifies all the scenery sets and where they are located on the hard disk. Each scenery set entry contains the following:

The booster list is used in conjunction with CD scenery and booster processors. For more information, see the topic Using Booster Processors with the Scenery System.

Note: Throughout this SDK there are many references to the front-end processor. The front-end processor is a BGL system module that pulls in scenery data from all available sources and builds up a master list of scenery for the BGL graphics system to display. The specific tasks of the front-end processor are as follows:

Although the specifics that go into the process are complex, the front-end processor's basic function is straightforward: retrieve scenery from all sources and pass a master object list (including seed objects) to the BGL graphics system.