Library Objects

Placing Library Objects in FS2004 using BGLComp

Using this method, you would have to create a separate scenery BGL file for each occurrence of the tree in the Flight Sim.

Using the trees as an example, that’s 50 separate files, each containing the geometry and texturing of the trees, just put in a different location.

That forces the Flight Simulator work hard to load all of these files and use up precious system resources resulting in lower frames per second (frame rate). Again, this method will work, but there is a better way…

Flight Simulator uses libraries.

A Library is a single file that is loaded by Flight Simulator and contains the geometry, texture application and color assignments of the objects similar to the conventional method with one major exception – a library can contain hundreds of different objects.

When making scenery using this method, you will use the library (containing multiple objects) and a separate placement BGL file.

The placement BGL file is a very small file, less an 1K in size for a single object that tells Flight Simulator which object from the library to draw and how to draw it (Lat/Long Location, Altitude, Heading, Scale and so on).

So Flight Simulator loads only the library and is ready to draw on demand. The placement file specifies which object to draw and how.

How does it work?

Each object in the library has a unique 32-digit ID code.

The placement BGL file specifies that ID. Included with the Flight Simulator are objects 3 main libraries: VEHICLES, GENERIC and LANDMARK.

Combined, there are nearly 300 objects in these 3 libraries. Learning the Code BGLComp is a BGL file compiler.

This means it takes your instructions written as text and converts it into a Flight Simulator-readable format. The format for the BGLComp code is XML. XML files are similar to website HTML files with notable differences that we won’t get into here.

We will be creating a simple XML file that will have BGLComp compile a placement BGL file to assign a library object to a desired location in Flight Sim. Before we get too far into the code and understanding, we need to make sure that everything is in place to handle our operations.

The two things that are required to proceed are the BGLComp SDK and the MSXML4, both from Microsoft. First, visit flightsimulator/fs2004_downloads_sdk.asp#bgl and download the BGLComp SDK and install it. By default this will install to: C:\Program Files\FS2004SDK\BGLCOMP.SDK.

An important thing to note here is that this is not a typical Windows-based program.

You will NOT receive any Desktop icon or a shortcut to anything in the Start | Programs menu. BGLComp is a command-line program that is run using DOS commands.

No need to be worried, we won’t be getting into DOS for this procedure!

Another requirement for BGLComp is a support program called MSXML4. You can get this program by visiting details.aspx?FamilyID=3144b72b-b4f2-46da-b4b6- c5d7485f2b42&DisplayLang=en As you can see from the link, this is a Microsoft website.

On the page, there are 4 different download versions depending on your desired use for the MSXML. We recommend you download and install the MSXML.MSI file, which is 5.16 MB at the time this article is written.

Leave a Reply

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