This RFC is for a scheme that allows overlay scenery elements (points, polygons/poly-lines and road networks) in a DSF to be associated with an airport ID; if the airport is specified by a higher priority scenery pack than the one that the DSF resides within, then those DSF elements are not loaded. This mirrors the behavior of apt.dat elements (where all apt.dat elements for an airport whose ID is replaced by a higher priority scenery pack are not loaded).

Implementation Details

This scheme is built on top of a number of layered extensions to the DSF file format.

Comment Types

The DSF file format has (since its inception over a decade ago) contained comment blocks. A comment is a blob of variable-sized arbitrary binary data in the DSF command stream. The comment’s size is known to a DSF parser even if the comment’s contents are opaque, allowing for extension to DSFs with forward compatibility.

Until now, X-Plane did not use comments. This scheme introduces comments with a 16-bit comment type starting the comment block, followed by data specific to the comment type. Comment types can be used in any comment command (8, 16, or 32-bit) as long as the comment’s payload is at least 2  bytes long.

Filter Index Comments

Comment type 1 is defined as a change of the filter index.  The filter index is a 32-bit signed integer indicating what filter is used to process certain DSF commands; a filter of -1 means “no filter is applied”. No filter is treated as the default state; as filter index comments go by, it effectively changes the filter applied to the next command.

Filters are applied to road network, polygon/poly-line and point commands, but not to patches and base mesh.

Filtering Scheme

X-Plane defines filters to include or not include overlay elements by airport ID code using new properties: the property sim/filter/aptid defines a new filter; the value of the property is the airport ID to match.  The filter is defined as including overlay elements if the airport whose ID matches the value is defined by this scenery pack, and as excluding overlay elements if the airport whose ID matches the value is defined by another scenery pack.

X-Plane also uses the filter properties to filter exclusion zone properties; any of the sim/exclude_XXX properties that are after a sim/filter/aptid property in the DSF property table will be included only if the filter is defined as including overlay elements. Exclusion zones defined before any of the filter/aptid filters are always included.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Please do not report bugs in the blog comments.
Only bugs reported via the X-Plane Bug Reporter are tracked.

Meta

Topic:

  • Scenery

Article type:

  • Request for comment (RFC)