• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Flight Docs: Virtual File System

Messages
412
Country
ca-britishcolumbia
Overview:
In order to combat some of the issues we saw in FSX with 3rd parties having to modify the same files for their addons as other developers addons, we developed a virtualized file system for Flight. There are also other benefits of this system, such as improved loading times, faster installations, and easier distribution.
The file system in Flight consists of pak files (uncompressed zip files only), and FileLocator.config files. Each DLC\addon as well as the base Flight app generally has a single FileLocator.config file. The FileLocator.config file specifies a set of pak files to load files from, and contains a "VirtualPath" which is prepended to all the files within that pak. the FileLocator.config can also optionally define variables with values that can be shared in multiple places.

Example:
Code:
<?xml version="1.0" encoding="utf-8"?>
<FileLocator xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Variable Name="ContentName" Value="World DEM" />
  <MappingEntry LocationType="Zip" PhysicalLocation="Content.pak" VirtualPath="[ContentName]" />
  <MappingEntry LocationType="Zip" PhysicalLocation="Languages\Content.[LocaleName].pak" VirtualPath="[ContentName]" />
</FileLocator>
This FileLocator.config specifies to load two different pak files and place both of their contents under the VirtualPath using the "ContentName" variable. "LocaleName" is a special variable that is defined at runtime based on what language of Flight is installed. There are several other built in variables like this.
So, for example if Content.pak in this example contains a file: "scenery\foo.bar", to Flight the full path of that file will be "World DEM\scenery\foo.bar"

File Replacement\Overrides:
Each DLC\addon can specify a set of other DLC that they depend on. The FileLocator.config files of all DLC are processed in a specific order that is determined by the DLC dependencies. FileLocators of dependencies are always loaded prior to the FileLocator of DLC that depend on them. Each MappingEntry within a FileLocator.config is processed in the order they appear in the file. Using this system, it is possible to override files by placing the newer versions in another pak file and having that pak file be processed after another contining files the same virtual paths.
In the example above, if "Languages\Content.[LocaleName].pak" also contains: "scenery\foo.bar", to Flight the full path of that file will be "World DEM\scenery\foo.bar", and it would override the file that is in Content.pak.

File Removal:
If you override a file with a file that is 0 bytes, Flight treats that as removing the file.

Other:
The FileLocators also support specifying a directory to use, but in the public version of Flight there is special code in the engine to disable loading assets (described in the Asset system) from those folders, so you shouldn't try to use it.

The convention we used on Flight was to make the virtual paths for each DLC start with the DLC name (in this example "World DEM") in order to avoid accidental override of files from other DLC. In cases where you want to override files in another specific DLC we put them in a separate .pak file with the same VirtualPath as the DLC you are trying to override.
 
Back
Top