SimpleAerial

The SimpleAerial sample illustrates the process of creating a new package of aerial images to blend in with aerial imagery already in Microsoft Flight Simulator. Creating aerial image add-ons uses a combination of *.PNG files for the images and *.XML files to tell the game how to render the images. Note that images are not stored in the game as PNGs, but rather uses the propriety CGL file format, which requires defining in the XML for the package.

 

You can expand the link below to see the SimpleAerial file and folder structure:

File OverviewFile Overview

|---+ SimpleAerial
    |---+ PackageDefinitions
    |   |---- mycompany-aerial.xml
    |---+ PackageSources
    |   |---+ CGL
    |       |---+ aerial_images
    |       |   |---- 02123020101020302010.png
    |       |   |---- 02123020101020302011.png
    |       |   |---- 02123020101020302012.png
    |       |   |---- 02123020101020302013.png
    |       |   |---- 02123020101020302101.png
    |       |   |---- 02123020101020302110.png
    |       |---- my-cgl-info.xml
    |---- SimpleAerialProject.xml

 

 

Aerial Image Format

Aerial image files are created at the highest level of detail, LOD20:

Level of Detail Map Width and Height (pixels) Ground Resolution (meters / pixel) Map Scale
(at 96 dpi)
20 268,435,456 0.1493 1 : 564.25

 

NOTE: You can find full details of the different LOD values as well as other things related to how map tiles are calculated here.

All image files for aerial images should be authored as 16bit PNG with a fixed size of 256x256px, and the build process will automatically generate the images for the lower levels of detail. Note that the alpha channel of the provided aerial image PNG is used to blend between the image and the in-game aerial, where a pixel with alpha 0 means the in-game aerial pixel is used, and 1 means the provided aerial pixel is used. Any value in-between will create a linear interpolation between the in-game aerial and the provided aerial.

 

 

XML file configuration

The file my-cgl-info.xml file contains the list of XML elements that describe the CGL file type(s) to build in the game. To create CGL files of a specific type from a specific folder, simply add a <CGL /> element inside the <CGLBuilder> element (an example is provided below).

 

The following attributes should be defined:

  • type: Specifies the type of CGL data. For now, the only supported type is SecondaryAerialImage, for custom aerials.
  • input: Specifies the format of the input data. For now, the only supported type is Tiles, which specifies that each of your files is an aerial image for a specific tile, whose name is the quadkey of the tile, with the *.png extension.
  • directory: Specifies in which sub-directory your data are stored in.

 

Here you can see an example line from the my-cgl-info.xml:

<CGLBuilder>
    <CGL type="SecondaryAerialImage" input="Tiles" directory="aerial_images"/>
</CGLBuilder>

 

 

Loading and building the project

In order to load and build the project in Microsoft Flight Simulator, you must have previously enabled Developer Mode (see here for more information). Once enabled, simply follow these steps:

 

  • Use the Open project... command from the File menu.

Developer Mode Open Project

 

  • Select the file SimpleAerial.xml from the SimpleAerial sample project.

SimpleAerial Example Project

 

  • The Project Editor should open automatically and show you the project mycompany-aerial (if the Project Editor doesn't open, then you can open it from the Developer Mode Tools menu)

Project Editor With Aerial Package

 

  • Clicking on the project in the Project Editor will open the Inspector Window, and here you need to click the Build Package button (if the Inspector Window does not open automatically, go to the View menu in the Project Editor and open it from there).

Build Simple Aerial Example

 

  • This will build a package from the files specified in your project. This package will be named mycompany-aerial and will be output in the Packages folder created in the same directory as SimpleAerialProject.xml:

New Package For Aerial Sample

 

Building the package will also install it into Microsoft Flight Simulator and once you start a mission you can teleport to:

  • latitude = 47.000744
  • longitude = -122.858906

There you will see the aerial images applied to the in-game environment.

Aerial Images In The GameNOTE: if your aircraft was already positioned around these coordinates, you may have to teleport far from the area and then get back to it for its cache to be updated.